SINTEF-9012 / bglib

Java implementation of the BGAPI binary protocol for Bluegiga BLE112 Bluetooth low energy modules.
37 stars 14 forks source link

Connection of many sensors #5

Closed ruzovvo closed 6 years ago

ruzovvo commented 11 years ago

Hi. i'm using your api. and i want to connect multiple sensors to 1 bluegiga dongle. but i don't know how to detect(and is it possible) from which sensor data was received. Can you explain me this?

ffleurey commented 11 years ago

Hello!

I do not have a lot of experience working with several sensors on the same dongle. The firmware 1.0.3-43 does not support it so you have to use the 1.1.0-55Beta version. With this version you should be able to connect to up to 4 devices. When a connection with a device is established you get a connection number which is also attached to the sensor data messages. I think that this connection number is the way to distinguish between data comming from different sensors. I hope this helps. Cheers!

ruzovvo commented 11 years ago

Ok. i've upgraded my bluegiga. So now i can connect 3 devices. but when i try to connect the 4th i get the result in receive_gap_connect_direct 521. I suppose it's an exception. is there a way to connect more than 3 devices?

sridharrajagopal commented 9 years ago

Hi,

I'm facing exactly the same issue, and I came across this post while researching the problem. I was able to successfully connect 3 devices, but when I added a 4th device to the mix, only 3 devices would connect, and the 4th attempt resulted in the rsp_gap_connect_direct result of 521.

If anyone else has faced this issue, and/or know the solution, please let us know!

Thanks, Sridhar

sridharrajagopal commented 9 years ago

I found that the factory default setting for the dongle is a max of 3 connections. Also, the error codes are documented in the API guide - 521 = 0x0209 (Connection Limit Exceeded)

You can change the max connections in the config.xml of the configuration, recompile and reflash the dongle. Max connections supported are 8, btw.