BLE errors after gateway restart/script redeploy

Hello,

We are having some issues with the Gateway: after restart/redeploy of the gateway we get two times the following message “BLE_ERROR_HW_NOT_FOUND” in the BLEAPP_ERROR_CALLBACK. The first one is 40 seconds after restart, the second one is 67 seconds after restart.

It seems that after this error is fired, the BLE is restarted:

2021-09-18 18:06:03.964 [BV] Error CB: BLE_ERROR_HW_NOT_FOUND
2021-09-18 18:06:03.972 DEVINFO(0): NRF52 - ScannerApp - - 01v007
2021-09-18 18:06:03.975 DEVINFO(0): 00:00:00:00:00

These restarts are causing problems, because if we initiate Connect and the BLE is restarted, we get the following error in hte Connect_Callback:

2021-09-18 18:05:39.755 [NUS] NUS_BleApp_Connect_Callback(handle=0, connhandle=0, connected=-1, addr=C6-B9-08-D9-38-AB).

Please also note that we we are doing BleApp_Disable right after restart/redeploy and then 10 seconds laters, we are doing BleApp_Enable. The reason we do that is because we want to make sure all active connections are dropped, otherwise some devices remain connected, but the gateway script is not aware of that.

Can you please help with the reason for restart.

We would also like to know what does connected=-1 mean.

Thanks,
Borislav

Hello @borkovalkov,

during a restart/redeploy of the script the BLE interface will be reset, so it is not necessary to call BleApp_Disable() right after the script start.
The BleApp_Disable() function will power off the BLE interface and BleApp_Enable() will start the interface again. If you just want to reset connections during the runtime of the script, you could use BleApp_Disconnect() to disconnect from your peripherals.

The return value “-1” in the connected parameter of the BLEAPP_CONNECT_CALLBACK indicates a general error. One possibility for such an error is if you start a connection right after a restart of the BLE interface (BleApp_Disable and BleApp_Enable), without a BleApp_Scan() before the connection attempt.

Kind regards
Microtronics Engineering

Hello,

Thanks you for your reply.

The issue is more related to the fact that after enablign the BLE, it sometimes makes 1 or more additional random restarts, which is causing the problems outlined in my original post.

Best regards,
Borislav