Problem with connecting multiple devices
Currently I'm trying to develop app which will collect multiple sensors data in realtime (streamming mode). Hardware which I'm using:
Boards: MetaMotion R
In my setup multiple hubs are discovering metamotion devices and then they try to connect and setup streaming mode. Hubs are Raspberry Pi 4 (Raspbian without GUI) but we were testing this app on PC (Ubuntu 20.04) and metamotion HUB with the same issues.
For now we encourage those few issues regarding connectivity.
First one is that when we discover a device and then call connectAndSetUp then there is let's say 50% chance that connection will be disconnected immediately. Code that I'm using and logs you could find in attachment (scan_and_connect_to_disco.txt and immediately_disconnect_log.txt).
Second issue is that connection sometimes hangs in the connectAndSetUp function. In that case I've implemented a timeout which you could see in attached code (scan_and_connect_to_disco.txt, lines 35-49). When timeout occurs then I'm calling
disconnect() function on
discovered_device and wait till the callback is called. Unfortunately sometimes the disconnect function also hangs and I'm unable to disconnect from the device at all. It is still connected to HUB as it is not advertising but I'm not able to reset connection in any way, than resetting the app and hci device.
Third issue is related to sensor setup. Sometimes sensors are not sending data in periods like I configure it (and it is not related to poor signal). I use the same setup code for all sensors and in example 3 sensors are sending 100 samples per second and 4th is sending 30 samples per second. There are also situations where the sensor after configuring it is not sending data at all (but in this case it is easy to trace and create some workaround). In attachment you could see my setup function (setup.txt)
Please help me with those issues as they make this product not usable for us.