want to know how can i judge that the variation is caused in the connection interval, connection supervision timeout, slave latency once i have flashed ble_app_template code in nrf52832 s132.
want to know how can i judge that the variation is caused in the connection interval, connection supervision timeout, slave latency once i have flashed ble_app_template code in nrf52832 s132.
Hello,
The best way to see exactly how your connection parameter configuration affects the connection would be to use the nRF Sniffer tool to see exactly what is happening on-air.
Alternatively, if you just would like to play around with different connection parameters to see how each of them affects your connection you could take a look at the experimental ATT MTU throughput example from the SDK.
If you would like to visualize different connection parameter configurations you could take a look at the Online Power Profiler, which will let you see the effects of each configuration on the packet exchanges (as well as estimated power consumption).
Best regards,
Karl
Karl i am finding a difficulty in normal understanding the connection interval thing. Actually, by definition of CI i found it is the time btw two consecutive events for which the radio is turned ON. how can i judge this in nrf connect app?
#define SLAVE_LATENCY 0 /**< Slave latency. */
#define CONN_SUP_TIMEOUT MSEC_TO_UNITS(4000, UNIT_10_MS) /**< Connection supervisory time-out (4 seconds). */
from definition i found
Slave latency: If the peripheral does not have any data to send, it can skip connection events, stay asleep, and save power.
Max set to 32 seconds: How to understand this i am not getting? pls tell how can visualize these
Slave latency is the number of times the peripheral might opt to not communicate during a connection event without breaking connection.
Normally, the a peer will terminate the connection if it no longer hears anything from its connected device. Slave latency lets the peripheral device decide whether it has any new data that needs transferring, or if it can skip the upcoming connection event.
Skipping a (or multiple) connection events saves power that otherwise would have gone to powering up the radio and sending an empty packet to the central just to maintain the connection. So, with a slave latency of 5 and a connection interval of 10 ms, the peripheral would only need to send an empty packet once per 50 ms instead of every 10 ms, to maintain the connection, if it has no data to transfer.
Connection supervision timeout is the time that a peer will wait before terminating the link. If you have a Connection supervision timeout of 4 seconds, a device will stay in the connection for 4 seconds after the peer stops replying, to see if the peer comes back. If it does not, the connection is terminated and the device may restart advertising or scanning again.
Best regards,
Karl
Yes Karl i understand these terminologies but i am failing to get that how this can be inferred?
Like when i say set connection supervision timeout as 4secs, does it mean that as i click on connect on nrf connect app after 4 secs then the devices get unconnected? however, nothing like that happened whenn i ran the code and checke don nrf connect app.
Also, say i have nordic blinky code which display led and button two services...in this how slave latency will work i dont get?
Ridhi said:Yes Karl i understand these terminologies but i am failing to get that how this can be inferred?
What do you mean by this - what are you having trouble inferring from the documentation?
Ridhi said:Like when i say set connection supervision timeout as 4secs, does it mean that as i click on connect on nrf connect app after 4 secs then the devices get unconnected? however, nothing like that happened whenn i ran the code and checke don nrf connect app.
No, the supervision timeout only comes into play when a peer stops responding.
If you would like to see how this looks you could set up the sniffer tool by having the sniffer follow into a connection, and then shut off one of the devices in the connection.
The other device will then continue to send packets to try and maintain the connection - in hopes that the peer will return before the supervision timeout occurs. When the supervision timeout occurs the other device will stop sending these packets, and terminate the link in its program.
This means that your program will not resume advertising / unconnected-behavior before the supervision timeout has occurred, in the case that a peer stops responding.
Ridhi said:Also, say i have nordic blinky code which display led and button two services...in this how slave latency will work i dont get?
Sure, this is a good example to demonstrate slave latency. Again, you could see this in practice by using the Sniffer tool to follow into the connection, and monitor the packets being transferred back and forth between the devices with and without slave latency.
In the case with 0 slave latency the BLE blinky devices will transfer a packet to each other each connection event, even though there is no new button state to communicate. This means that every 100 ms the two will exchange empty packets, just to maintain the connection.
If you add slave latency here, the peripheral device may then choose to not turn on its radio when a connection event is upcoming, because it sees that itself has no new information to send compared to the previous connection event. This will save the peripheral power, since it does not need to spend power to send and receive empty packets with the central.
However, in this case, the central will have no way of letting the peripheral know if a button is pressed on the central side, so you will then suddenly see a one-way delay between the central's LED lighting up, and the peripheral - since the peripheral is not turning on its radio to listen for the central's messages.
So, adding slave latency to the BLE Blinky application will actually degrade its performance, since the peripheral will not closely follow the central's led.
In the case that the peripheral was the only one sending data to the central (and the central never sending anything with a time-constraint back), slave latency would be fine to add.
Does this make things more clear?
Best regards,
Karl
when changed the Connection Interval for 3000ms the device doesnot discover?
#define MIN_CONN_INTERVAL MSEC_TO_UNITS(3000, UNIT_1_25_MS)
#define MAX_CONN_INTERVAL MSEC_TO_UNITS(3000, UNIT_1_25_MS)
when changed the Connection Interval for 3000ms the device doesnot discover?
#define MIN_CONN_INTERVAL MSEC_TO_UNITS(3000, UNIT_1_25_MS)
#define MAX_CONN_INTERVAL MSEC_TO_UNITS(3000, UNIT_1_25_MS)
Is this still you, RIDHIMA?
Please elaborate on what you are asking. The more specific you are, the easier it will be for us to help you.
Do you mean to say that the device does not show up when you scan for it, if you change the peripheral's MIN_CONN_INTERVAL and MAX_CONN_INTERVAL values? These values does not matter to the advertisement or discoverability of the device, so I think that something else might have gone wrong then.
Best regards,
Karl
Hello again, RIDHIMA
Ridhi said:but the the device doesnot show any adevrtising?
If you do not see the device advertise after the change you will need to proceed with regular debugging techniques.
- Does your application build and flash without errors or warnings?
- Is there any indication that your program is running as it should, or to the contrary?
- What does your logger output when you attempt to run your program? Are there any LEDS or other peripheral indicating that the program is executed as expected?
- Are you able to open a debug session? Does the programcounter get stuck anywhere in your program, or end up someplace unexpectedly?
If you make sure to add DEBUG in your preprocessor defines, like shown in the included image, the logger will output a detailed error message whenever a non-NRF_SUCCESS error code is passed to an APP_ERROR_CHECK.
Ridhi said:I wanted to set the Connection interval as either 100/1000/2000/4000ms, how cn this be achieved?
Yes, the maximal connection interval length is 4000 ms, anything equal to or lower than that is fine.
Best regards,
Karl
no karl, putting in ble_App_template or ble_blinky code doesnt show up advertsing
#define MIN_CONN_INTERVAL MSEC_TO_UNITS(3000, UNIT_1_25_MS)
#define MAX_CONN_INTERVAL MSEC_TO_UNITS(3000, UNIT_1_25_MS)
Karl Ylvisaker said:If you do not see the device advertise after the change you will need to proceed with regular debugging techniques.
- Does your application build and flash without errors or warnings?
- Is there any indication that your program is running as it should, or to the contrary?
- What does your logger output when you attempt to run your program? Are there any LEDS or other peripheral indicating that the program is executed as expected?
- Are you able to open a debug session? Does the programcounter get stuck anywhere in your program, or end up someplace unexpectedly?
If you make sure to add DEBUG in your preprocessor defines, like shown in the included image, the logger will output a detailed error message whenever a non-NRF_SUCCESS error code is passed to an APP_ERROR_CHECK.
Please answer the questions and perform the steps in my previous comment so we may proceed with the debugging of your issue.
Best regards,
Karl
Does your application build and flash without errors or warnings?
-Yes
Is there any indication that your program is running as it should, or to the contrary?
-I have ran ble_blinky code/ ble_App tempalate which on advertsing ideally blinks with Nordic Blinky / Nordic template name
What does your logger output when you attempt to run your program? Are there any LEDS or other peripheral indicating that the program is executed as expected
-blinky code
Are you able to open a debug session? Does the program counter get stuck anywhere in your program, or end up someplace unexpectedly
-no
in nordic blinky code nrf sdk v17 s132 on dev kit nrf52832 ideally:
#define MIN_CONN_INTERVAL MSEC_TO_UNITS(7.5, UNIT_1_25_MS) /**< Minimum acceptable connection interval (0.5 seconds). */
#define MAX_CONN_INTERVAL MSEC_TO_UNITS(100, UNIT_1_25_MS) /**< Maximum acceptable connection interval (1 second). */
then the code runs and flashes adv name with led blinking.
I am working on ble power optimization. I want to change the connection parameters and check the current consumption.
As suggested by you in above discussion Connection interval had to be set like:
----For 100ms Connection Interval
#define MIN_CONN_INTERVAL MSEC_TO_UNITS(100, UNIT_1_25_MS) /**< Minimum acceptable connection interval (0.5 seconds). */
#define MAX_CONN_INTERVAL MSEC_TO_UNITS(100, UNIT_1_25_MS) /**< Maximum acceptable connection interval (1 second). */
----For 1000 ms Connection Interval
#define MIN_CONN_INTERVAL MSEC_TO_UNITS(1000, UNIT_1_25_MS) /**< Minimum acceptable connection interval (0.5 seconds). */
#define MAX_CONN_INTERVAL MSEC_TO_UNITS(1000, UNIT_1_25_MS) /**< Maximum acceptable connection interval (1 second). */
But the max range of Connection interval from ble specs is 7.5 to 4000ms.
so, when i set
#define MIN_CONN_INTERVAL MSEC_TO_UNITS(2000 or 3000 or 4000, UNIT_1_25_MS) /**< Minimum acceptable connection interval (0.5 seconds). */
#define MAX_CONN_INTERVAL MSEC_TO_UNITS(2000 or 3000 or 4000, UNIT_1_25_MS) /**< Maximum acceptable connection interval (1 second). */
the device doesnt advertise anything??