-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
Raspberry Pi zero - "sensor not ready" #105
Comments
I've never tried to use it on a Pi zero and wouldn't really know what the issue could be. It might be some defective contact or instability in the w1 kernel modules. I'm pretty confident that from the Python side and this module there is nothing you can do about this. However, I'll keep this issue open for a few more days just in case someone else had similar experiences and might be able to help you. 🎉 |
I can tell you it's not a PiZero problem with the module, since I've used it on them since way back when. You could try a different pin and see if that helps. Saying that, not sure if any of mine have used a recent buster image. |
I agree that it should have to do somehow with the pi zero since it is very reproducible. Tested it with 3 different zeros - all behaved the same. No issues on the larger Pi. My workaround is that I read the sensor permanently all 2 seconds in its own thread and write the measurements in a variable that I read out when ever I need it. Its not time critical, so this solution is ok. |
Yes - its in the Pi forum. I've put it there first, since I thought its more Pi related. I've received a comment that I should message the developer and thats why I've put it here. The sensor sits on a custom made pcb, so switching the pin in that setup is not possible, but I'll investigate further with connecting the sensor directly and use different pins. |
Similar issue here fwiw. File "/usr/local/lib/python3.7/dist-packages/w1thermsensor/core.py", line 267, in get_temperature These errors turn up intermittently. No pattern. I'm reading a single sensor every 10s. Sometimes it might fail after an hour or so. Sometimes after 8hrs. |
I got the same error
It is a hardware issue. I think it is a wire issue. I am using the cable jumper dupont and I soldered it with tin. |
I have the same problem on two Raspberry Pi Model B first generation, ie the single core. I agree that there is nothing wrong with the python code, but I suspect that the python implementation itself of the function readlines is flaky, perhaps only on low-performance devices. To investigate, I wrote a simple shell script and ran it parallel to my python code, which produced many SensorNotYetReady errors:
When the sensor returns nothing, this produces two (or more) subsequent rows where only the sensor ID is listed. I noticed that this simple code rarely produces no result, whereas the python code very frequently returns no result and throws the above exception.
I'll investigate on a later model Pi, next. |
I have now tested this on Pi models 2, 3, and 4. Result: no read errors whatsoever on any of them.
I agreed that there is nothing wrong with the python code. Also, because reading the w1 devices from a bash shell rarely fails, by implication there must be some defect in the underlying python os.read code. My guess is that it doesn't wait long enough for the driver to return the result, ie. some kind of timing problem. I raise a defect with python. |
I had the same problem with my Pi Zero. However, updating the firmware with rpi-update to 6.1.12 (as of today) solved this issue for me. |
Important notices
Before you add a new report, we ask you kindly to acknowledge the following:
[x] I have read the contributing guide lines at https://github.com/timofurrer/w1thermsensor/blob/master/.github/CONTRIBUTING.md
[x] I have read and respect the code of conduct at https://github.com/timofurrer/w1thermsensor/blob/master/.github/CODE_OF_CONDUCT.md
[x] I have searched the existing issues and I'm convinced that mine is new.
Ask your Question
Hi!
While w1thermsensor works flawlessly on my various Pi4 and Pi3, I struggle with it on the Pi zero (I've tried a few).
It will give me a "sensor not ready" error about 3 out of 10 times.
I can handle that as an exception in python, but I wonder what I should do differently on the zero.
I'm using the exact same setup in all cases (same SD card, same GPIO and sensor)
some more info:
Raspberry OS buster
python 3.7.3
w1thermsensor version 2.0.0
thanks a lot!
The text was updated successfully, but these errors were encountered: