Any way of using bleak in a non blocking way?
See original GitHub issue- bleak version:0.14.3
- Python version:3.9
- Operating System:Android
- BlueZ version (
bluetoothctl -v
) in case of Linux:
Description
Bleak commands are working perfectly but while it is in process it blocks the whole app, any way to use bleak in a non blocking way .Tried threading at first but didnt work . any other way it can be done?
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top Results From Across the Web
How to Send Data between PC and Arduino using ...
A how-to guide on connecting your PC to an Arduino using Bluetooth LE and Python. To make it easier, we will use bleak...
Read more >Run bleak (python library) in background with asyncio
Be aware that in asyncio you're not allowed to call anything that might block. All blocking calls must be async and called using...
Read more >Troubleshooting — bleak 0.20.0a1 documentation
The easiest way to enable logging is to set the BLEAK_LOGGING environment variable. Setting the variable depends on what type of terminal you...
Read more >Asyncio with Threading and Bleak : r/learnpython
I'm trying to write a script that will connect to a BLE device (using bleak), receive uart data, and then be able to...
Read more >Bookforum and a Bleak Year for Literary Magazines
Criticism has a way of surviving without infrastructure, but there is no replacement for institutions that cultivate a point of view over time....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
To start, there should be one top-level
asyncio.run()
to run the entire app as in https://github.com/hbldh/bleak/blob/develop/examples/kivy/main.py. There should be no other calls that start a new event loop. Instead, there are functions likeasyncio.create_task()
that can start running an async coroutine from a non-async function.Since the popup code is not awaitabile, it doesn’t need to be in an
async
function.Maybe something like this?
The scan1() is called on the press of a button. What happens is the scan is done and after that the popup is called which is wrong. Cant really figure out a way to do both these things simultaneously. Is there anything wrong in the code??