New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing DHT-Library is not recognized correctely, entry in webradio.log is missing #14

Open
Acer54 opened this Issue Feb 10, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@Acer54
Copy link
Owner

Acer54 commented Feb 10, 2019

If "Adafruit-DHT" is not installed correctely according the Wiki, but the corresponding section in webradio.conf is "activated" like:

[DHT11]
# IMPORTANT: give the GPIO not the Pin-No (Pin3 is GPIO2 for example)

# GPIO_TEMP: Where is the DHT11-Sensor connected with the I2C Line to the Pi ? Use GPIO! (Pin3, is GPIO2)
GPIO_TEMP=2
# delay_tempmeasurement : How often (in Seconds) should the Temperature-Label updated ? in Seconds! 3 minutes == 180sec.
delay_tempmeasurement = 180

The lib is failed to load, during startup, but is tried to use. This leads to an error-entry in webradio.log:

2019-02-10 10:10:15,713 - ERROR - webradio.py - excepthook - Uncaught exception
Traceback (most recent call last):
File "/opt/webradio/lib/gpio_watchdog.py", line 305, in run
self.function(*self.args,**self.kwargs)
File "/opt/webradio/lib/gpio_watchdog.py", line 168, in startup_temperature_sensing
humidity, temperature = Adafruit_DHT.read_retry(tempsensor, GPIO_TEMP)
NameError: global name 'Adafruit_DHT' is not defined

The root-cause is the missing DHT11 Lib, but this should be recognized anyway and avoided.
"gpio_watchdog.py" has to be adjusted (import-section) in order to catch this situation properly.
Also this "warning" should be present in the logs as well, for debugging purposes.

@Acer54 Acer54 added the enhancement label Feb 10, 2019

@Acer54 Acer54 self-assigned this Feb 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment