-
Notifications
You must be signed in to change notification settings - Fork 405
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
1-wire doesn't work when using pigpiod #60
Comments
That seems to be a 1-wire fault rather than a pigpio fault. Which model Pi are you using? If I get a chance I'll try out a DS18B20. |
That would be very unfortunate.
Raspberry Pi 1B+. |
I was thinking maybe |
pigpio does not change any GPIO unless requested. Sampling a GPIO level (whether it's an input or an output or in one of the other 6 modes) should not impinge on any other usage. There is no way a userland process like pigpiod should affect an unrelated kernel module. Personally I think the 1-wire module is a bit flaky. |
😞 |
Alternative idea: Is there a way to use |
Not with pigpio. What GPIO are you using for the DHT22? |
I can't duplicate this failure. I have had two DS18B20 connected to GPIO 4 and a DHT22 connected to GPIO 11 running for an hour forty minutes without problem. Did you connect your DHT22 to GPIO 4? A DHT22 is not a 1-wire bus device and I can see that would cause a problem. |
@joan2937 : Thanks for your assistance. The DS18B20 is connected as follows:
The DHT22 is connected as follows:
(I also have a BMP183 connected to the SPI pins but I'm not yet using that.) The DS18B20 gives no problem when used by itself ( EDIT: This morning I (also) started the measurements from the DHT22. I'm using a python script to call |
I was using a original model Pi B (rev. 1). If anything it is less powerful than a Pi B+. You have quite old firmware (3.18.0). I was using 4.1.13+ #826 with Debian (soft float). I'll set mine running again and leave it until it faults or as many hours as I need to convince me It's not going to fault. |
I'm using the official Raspbian kernel (not the Foundation one) as installed by raspbian-ua-netinst
Might take some time. It's been another hour here, without any problems. Yesterday (I seem to remember) it took the better part of the day until it "oopsed". The read failures on the 1-wire slowly started to increase. This could be indicative of a memory leak? Do you think I might have more success using the Python version (your EDIT : The kernel just "Oops"ed again (see below). Since you are not having any problems with kernel 4.x I'm going to try
|
I am using DHTXXD rather than DHT22.py. I'm not monitoring bad 1-wire reads. I have no idea what a normal 1-wire error rate would be. I'm just waiting for a crash. It's been over 12 hours now. |
I decided to
I'm now on The 1-wire script is running flawlessly now (zero errors since 22:00 yesterday evening). I've found that when the 1-wire sensor is on a breadboard there can be some noise from bad connections that disturb the 1-wire protocol. But, when soldered the 1-wire protocol can be expected to be flawless, provided sample times are adhered to (obviously). The |
I'm just over 23 hours. 1 DHTXXD (DHT22) timeout and 9 CRC failures on my two DS18B20. There is nothing else being run on my first revision Pi B. Have you got anything else running on yours? |
Some python scripts: lnxdiagd and domod. These gather various system data, nothing fancy. X is not installed. |
As far as I'm concerned we can consider the issue resolved by the upgrade to kernel 4.4.x. I may come back for the DHTXXD timeouts, but they aren't biting me right now (74 occurences in the past 18hours). They tend to come in groups, always at the start of a minute (xx:xx:00) and then occasionally also at xx:xx:12. |
I expect the DHTXXD are simply time-outs because the system is especially busy. I am not seeing them. Mine has been running for 36 hours during which I've had 3 timeouts and 1 checksum error among over 42 thousand good readings. It would be useful if you could patch your DHTXXD.c and extend the time-out from 0.25 seconds to say 0.5 seconds. To do that change line 337 from I'll leave mine running overnight and if nothing happens I'll close this off as nothing to do with pigpio. |
I agree with your analysis. |
Okay. Two days running. Have now stopped the test. Final stats. DHT2256296 DHT22 reading (every 3.07 seconds, 3 seconds between readings) 56289 good DS18B2072908 DS18B20 every 4.74 seconds (a pair were used, 3 seconds between readings) 36448 28-000005d34cd2 12 CRC fails (which seemed to kill both readings) Conclusionpigpio doesn't affect 1-wire (any more than any other process running at the same time would). |
FYI: Increasing the timeout timer in |
That's a pity. When I get a chance I might try to see what is going on. It's unlikely to be any time soon though. I'll probably use piscope to capture the data concurrently and see if I can identify the failures (probably easiest if each reading is time-stamped) to see what is happening. |
Well, since the fails tend to occur simultaneously with high CPU-load due to other program's activities I'm guessing that would be (part of) the cause. |
I'm having issues with
pigpiod
in combination with 1-wire.When
pigpiod
is not running, the 1-wire sensor (DS18B20) can be read without any problems.However, when I'm also reading measurements from a DHT22 -- using
pigpiod
and theDHTXXD
executable -- I find that the 1-wire sensor file (w1_slave
) occasionally disappears from/sys/bus/w1/devices/28*/
. (DS18B20 id:28-000006978d28
)Ultimately, this ends in a kernel "Oops" like this (sorry
journalctl
lines seem to have been truncated):Some basic system info:
source: http://abyz.co.uk/rpi/pigpio/code/DHTXXD.zip
The text was updated successfully, but these errors were encountered: