cancel
Showing results for 
Search instead for 
Did you mean: 

BlueNRG2 BLE timeout

JWall.1
Associate II

I am using the BlueNRG2 in an application which is a simple button press to indicate if it is pressed or not. The device needs to connect to Windows 10 and or 11. I am using the SensorDemo project as the base code and made a few changes to just utilize a GPIO for the button which updates a custom characteristic.

Here is the issue. The board is typically in sleep mode until the button is pressed. If the device is not already paired to the Windows machine, it will start advertising. The Windows machine will connect and the board returns to sleep until the next button press. The problem is something is forcing a disconnect after a short period of time in sleep mode. Sometimes its 20 seconds other times it is several minutes. The assumption is when it is in sleep mode, the Windows device is not seeing any activity and is forcing a disconnect. I get a different behavior if I use the device with an Android tablet and another behavior if using an iPad. I know the SensorDemo goes to sleep in between sensor readings and doesnt disconnect from the BLE app and I am using the SensorDemo slightly customized

The question is what settings or code do I need to ensure the device is maintaining its connection to the central device, no matter what device it is during the sleep period. Do I need to wake the device up and send a dummy packet or does the BLE stack take care of this in the background? Is there any special settings for Windows needed?

1 REPLY 1
AndyR1
Senior

Hello,

I also get BLE timeout after few seconds because the internal Ring Oscillator (CONFIG_HW_LS_RO option) is re-calibrated. See CALIBRATION_INTERVAL or CALIBRATION_INTERVAL_CONF defined in Beacon_config.h. I use the BLE stack with BlueNRG-LP and I try to get deepsleep mode but I can only get RUN mode using BLE.