adafruit / Adafruit_CircuitPython_BLE

Bluetooth Low Energy (BLE) library for CircuitPython
MIT License
127 stars 58 forks source link

Can't use multiprocessing on the BLE connections to retrieve data from multipe devices at the same time #120

Open sreerajpunnoli opened 3 years ago

sreerajpunnoli commented 3 years ago

I have been trying to get data out from multiple pulse-oximeters at the same time. I was able to run them separately in two different environments and able to extract data from two pulse-oximeters at the same time. I tried to use multiprocessing after the BLE connection to retrieve data parallelly from two pulse-oximeters in the same environment, the connection is getting lost and data is no longer getting received. Then I removed multiprocessing to check whether the code is right and verified that the data is getting retrieved from the code. How do I retrieve data from multiple BLE devices at the same time using multiprocessing with the library?

sreerajpunnoli commented 3 years ago

This is happening only in Raspberry Pi. I have tried it in mac and windows, both are working fine. In Raspberry Pi 4 with Raspberry Pi OS, the connect method in BLERadio class is getting called and it is waiting forever and not throwing timeout exception. When I removed the multiprocessing, connect method works fine in Raspberry Pi OS. It seems like a library issue. Please suggest.

Jeffreyfrmn commented 8 months ago

@sreerajpunnoli I'm also experiencing this issue... did you find any solutions?