No Sensor-readings, Variable "airquality" not declared for DHT11, DHT22, AM2302 ? #453

Closed
opened 2021-12-10 05:44:35 +00:00 by manuelwolfcgm · 7 comments
manuelwolfcgm commented 2021-12-10 05:44:35 +00:00 (Migrated from github.com)

Describe the bug
No Readings for DHT11 (which is tested and had been working up to the latest push) and AM2302. The sensors are working fine and already have been working in the enclosure-plugin. I needed to reinstall the plugin - and after that, I cant get any readings any more, although the sensor is accesible via a test-script.

To Reproduce
Fresh Plugin-Installation; Sensor shows no values; Log shows errors complaining about modifying a not-declared variable "airquality" in getDHTTemp.py

Expected behavior
....sensor should display values! (Tested via a smal test-py-script)

Additional context
image

It seems that in the last push, there have been adjustments in getDHTTemp.py, especially adding handling of the airquality-variable. For Sensors DHT11, 22, AM2302, this variable isn't declared, is it? I'll try so switch line 1026 to its previous version, not using the airqualtity-parameter (which is not useful for me). Maybe this is enough change in my case...
2021-12-10 06_24_38-Window
2021-12-10 06_35_26-Window

**Describe the bug** No Readings for DHT11 (which is tested and had been working up to the latest push) and AM2302. The sensors are working fine and already have been working in the enclosure-plugin. I needed to reinstall the plugin - and after that, I cant get any readings any more, although the sensor is accesible via a test-script. **To Reproduce** Fresh Plugin-Installation; Sensor shows no values; Log shows errors complaining about modifying a not-declared variable "airquality" in getDHTTemp.py **Expected behavior** ....sensor should display values! (Tested via a smal test-py-script) **Additional context** ![image](https://user-images.githubusercontent.com/44769659/145523169-7db056a9-1321-470a-9cce-7e3b7f306644.png) It seems that in the last push, there have been adjustments in getDHTTemp.py, especially adding handling of the airquality-variable. For Sensors DHT11, 22, AM2302, this variable isn't declared, is it? I'll try so switch line 1026 to its previous version, not using the airqualtity-parameter (which is not useful for me). Maybe this is enough change in my case... ![2021-12-10 06_24_38-Window](https://user-images.githubusercontent.com/44769659/145522834-27d73e61-e170-4af6-9a6c-9d71b693380e.png) ![2021-12-10 06_35_26-Window](https://user-images.githubusercontent.com/44769659/145522844-0fcc70ed-7def-497c-a57d-8552f4980b59.png)
manuelwolfcgm commented 2021-12-10 06:44:59 +00:00 (Migrated from github.com)

....added
"airquality = 0"
in the if-clause for DHT11,22,2302 ( init.py )-> seems to work so far....
image
image

....added "airquality = 0" in the if-clause for DHT11,22,2302 ( __init__.py )-> seems to work so far.... ![image](https://user-images.githubusercontent.com/44769659/145529486-4064e8d0-5e68-4ac1-aadc-8d34742c6aa4.png) ![image](https://user-images.githubusercontent.com/44769659/145529586-374d14b6-4c38-4ac3-855a-d65578a0ced1.png)
plani-de commented 2021-12-11 20:50:16 +00:00 (Migrated from github.com)

I had the same issue and adding the missing airquality = 0 line helped at first, but now I continously get the follwoing error message:
`2021-12-11 20:47:18,056 - octoprint.plugins.enclosure - INFO - Failed to execute python scripts, try disabling use SUDO on advanced section of the plugin.

2021-12-11 20:47:18,057 - octoprint.plugins.enclosure - WARNING - An exception of type ValueError occurred on log_error. Arguments: ('not enough values to unpack (expected 2, got 1)',)
Traceback (most recent call last):
File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_enclosure/init.py", line 1127, in read_dht_temp
temp, hum = stdout.decode("utf-8").split("|")
ValueError: not enough values to unpack (expected 2, got 1)
`

Anybody here who has an Idea. By the way, it makes no difference wether or not I disable/enable the "use SUDO".
I also activated the logging function, but I get no futher details, e.g. what the AM2302 reads.

I had the same issue and adding the missing `airquality = 0` line helped at first, but now I continously get the follwoing error message: `2021-12-11 20:47:18,056 - octoprint.plugins.enclosure - INFO - Failed to execute python scripts, try disabling use SUDO on advanced section of the plugin. 2021-12-11 20:47:18,057 - octoprint.plugins.enclosure - WARNING - An exception of type ValueError occurred on log_error. Arguments: ('not enough values to unpack (expected 2, got 1)',) Traceback (most recent call last): File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_enclosure/__init__.py", line 1127, in read_dht_temp temp, hum = stdout.decode("utf-8").split("|") ValueError: not enough values to unpack (expected 2, got 1) ` Anybody here who has an Idea. By the way, it makes no difference wether or not I disable/enable the "use SUDO". I also activated the logging function, but I get no futher details, e.g. what the AM2302 reads.
tanant commented 2022-02-17 01:06:30 +00:00 (Migrated from github.com)

@plani-de not sure if it's the same cause however I'm talking through on #459 something that has the same error msg - I've put a rough summary of two things that I think are worth checking https://github.com/vitormhenrique/OctoPrint-Enclosure/issues/459#issuecomment-1038530919 if that helps any?

@plani-de not sure if it's the same cause however I'm talking through on #459 something that has the same error msg - I've put a rough summary of two things that I think are worth checking https://github.com/vitormhenrique/OctoPrint-Enclosure/issues/459#issuecomment-1038530919 if that helps any?
tanant commented 2022-02-18 19:14:43 +00:00 (Migrated from github.com)

@manuelwolfcgm quick sanity check, do the changes in #461 (specifically commit e1f0372a63 ) cover what you did?

@manuelwolfcgm quick sanity check, do the changes in #461 (specifically commit https://github.com/vitormhenrique/OctoPrint-Enclosure/commit/e1f0372a63905f5f9de89b68c689aa5be6b209c5 ) cover what you did?
manuelwolfcgm commented 2022-02-18 19:18:26 +00:00 (Migrated from github.com)

@manuelwolfcgm quick sanity check, do the changes in #461 (specifically commit e1f0372 ) cover what you did?

I did nothing more than this "airquality = 0" -> seems ok from my point of view

> @manuelwolfcgm quick sanity check, do the changes in #461 (specifically commit [e1f0372](https://github.com/vitormhenrique/OctoPrint-Enclosure/commit/e1f0372a63905f5f9de89b68c689aa5be6b209c5) ) cover what you did? I did nothing more than this "airquality = 0" -> seems ok from my point of view
tanant commented 2022-02-18 19:25:57 +00:00 (Migrated from github.com)

Gotcha, so yeah, that might mean this issue is resolved by #461, which is good to know

Gotcha, so yeah, that might mean this issue is resolved by #461, which is good to know
vitormhenrique commented 2022-02-28 17:46:02 +00:00 (Migrated from github.com)

Fixed!

Fixed!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Gandalf/OctoPrint-Enclosure#453