Ich wechsel aktuell mein iobroker System von einem OrangePi auf denen neuen Helios64 und dort soll dann auch iobroker nur noch im Docker laufen.
Ich versuche verzweifelt meinen Bluetooth Stick in den Container zu integrieren um ihn mit dem BLE Adapter verwenden zu können.
Laut der Doku vom BLE Adapter soll man ja folgende Packages zusätzlich installieren...
This adapter needs additional libraries to compile. See https://github.com/sandeepmistry/noble#prerequisites for detailed instructions. On Raspberry Pi and similar, this should do it: sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev libcap2-bin
das habe ich in meinem Stack (docker-compose) auch so implementiert...
version: '2'
services:
iobroker:
image: buanet/iobroker:latest
container_name: iobroker
hostname: iobroker
network_mode: bridge
ports:
- "8081:8081"
environment:
- PACKAGES=bluetooth bluez libbluetooth-dev libudev-dev libcap2-bin
volumes:
- /opt/docker/iobroker:/opt/iobroker
restart: unless-stopped
und es wird auch in der Container console als installiert angezeigt...
root@iobroker:/opt/iobroker# apt list | grep bluez
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
bluez/now 5.50-1.2~deb10u1 arm64 [installed,local]
root@iobroker:/opt/iobroker#
nur leider ist die Ausgabe auf hciconfig keine positive...
root@iobroker:/opt/iobroker# hciconfig
Can't open HCI socket.: Address family not supported by protocol
root@iobroker:/opt/iobroker#
auf meinem alten nativen iobroker System (OrangePi) sieht die Ausgabe wie folgt aus...
[root@OrangePi:~]$ hciconfig
hci0: Type: Primary Bus: USB
BD Address: 00:1A:7D:DA:71:13 ACL MTU: 310:10 SCO MTU: 64:8
UP RUNNING
RX bytes:640 acl:0 sco:0 events:41 errors:0
TX bytes:2169 acl:0 sco:0 commands:41 errors:0
[root@OrangePi:~]$
und lsusb gibt mir folgendes dazu...
[root@OrangePi:~]$ lsusb
Bus 008 Device 002: ID 0451:16a8 Texas Instruments, Inc.
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 009 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
[root@OrangePi:~]$
wie kann ich denn den Bluetooth Stick an meinen Container weiter reichen?
Über einen Tipp dazu wäre ich sehr dankbar!
edit:
ok, mit der Option devices konnte ich schon einmal meinen ZigBee Stick einbinden und der zigbee Adapter wird grün...
devices:
- "/dev/ttyACM0:/dev/ttyACM0"
der Stick wird auf ttyACM0 gelinkt...
root@helios64:/opt/docker# ll /dev/serial/by-id
total 0
lrwxrwxrwx 1 root root 13 Oct 16 20:09 usb-Texas_Instruments_CC2538_USB_CDC-if00 -> ../../ttyACM0
root@helios64:/opt/docker#
jetzt fehlt lediglich nur noch der Bluetooth Stick, damit dieser im Container ankommt und der BLE Adapter ihn verwenden kann.
edit2:
und auch für den Bluetooth Stick habe ich eine Lösung, auch wenn sie mir eigentlich nicht so gut bekommt.
Wenn man den network_mode auf host setzt funktioniert es auch mit dem Bluetooth Stick...
version: '2'
services:
iobroker:
image: buanet/iobroker:latest
container_name: iobroker
hostname: iobroker
#network_mode: bridge
#ports:
# - "8081:8081"
network_mode: host
environment:
- AVAHI="true"
- PACKAGES=bluetooth bluez libbluetooth-dev libudev-dev libcap2-bin
volumes:
- /opt/docker/iobroker:/opt/iobroker
devices:
- "/dev/ttyACM0:/dev/ttyACM0"
restart: unless-stopped
auch in der Container console ist es jetzt über hciconfig zu finden...
root@iobroker:/opt/iobroker# hciconfig
hci0: Type: Primary Bus: USB
BD Address: 00:1A:7D:DA:71:13 ACL MTU: 310:10 SCO MTU: 64:8
DOWN
RX bytes:588 acl:0 sco:0 events:31 errors:0
TX bytes:371 acl:0 sco:0 commands:31 errors:0
root@iobroker:/opt/iobroker#
Bluetooth Stick Lösung gefunden hier...
https://github.com/moby/moby/issues/16208