-
Notifications
You must be signed in to change notification settings - Fork 64
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
Addition of test timing script #68
Conversation
Get latest code from upstream
Addition of a script to test best timing for DHT sensor.
Fix minor issue on printing best timing
Add licensing so build does not fail.
@yeyeto2788 Thanks for the contribution, as discussed I will try on my side also after our discussion. |
@jposada202020 Sure, no problem on my side. |
@yeyeto2788 in case of need you cold take a look at these guide https://learn.adafruit.com/improve-your-code-with-pylint, however feel free to contact me to guide you in this process |
Add more details on console output like the number of tries per trig_wait
Fix issues on linting.
Add more description and also what parameters were used on the test.
Sample output for latest commit. (venv) yeyeto2788@orangepilite:~/workspace/mudpi-core$ sudo /home/yeyeto2788/workspace/mudpi-core/venv/bin/python test1.py
[sudo] password for yeyeto2788:
Initializing test with the following parameters:
Maximum retries per waiting time: 10
Start time (ms): 500
End time (ms): 2000
Increment time (ms): 100
This execution will try to read the sensor 10 times
for 15 different wait times values.
Using 'trig_wait' of 500
Total read(s): 4
Using 'trig_wait' of 600
Total read(s): 2
Using 'trig_wait' of 700
Total read(s): 5
Using 'trig_wait' of 800
Total read(s): 6
Using 'trig_wait' of 900
Total read(s): 6
Using 'trig_wait' of 1000
Total read(s): 5
Using 'trig_wait' of 1100
Total read(s): 6
Using 'trig_wait' of 1200
Total read(s): 5
Using 'trig_wait' of 1300
Total read(s): 5
Using 'trig_wait' of 1400
Total read(s): 6
Using 'trig_wait' of 1500
Total read(s): 8
Using 'trig_wait' of 1600
Total read(s): 8
Using 'trig_wait' of 1700
Total read(s): 0
Using 'trig_wait' of 1800
Total read(s): 6
Using 'trig_wait' of 1900
Total read(s): 8
Maximum reads: 8 out of 10 with the following times: 1500, 1600, 1900 |
I have tested the code above, I did make some changes to use it with my RP4. RP4 with a DHT22
Maximum reads: 10 out of 10 with the following times: 400, 700, 1200, 1300, 1400, 1600
Maximum reads: 10 out of 10 with the following times: 400, 700, 1300, 1600, 1700
Maximum reads: 10 out of 10 with the following times: 400, 500, 600, 900, 1100, 1200
Maximum reads: 10 out of 10 with the following times: 300, 600, 700, 1000, 1100, 1300, 1400, 1600, 1800, 1900
Maximum reads: 10 out of 10 with the following times: 500, 800, 1000, 1300, 170
Maximum reads: 10 out of 10 with the following times: 1600
Maximum reads: 10 out of 10 with the following times: 500, 700, 900, 1000, 1100, 1300, 1900
Maximum reads: 10 out of 10 with the following times: 400, 800, 1000, 1300, 1400, 1500, 1600, 1800, 1900
Maximum reads: 10 out of 10 with the following times: 1000, 1100, 1200, 1300, 1400
RP4 with a DHT11
Maximum reads: 10 out of 10 with the following times: 15600, 15800, 16200, 16600, 17400, 17600, 18000, 18200, 18600, 19400, 20400, 21000, 21200, 23000, 23400, 23800, 24200
Maximum reads: 10 out of 10 with the following times: 15800, 16200, 16600, 16800, 17000, 17200, 17800, 18000, 18600, 18800, 19000, 19600, 19800, 20000, 20600, 21000, 21400, 22200, 22600, 22800, 24200
Maximum reads: 10 out of 10 with the following times: 15000, 15600, 16000, 16200, 16400, 17200, 17600, 17800, 18000, 18200, 20800, 21000, 21400, 22800, 23600, 24600, 24800
Maximum reads: 10 out of 10 with the following times: 16600, 17800, 18000, 18200, 22000, 22200, 22400, 24000, 24600
Maximum reads: 10 out of 10 with the following times: 15000, 15400, 15600, 16000, 16600, 17000, 17200, 17800, 18200, 19000, 19200, 19400, 19600, 20000, 20200, 20600, 21000, 21200, 22200, 22600, 23000, 23200, 23800
Maximum reads: 10 out of 10 with the following times: 15400, 16200, 16400, 17000, 17200, 17800, 18200, 18400, 20000, 20600, 20800, 22000, 22400, 22600, 23400, 24000, 24200, 24400
Maximum reads: 10 out of 10 with the following times: 15200, 15600, 15800, 16400, 16600, 16800, 17000, 17200, 17400, 17600, 18000, 18400, 18600, 19200, 21800, 22600, 23800, 24400
Maximum reads: 10 out of 10 with the following times: 16000, 16400, 17000, 17200, 17400, 17800, 18000, 18200, 18400, 19400, 19800, 20600, 21200, 22000, 22200, 22400, 22600, 24200, 24800
Maximum reads: 10 out of 10 with the following times: 15000, 15600, 16200, 16400, 16600, 17000, 17800, 18200, 19000, 19200, 19400, 19800, 20400, 20600, 21200, 22000, 22200, 22600, 23000, 23200, 23800, 24200, 24600, 24800
I have some comments for the code, I will given my feedback shortly thanks. |
@yeyeto2788 Thanks again
Feel free to ignore the following comments if you disagree, there are just to have use the same standard as in other code and no a requirement. Thanks again for your contribution. |
Add better description to the advance script. Add the `venv` folder to be ignore. Add the ussage of the script for the documentation.
Add new line on file
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 revision just to minor changes, Ithink th CI will stop complaining after this.
Thanks :)
Add longer heading underscore line.
Updating https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground to 4.3.3 from 4.3.2: > Merge pull request adafruit/Adafruit_CircuitPython_CircuitPlayground#104 from kattni/main-fix > "Increase duplicate code check threshold " Updating https://github.com/adafruit/Adafruit_CircuitPython_DHT to 3.6.0 from 3.5.8: > Merge pull request adafruit/Adafruit_CircuitPython_DHT#68 from yeyeto2788/master > "Increase duplicate code check threshold " Updating https://github.com/adafruit/Adafruit_CircuitPython_FocalTouch to 1.2.7 from 1.2.6: > Merge pull request adafruit/Adafruit_CircuitPython_FocalTouch#20 from adafruit/linting > "Increase duplicate code check threshold " Updating https://github.com/adafruit/Adafruit_CircuitPython_RockBlock to 1.3.3 from 1.3.2: > Merge pull request adafruit/Adafruit_CircuitPython_RockBlock#21 from adafruit/linting > "Increase duplicate code check threshold " Updating https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k to 1.9.3 from 1.9.2: > Merge pull request adafruit/Adafruit_CircuitPython_Wiznet5k#32 from adafruit/linting > "Increase duplicate code check threshold " Updating https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO to 5.2.4 from 5.2.3: > Merge pull request adafruit/Adafruit_CircuitPython_AdafruitIO#68 from brentru/validate-feed-keys-used > "Increase duplicate code check threshold " Updating https://github.com/adafruit/Adafruit_CircuitPython_AVRprog to 1.3.7 from 1.3.6: > Merge pull request adafruit/Adafruit_CircuitPython_AVRprog#21 from adafruit/linting > "Increase duplicate code check threshold " Updating https://github.com/adafruit/Adafruit_CircuitPython_BitmapSaver to 1.1.6 from 1.1.5: > Merge pull request adafruit/Adafruit_CircuitPython_BitmapSaver#14 from kmatch98/patch-2 > "Increase duplicate code check threshold " > Merge pull request adafruit/Adafruit_CircuitPython_BitmapSaver#17 from FoamyGuy/pylintrc Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE_Radio to 0.3.5 from 0.3.4: > Merge pull request adafruit/Adafruit_CircuitPython_BLE_Radio#15 from adafruit/linting > "Increase duplicate code check threshold " Updating https://github.com/adafruit/Adafruit_CircuitPython_BoardTest to 1.2.6 from 1.2.5: > Merge pull request adafruit/Adafruit_CircuitPython_BoardTest#15 from adafruit/linting > "Increase duplicate code check threshold " Updating https://github.com/adafruit/Adafruit_CircuitPython_datetime to 1.1.3 from 1.1.2: > Merge pull request adafruit/Adafruit_CircuitPython_datetime#8 from adafruit/jepler-integer-total_seconds > "Increase duplicate code check threshold " Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Text to 2.18.3 from 2.18.2: > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#150 from jposada202020/advanced_example > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#149 from jposada202020/optimizing_getting_font_info Updating https://github.com/adafruit/Adafruit_CircuitPython_RGBLED to 1.1.5 from 1.1.4: > Merge pull request adafruit/Adafruit_CircuitPython_RGBLED#15 from adafruit/dherrada-patch-1 > "Increase duplicate code check threshold " Updating https://github.com/adafruit/Adafruit_CircuitPython_RSA to 1.2.4 from 1.2.3: > Merge pull request adafruit/Adafruit_CircuitPython_RSA#18 from adafruit/linting > "Increase duplicate code check threshold "
Hey guys!
I stumble across issue #66 and just wanted to create a script so we can test best timing on reading data from the DHT sensor.
Example output: