When balenaOS is updated to balenaOS 2.43.0 + rev1, Bluetooth communication using LinkKey is not possible.
I was running a python program with systemd service, and used pyserial to communicate with it.
And the following command was executed in the container, but communication is not possible.
root@HOSTNAME :/home/pi# hciconfig hci0 sspmode 0
root@HOSTNAME :/home/pi# hciconfig hci0 auth
root@HOSTNAME :/home/pi# hciconfig hci0 encrypt
root@HOSTNAME :/home/pi# rfcomm bind 0 XX:XX:XX:XX:XX:11
DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket bluetoothctl
[NEW] Controller XX:XX:XX:XX:XX:00 HOSTNAME [default]
[bluetooth]# agent KeyboardOnly
Agent registered
[NEW] Device XX:XX:XX:XX:XX:11 BT_Device
[DEL] Device XX:XX:XX:XX:XX:11 BT_Device
[bluetooth]# default-agent
Default agent request successful
[NEW] Device XX:XX:XX:XX:XX:11 BT_Device
Request PIN code
[agent] Enter PIN code: hogehoge
[CHG] Device XX:XX:XX:XX:XX:11 Connected: yes
[CHG] Device XX:XX:XX:XX:XX:11 ServicesResolved: yes
[CHG] Device XX:XX:XX:XX:XX:11 Paired: yes
[CHG] Device XX:XX:XX:XX:XX:11 ServicesResolved: no
[CHG] Device XX:XX:XX:XX:XX:11 Connected: no
[CHG] Device XX:XX:XX:XX:XX:11 Connected: yes
[CHG] Device XX:XX:XX:XX:XX:11 Connected: no
[bluetooth]# exit
Agent unregistered
[DEL] Controller XX:XX:XX:XX:XX:00 HOSTNAME [default]
Failed to unregister advertisement method
When you execute the above, LinkKey information is saved in /var/lib/bluetooth/XX:XX:XX:XX:XX:00/XX:XX:XX:XX:XX:11/info
of Host OS.
The bluetoothd log is below.
root@HOSTNAME:/var/lib/bluetooth# journalctl -u bluetooth -xfe
Date HOSTNAME bluetoothd[167]: Starting SDP server
Date HOSTNAME bluetoothd[167]: binding L2CAP socket: Address already in use
Date HOSTNAME bluetoothd[167]: Server initialization failed
Date HOSTNAME bluetoothd[167]: Bluetooth management interface 1.14 initialized
Date HOSTNAME bluetoothd[167]: Failed to start listening: l2cap_bind: Address already in use (98)
Date HOSTNAME bluetoothd[167]: Failed to create GATT database for adapter
Date HOSTNAME bluetoothd[167]: Unable to register new adapter
I suspect that the container side cannot communicate using the Host OS LinkKey, but I don’t know how to solve it.
Please give me your help.