aaronwmorris / indi-allsky

Software to manage a Linux-based All Sky Camera.
GNU General Public License v3.0
219 stars 35 forks source link

DHT22 sensor not working #1400

Open WirthmU opened 1 month ago

WirthmU commented 1 month ago

I am using a GrovePi Plus HAT with several sensors attached on a Raspberry PI. The board has both digital and analog ports. I could readout the sensor values without any problem with previous OS versions of the RPI. Now after switching to bookworm the board seems no longer supported because of missing python drivers. The digital sensors still are visible via I2C and can be used. However the analogue DHT22 (AM2302; attached to D4 / Pin 12 / PWM0) and the GUVA-S12D (attached to A0) sensors can no longer be read.

Is there any chance the two sensors can get read?

aaronwmorris commented 1 month ago

For the DHT22, from what I have read on the Seeedstudio wiki, it is wired directly to the D4 pin of the Raspberry Pi, so you should be able to read that using the existing DHT22 integration in indi-allsky.

I am looking for references for the GUVA-S12D

Just putting this here for reference.

https://wiki.seeedstudio.com/GrovePi_Plus/

https://wiki.seeedstudio.com/Grove-UV_Sensor/

WirthmU commented 1 month ago

For the DHT22 I have tried both GPIO PWM Pins PWM0 (GPIO 12) and PWM1 (GPIO13) (https://pinout.xyz/pinout/pin32_gpio12/). None of them seem to work.

indi-allsky) pi@meteotux:~/indi-allsky $ ./misc/sensor_test.py
[WARNING]: Initializing [Sensor A] TSL2561 I2C light sensor device @ 0x29
[WARNING]: Initializing [Sensor B] SI1145 I2C light sensor device @ 0x60
[WARNING]: Initializing [Sensor C] DHT22 temperature device
[INFO]: [Sensor A] Switching TSL2561 to day mode - Gain: 0, Integration: 1
[INFO]: [Sensor A] TSL2561 - lux: 24456.4739, broadband: 23595, ir: 8182
[INFO]: Sensor 0: {'sqm_mag': 1.6125747874696768, 'data': (24456.47385791795, 23595, 8182)}
[INFO]: [Sensor B] SI1145 - visible: 5504, ir: 46943, uv: 28.130
[INFO]: Sensor 1: {'data': (5504, 46943, 28.13)}
[ERROR]: SensorReadException: DHT sensor not found, check wiring
aaronwmorris commented 1 month ago

Do you have the pull up resistor installed for the DHT22?

WirthmU commented 1 month ago

No - I have not. The Seeedstudio DHT22 pro comes with a cable which one uses to plug it to the D4 port of GrovePi_Plus HAT (https://wiki.seeedstudio.com/Grove-Temperature_and_Humidity_Sensor_Pro/)

aaronwmorris commented 1 month ago

Can you confirm which hat you have? GrovePi Plus for Raspberry Pi or GrovePi+

WirthmU commented 1 month ago

It's a GrovePi+ (the blue one).

aaronwmorris commented 1 month ago

Okay, that explains my confusion. I got the module conflated when I was researching. For the GrovePi+, the digital pins are hooked to the atmega328 and you have to access the values via the I2C connection between the atmel chip and the raspberry pi. This is not going to work with the existing code.

Let me do some more research.