-
Notifications
You must be signed in to change notification settings - Fork 62
Immediately pause pulse_in after initialization #47
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
Conversation
Right now, pulse_in is active until the first reading and only paused after that. Let's immediately pause it to free up the CPU.
Impressive turnaround, thank you. |
@lane-maxwell Could you confirm that this fixes the problem for you? |
@michaellass @lane-maxwell Please feel free to tag me directly once you've gotten this tested, and I'll request a review from our review group. |
Had pretty much the same problem with 100% CPU of libgpiod_pulsein on Raspberry Pi 3. Patching my local environment with this commit fixed it. |
I can also confirm, this resolved the issue for me. Thank you
|
I also had this in use now for a while, so @kattni, I think this is ready for review from your side. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix!
@hkeown Do you use this DHT library or some other part of Blinka that uses pulseio? To update this library, you would need to run However, this change has just been merged and the change is not included yet in the version you get via pip. You can however edit /usr/local/lib/python3.7/dist-packages/adafruit_dht.py (I guess that is the location) manually as shown here: https://github.com/adafruit/Adafruit_CircuitPython_DHT/pull/47/files#diff-3cb2b6ae0f442877839768eb1ea0386d That all said, I find it very surprising that this library has any influence on the functionality of ethernet or serial connections. |
Updating https://github.com/adafruit/Adafruit_CircuitPython_DHT to 3.5.1 from 3.5.0: > Merge pull request adafruit/Adafruit_CircuitPython_DHT#48 from adafruit/lint > Merge pull request adafruit/Adafruit_CircuitPython_DHT#47 from michaellass/start_paused Updating https://github.com/adafruit/Adafruit_CircuitPython_DPS310 to 1.2.0 from 1.1.5: > Merge pull request adafruit/Adafruit_CircuitPython_DPS310#9 from caternuson/iss8 Updating https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI to 3.5.0 from 3.4.2: > Merge pull request adafruit/Adafruit_CircuitPython_ESP32SPI#105 from makermelissa/master > Merge pull request adafruit/Adafruit_CircuitPython_ESP32SPI#104 from jepler/remove-bad-whitespace-directive Updating https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3731 to 2.6.5 from 2.6.4: > Merge pull request adafruit/Adafruit_CircuitPython_IS31FL3731#31 from esmil/master Updating https://github.com/adafruit/Adafruit_CircuitPython_Seesaw to 1.6.3 from 1.6.2: > Merge pull request adafruit/Adafruit_CircuitPython_seesaw#52 from jepler/remove-bad-whitespace-directive Updating https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO to 4.1.0 from 4.0.0: > Merge pull request adafruit/Adafruit_CircuitPython_AdafruitIO#44 from makermelissa/master Updating https://github.com/adafruit/Adafruit_CircuitPython_MatrixPortal to 1.3.0 from 1.1.1: > Merge pull request adafruit/Adafruit_CircuitPython_MatrixPortal#13 from makermelissa/master > Merge pull request adafruit/Adafruit_CircuitPython_MatrixPortal#12 from makermelissa/master Updating https://github.com/adafruit/Adafruit_CircuitPython_Motor to 3.2.2 from 3.2.1: > Merge pull request adafruit/Adafruit_CircuitPython_Motor#48 from kattni/update-example Updating https://github.com/adafruit/Adafruit_CircuitPython_Requests to 1.6.0 from 1.5.0: > Merge pull request adafruit/Adafruit_CircuitPython_Requests#30 from tannewt/add_tests
The problem with 100% usage of libgpiod_pulsein CPU on Raspberry Pi with DHT22 still exists. However, sometimes you have to wait several hours for it to appear and permanently prevent reading data from the DHT22 sensor. After today's update to the version below, the script runs 8 hours without any problems. Raspbian GNU/Linux 10 (buster) |
But after 8 hours, the problem came back. |
Right now, pulse_in is active until the first reading and only paused after that. Let's immediately pause it to free up the CPU.
This problem was reported by @lane-maxwell at adafruit/Adafruit_Blinka#210 (comment).
This is only mildly tested right now, so please do not merge immediately.