This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

get the min connection interval with 8 sensors

Hello community,

I did a central device which is connecting with 8 slaves and this slaves are sending every time 8 bytes when they are connected. My set up is the following:

#define MIN_CONNECTION_INTERVAL	MSEC_TO_UNITS(10, UNIT_1_25_MS)	 
#define MAX_CONNECTION_INTERVAL	MSEC_TO_UNITS(16, UNIT_1_25_MS)	
#define SLAVE_LATENCY			0							
#define SUPERVISION_TIMEOUT		MSEC_TO_UNITS(200, UNIT_10_MS)	

But with a timestamp I am getting a connection with each sensor of 30 ms, Also I read on the specification of Nordicm the minimum interval is 20 ms with 8 slaves. How can I do that?

my ble is a NRF 52832 with a SDK 13 version 4.1. and s132

Thanks in advance

  • slaves are sending every time 8 bytes when they are connected

    I don't understand. Every time? How often are you sending 8 bytes?

    What is the actual connection interval you are using? See this.

  • Hello Petter, the central is connecting to 8 peripheral (Motions sensors), these sensors are sending in every package 8 bytes in a connection interval of 30 ms (Accoring to the timestamp).

    My connection interval set up is the following:

    #define MIN_CONNECTION_INTERVAL MSEC_TO_UNITS(10, UNIT_1_25_MS)  
    #define MAX_CONNECTION_INTERVAL MSEC_TO_UNITS(16, UNIT_1_25_MS) 
    #define SLAVE_LATENCY           0                           
    #define SUPERVISION_TIMEOUT     MSEC_TO_UNITS(200, UNIT_10_MS)
    

    Using the link that you send me, i am checking which range is my connection time , for MAX = 15 ms and MIN = 15ms.

    But when I checking my data, the interval is not 15 ms but rather 30 ms.

    I dont know why is changing my interval.

  • I'm not sure why you get 15 ms, but try to set MIN_CONNECTION_INTERVAL = MAX_CONNECTION_INTERVAL = MSEC_TO_UNITS(16, UNIT_1_25_MS) Then you should get a connection interval of 20 ms, and then you should check the the peripheral isn't requesting to change it. If you are not getting a BLE_GAP_EVT_CONN_PARAM_UPDATE event, you are good.

    What do you mean by "these sensors are sending in every package 8 bytes in a connection interval of 30 ms"? The connection interval is independent of how often you send data. Are you using a timer to send one package every 30 ms? How are you sending the data? Notifications? How are you timestamping?

    Does it work with only one connection? I would try to get one working first, before scaling to 8.

  • I changed my range of connection interval to 16 but im still having 15 ms. The peripherals (sensors) are sending their data through Notifications, my timestamp is done by a C# program on Raspberry Pi. When the NRF52832 receives a notfications, it sends it back to the RBP via SPI and when the RBP got it make a timestamp, the difference between one timestamp and the other should be approx the interval connection.

    The peripheral are not trying to do an update to the connection parameters, they have on their system min 40 and max 60 ms.

  • That doesn't make sense. Where did you change it? In the central code? Which connection params are you giving to sd_ble_gap_connect()?

    That will not be approx connection interval, it will be the interval between received notifications, it is not always the same.

Related