I am trying to scan for bluetooth devices in my application using btmgmt. On runing the command inside the container:
btmgmt find |grep rssi |sort -n |uniq -w 10
all I get is:
Unable to open socket
I found this thread where it says that in multicontainer setup, the container using bluetooth must be set to network_mode: host . So I did that, but after updating the application running hcitool dev returns only:
root@5dd2aa0:/usr/src/app hcitool dev
Devices:
btmgmt doesn’t complain any more, but it doesn’t find anything.
Running hcitool dev in the host os also returns the same empty list of devices.
I have the UART enabled in the device configuration (if this is even relevant). The application is running on raspberry pi 3 coupled with the Monarco HAT. As far as I know, rpi 3 supports bluetooth. Do I need enable bluetooth explicitly as is the case for the raspbian image? (where you need to uncomment dtoverlay=pi3-disable-bt in boot/config.txt)
Hi,
UART is enabled via device configuration screen on balena dashboard (Enable / Disable UART option). The strange thing is that on the other device with the same codebase, but with the different base os ( balenaOS 2.53.9+rev1 ) everything works without problems. Current version of balenaOS (where things don’t work) is balenaOS 2.77.0+rev1.
I will try to set the miniuart-bt overlay in the higher version of balena os and report the results, hopefully this solves the issue.
I tried with the miniuart-bt overlay, but unfortunately it still doesn’t work:
root@5dd2aa0:/usr/src/app hcitool dev
Devices:
The same thing happens if I run the command in the Host OS.
Is there some fix for this in the newer versions ob BalenaOS? Most of our devices are on 2.77 version. Otherwise the only solution I see right now is for us to downgrade the entire fleet.
sorry for the late reply.
All I need to do is scan the MAC of the nearby BLE devices and show their rssi (inside the container). I don’t need to connect to any of them.
I tried runing btmgmt --index hci0 find:
root@5dd2aa0:/usr/src/app btmgmt --index hci0 find
Unable to start discovery. status 0x11 (Invalid Index)
Hi Vid, I have pinged some our OS folks to have a look, to ensure we haven’t accidentally introduced a bug somewhere along the way. It might be next week before they see the ping however, just FYI.