I have been working with BLE devices for IoT solutions. I have a issue with reconnecting the BLE node to my SBC after disconnecting the BLE node.
case: I always have to scan using $sudo hcitool lescan
and then run my bluepy python app to request data over BLE.
At this point of time I can disconnect the BLE node and reconnect it within say 15 seconds. but if I wait any longer, I again have to run lescan cmd and then run my bluepy app to connect and communicate.
I just want to eliminate the scanning part everytime before i run blupy app.
May I know what exactly happens when I execute lescan
cmd after which the bluepy app starts communicating with my ble node?
I presumed that the lescan cmd will switch the dongle to ble mode and tried to keep ble mode as default by setting flags using
sudo hcitool -i hci0 cmd 0x08 0x0008 1e 02 01 16 1a
(changing 1a to 16 as per thread How to set bluez mode?)
All I want is to run the blupy app with the ble device mac ID and start communicating without the need to lescan.
Thanks in advance