-
Notifications
You must be signed in to change notification settings - Fork 75
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
streaming from "get_async_bleak.py" #216
Comments
Hi! I think for loop is unnecessary. You can try something like this if you want to exit after you have received 10 broadcasts from sensors. async def main():
datas = []
async for found_data in RuuviTagSensor.get_data_async():
print(f"MAC: {found_data[0]}")
print(f"Data: {found_data[1]}")
datas.push(found_data)
if len(datas) > 10:
break
if __name__ == "__main__":
asyncio.get_event_loop().run_until_complete(main()) I will also add other async-example to |
Hi, thanks for your reply - yes the The problem I am having is that after 6 reads from the sensor, the data are no longer printed - like the program is waiting but nothings comes in. if I stop and restart the script, i get 6 more prints and then it hangs again. |
Can you enable debug logging, maybe it will reveal some helpful info import logging
import ruuvitag_sensor.log
from ruuvitag_sensor.log import log
from ruuvitag_sensor.ruuvi import RuuviTagSensor
ruuvitag_sensor.log.enable_console()
log.setLevel(logging.DEBUG)
for handler in ruuvitag_sensor.log.log.handlers:
handler.setLevel(logging.DEBUG) |
Hi, @ttu - thanks a lot for you feedback - I think the issue is in my Ubuntu installation on the desktop machine - the Ruuvi tag sometimes shows listed and sometime doesn't .. I tried reinstalling some libraries, but now it doesn't show anymore. |
Describe the bug
I wanted to stream the output of my ruuvi tasg in a python application- it succesfully find and connect to the device using the "bleak" example, but it stop printing after a few (6) iterations.
Environment (please complete the following information):
when running the following example:
It succesfully print the following log:
but after a few iteration (6) it stops printing .. like is hanging/waiting .. is that expected? should I modify the example to get the data streamed without stop?
Thanks!
The text was updated successfully, but these errors were encountered: