Closed yeyeto2788 closed 3 years ago
@yeyeto2788 Thanks for the contribution, as discussed I will try on my side also after our discussion. After this initial verification I can share my results and let people comment on this example, and then we could work on the code format in order to the CI to pass if you agree. Thanks for your contribution
@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
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 I have a couple of comments. Please do not hesitate to contact me here or in discord if you need help/guidance with anything.
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. Spaces between lines in the import libraries.
Thanks again for your contribution.
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: