BLE not work after a reboot of a device

bluetooth
raspberrypi3

#1

Hello,

After rebooting a device, BLE no longer works.
ResinOS : 2.12.5+rev1 (prod)

If i restart the service, it works.

The test I’m doing is : $hcitool lescan
Result after reboot a device :

Set scan parameters failed: Connection timed out

I initialize the BLE with :

echo “Attaching hci0…”
if ! /usr/bin/hciattach /dev/ttyAMA0 bcm43xx 921600 noflow -; then
echo “First try failed. Let’s try another time.”
/usr/bin/hciattach /dev/ttyAMA0 bcm43xx 921600 noflow -
fi

echo “Bring hci0 up…”
hciconfig hci0 up

Can someone explain to me why Bluetooth doesn’t work when restarting a device ?

Regards,


#6

Hey @HoaMi

After ResinOS version v2.9.3, you no longer have to use hciattach and hciconfig. Instead you can just use the device as if it has already been intiialised. I tested this using the following code: https://github.com/resin-io-projects/rpi3-bluetooth/blob/master/scan.sh and after a reboot, the bluetooth works as normal.


#7

Hey @CameronDiver

I removed hciattach and hciconfig in Dockerfile and it works very well !

Thank you so much for your help.