-
-
Notifications
You must be signed in to change notification settings - Fork 561
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
PM2.5 Faster Readout #111
Comments
Why do you need more speed? Does the sensor (PM2.5) update so frequently? :-) |
That is a great question! I'm trying to implement a makeshift computer vision for cars and PM2.5 correlation. So refresh rate improvements would be great at any level! If discovering a python mechanism what would elliminate any overhead in the readout of the sensor ouput, at least by a 20% - 30%, it would mean a huge improvement for the computer vision project. I think my question can also be interpreted as this: Thank you all! |
I think it makes sense to create your own script for your use-case (which was interesting to hear, btw!), but unfortunaly(?) there is no currently way to say whether the handshake is done as a part of communication. The basic workflow would however look like this, which would assuming there are no other limitations on the device would go like this:
Adding a cache instead of sending a handshake for every request is something we could merge assuming it won't break anything. Making it send the handshake for each requests was just an easy way out at that point. edit: from the looks if it, you are not using this library actually? If so, I think this issue could be closed (although avoiding unnecessary handshakes would still be nice to have!) -- otherwise the instructions I wrote above will stand; you do not want to execute the command from the shell for each invocation but run it in a loop. |
Thank you rytilahti! Your points make a lot of sense. I was hoping to find out an out-of the box, but it seems I'll have to get my hands dirty as I'm not yet well enough versed in Python, but the challenge is thrilling. Closing the issue! |
Hello everyone, greetings from Colombia!
I'm trying to figure out the best way to create a listener service that can have a short polling interval from the PM2.5 sensor data.
Executing the command
miio --control 192.168.0.22 --method get_prop --params '["aqi","power","battery","usb_state"]'
provides de desired information, but it takes too long to process (I'm assuming there is some initialization done each time the miio command is executed).Any suggestins on how to implement a more quick/efficient sensor readout using this library?
thank you!
The text was updated successfully, but these errors were encountered: