Skip to content
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

RPI Zero-W using pin 5.. #5

Closed
WadeJA opened this issue Aug 13, 2017 · 6 comments
Closed

RPI Zero-W using pin 5.. #5

WadeJA opened this issue Aug 13, 2017 · 6 comments

Comments

@WadeJA
Copy link

WadeJA commented Aug 13, 2017

First time posting so hopefully properly. Am experimenting w/RPI3s + several Zero Ws. Using DS18B20s on pin 4 (GPIO4) so DHT22 is connected to pin 5. Code snippet is:
humSensor := dht.DHT22
dht22Temp, dht22Humidity, _, err := dht.ReadDHTxxWithRetry (humSensor, 5, false, 10)

Code runs fine in RPI3 but errors on Zero. have swapped Zeros, 22s, all connector wires betw RPIs & breadboards, tried several resistor values. Errors I see are:
Failed to open gpio direction for writing!
2017-08-13T04:36:51.860 [dht] WARN Error during call C.dial_DHTxx_and_read()
2017-08-13T04:36:54.080 [dht] WARN Can't decode pulse array received from DHTxx sensor, since incorrect length: 79
2017-08-13T04:36:56.293 [dht] WARN High edge value duration 100µs exceed expected maximum amount 97µs
2017-08-13T04:36:58.502 [dht] WARN Control sum 221 doesn't match 115 (130+235+1+5)
2017-08-13T04:37:00.719 [dht] WARN Control sum 220 doesn't match 141 (129+214+17+37)
2017-08-13T04:37:02.937 [dht] WARN Humidity value exceed 100%: 149.4
2017-08-13T04:37:05.154 [dht] WARN High edge value duration 107µs exceed expected maximum amount 97µs
2017-08-13T04:37:07.361 [dht] WARN Control sum 158 doesn't match 0 (3+247+1+5)

Have lotsa experience w/various languages, etc, etc. But do not understand what the problem w/the Zeros is. Both Zeros do the same thing, so I'd guess it's cockpit error or (perhaps?) difference in Zero using the lib. Thanks in advance for your help and kindness.

@d2r2
Copy link
Owner

d2r2 commented Nov 30, 2017

Hi, sorry for later response. I not sure, that DS18B20s is compatible in "1-wire protocol" with DHT sensors. It's pity, that I have no such device on my hands, so I can't verify how it works with this library. May be latter I will get one, but it take additionally month or so. If you still need a help with this, please, let me know.
Best regards,
Denis

@WadeJA
Copy link
Author

WadeJA commented Nov 30, 2017 via email

@d2r2
Copy link
Owner

d2r2 commented Dec 18, 2017

Hi John! Thank you for your kindness to send me DS18B20s and other hardware, but I guess this is a long way from you (Kazakhstan located between Russia and China), so better I will order these set from Aliexpress :)

Honestly speaking, working with GPIO in this way is a pain, especially when you move from one device to another, since on the lower layer all these devices have their own incompatible register set to access GPIO pins. That's why sometimes you need to find specific python library to operate on specific device. So, perhaps there is some incompatibility exists for device that I didn't test (I think it's better in the future move to other type of temperature sensors, which use for instance i2c interface).

It's funny, but in my github repository I have go-adaptation for HD44780 device as well: [go-hd44780] (https://github.com/d2r2/go-hd44780). I don't know have you tried it, but let you know in any case.

@d2r2
Copy link
Owner

d2r2 commented Apr 10, 2018

@WadeJA John, did you find the root cause of issue with RPI Zero? I will close this thread in a week, since, as I understand, the issue is not directly related to the library. If you have any thoughts on this please let me know during a week.

@WadeJA
Copy link
Author

WadeJA commented Apr 13, 2018

I DID make some changes to the software, then decided to run it thru a fair amount of time over a fair amount of real condition temperature variations. Am not able to get the code change snippet but can do so w/in the next week. Will be happy to share w/you. Since I haven't done this before, If you would help by suggesting a mechanism to share, I'd appreciate it. Thank you.

@d2r2
Copy link
Owner

d2r2 commented Jun 22, 2018

Hi @WadeJA! As I know DS18B20s has its own "1-wire protocol", and if DHT sensor protocol gives milliseconds between signals, DS18B20s require microseconds. So, microsecond delays are not compatible with Linux User space (because Linux is not a real time OS). But, still you able to read data from DS18B20s, but using specific kernel module, which can process microsecond delays (even 2 modules: w1-gpio, w1-therm).
I guess, you should read tutorial here.

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

No branches or pull requests

2 participants