GrgoMariani/NVidia-Jetson-DHT22-Python

Unable to read DHT11/DHT22 on Jeston nano

Closed this issue · 5 comments

Tried a few GPIO, keep getting 0 notion:

C_DHT.readSensorDHT11(0)
(-39909.0, -39909.0, 0)

I also noticed the following comment in C_DHT.c but I believe it's obsolete and should be removed

//! MODIFY THESE TWO FUNCTIONS IF YOU WANT TO USE DHT11 SENSOR

I've added some prints and I get the following:

byte0: 0, byte1: 0, byte2: 0, byte3: 0, chcksum: 1

Any idea of how to proceed?

sorry about responding this late, it's just that I don't check this project that often.
I can see that the checksum is not valid. This is strange. Maybe best would be to check your connections.

Did you edit lines 27 & 28 of "C_DHT.c" with the pins you plan to use ???
Maybe you can check "jetsonGPIO.h" and use some other ones.

My problem is that I have none of these boards at my home so I cannot check for you which ones you should use.

I can see that the checksum is not valid. This is strange. Maybe best would be to check your connections.

If I print all the values I actually see no value is read, it just returns

Did you edit lines 27 & 28 of "C_DHT.c" with the pins you plan to use ???

Yes, I've edited and built every time, also tried different combinations of pins.

Maybe you can check "jetsonGPIO.h" and use some other ones.
My problem is that I have none of these boards at my home so I cannot check for you which ones you should use.

You mean to define a different pin than jetsonNanoGPIONumber?
Any thoughts on what may work?
Thanks

I would suggest checking out this link and comparing it to the "jetsonGPIO.h".

It is basically how I did but could not test it because of my lack of device.
It worked for the other boards so I guessed it should also work for this one.

Hey, i am getting the same error on my jetson-nanp 2gb,
I have edited the C_DHT.c file
from
#define PIN0 jetsonxavier_pin37
#define PIN1 jetsonxavier_pin29

to
#define PIN0 jetsonnano_pin37
#define PIN0 jetsonnano_pin29

I am using pin 37 (second last just above ground) and
C_DHT.readSensor(0) command.

You can check out the jetsonGPIO.h for all the pins I found to be used with Jetson Nano:

      jetsonnano_pin32 = 168,    // J21 - Pin 32 - ??? -     LCD_BL_PWM
       jetsonnano_pin16 = 232,    // J21 - Pin 16 - ??? -     SPI_2_CS1
       jetsonnano_pin13 = 14,     // J21 - Pin 13 - ??? -     SPI_2_SCK
       jetsonnano_pin33 = 38,     // J21 - Pin 33 - ??? -     GPIO_PE6
       jetsonnano_pin18 = 15,     // J21 - Pin 18 - ??? -     SPI_2_CS0
       jetsonnano_pin31 = 200,    // J21 - Pin 31 - ??? -     GPIO_PZ0
       jetsonnano_pin37 = 12,     // J21 - Pin 37 - ??? -     SPI_2_MOSI
       jetsonnano_pin29 = 149,    // J21 - Pin 29 - ??? -     CAM_AF_EN

Also check the link above and see if one of them is useful.
From naming conventions i would guess pin33 and pin31 should be the best candidates.