glitch452/MMM-LocalTemperature

Sensor read Error

zerosamski opened this issue · 2 comments

Hiya :)

I'm having trouble getting the module to read the data from the sensor. The sensor is wired correctly, and when using a python script I'm able to get the temperature and humidity
Temp: 71.6 F / 22.0 C Humidity: 61%

But when using the module I get following error in the console of MagicMirror

MMM-LocalTemperature.js:459 MMM-LocalTemperature: Sensor read Error, trying again in 10 seconds. {"killed":false,"code":1,"signal":null,"cmd":"sudo modules/MMM-LocalTemperature/DHT 0 -m j -a 3","stderr":"Unable to read sensor data after 3 attempt(s).\n"}

My config.js settings are as follows:

{
            module: "MMM-LocalTemperature",
            position: "top_left", // Only add a position if you want this module to display the data
            header: "Room Temperature",
            config: {
                sensorPin: 17, 
            }
        },

I'm using a Raspberry Pi 4b, and have updated WiringPi to version 2.52.

Am I doing something wrong here? I've tried different variations of sensorPin and pinScheme in config, but the error remains.... Any help would be greatly appreciated!

seems like the sudo is the issue I tried it in with the C program supplied with this module and it is working when executed without sudo.

image

Hi, I tested on a pi4b and it seems that without updating wiringpi, it doesn't work with sudo, but after updating it does. I'm updating the module (hoping to release it today) to make sudo optional, as well as adding the instructions to update wiringpi for the pi4b.