noble / bleno

A Node.js module for implementing BLE (Bluetooth Low Energy) peripherals
MIT License
2.13k stars 451 forks source link

reconnect after hci0 down takes too long #391

Open mathiasroehrig opened 6 years ago

mathiasroehrig commented 6 years ago

At the moment iam using bleno and have a problem. My Problem is: Currently I am starting ble with "hciconfig hci0 up" and I am closing it with "hciconfig hci0 down". But when I am trying to reconnect the smartphone to a raspberry-pi the reconnect takes too long cause the BLE is restarting and needs to long time to connect to the device. (about 12seconds) Is there a better way to do this? I am using a loop where at the beginning a function should start the advertising and at the end of the loop the advertising should be stopped. This loop is an endless loop.

don commented 6 years ago

Taking too long to connect sounds like a phone issue rather than a bleno issue. Why you're starting and stopping Bluetooth in a loop? Can you just keep BLE running an the peripheral advertising? If you think this is a bleno issue, create a very simple project to reproduce this.