ise*_*xxx 5 ubuntu bluetooth bluetooth-lowenergy bluez docker
我在 Windows/MacOS 上的 Docker 中有一个 Ubuntu 容器。
\n我想用来bluez与容器中的 BLE 外设进行通信。
service bluetooth start、bluetoothd、 以及hciconfig全部无法扫描通信。
请告诉我是否有任何方法可以做到这一点或了解如何做到这一点。
\n环境:
\nWindows 10 Home -> Docker v20.10.14 -> Ubuntu 22.04 LTS (Jammy Jellyfish)\nMacOS Monterey 12.3.1 -> Docker v20.10.12 -> Ubuntu 22.04.4 LTS\nRun Code Online (Sandbox Code Playgroud)\n我在 Windows/MacOS 上做了什么:
\n# docker run --name <container> --net=host --privileged -it ubuntu /bin/bash\nRun Code Online (Sandbox Code Playgroud)\n我在容器方面做了什么:
\n# apt-get update \n# apt-get upgrade -y\n# apt-get install -y dbus bluetooth bluez bluez-firmware\n# service dbus start \nRun Code Online (Sandbox Code Playgroud)\n故障一:bluetooth启动后未激活
# service bluetooth start\n * Starting bluetooth\n# service bluetooth status\n * bluetooth is not running\nRun Code Online (Sandbox Code Playgroud)\n故障二:bluetoothd无法访问接口
# bluetoothd -dn\nbluetoothd[2292]: Bluetooth daemon 5.64\nbluetoothd[2292]: src/main.c:parse_config() parsing /etc/bluetooth/main.conf\nbluetoothd[2292]: src/main.c:parse_config() Key file does not have key \xe2\x80\x9cDiscoverableTimeout\xe2\x80\x9d in group \xe2\x80\x9cGeneral\xe2\x80\x9d\nbluetoothd[2292]: src/main.c:parse_config() Key file does not have key \xe2\x80\x9cAlwaysPairable\xe2\x80\x9d in group \xe2\x80\x9cGeneral\xe2\x80\x9d\nbluetoothd[2292]: src/main.c:parse_config() Key file does not have key \xe2\x80\x9cPairableTimeout\xe2\x80\x9d in group \xe2\x80\x9cGeneral\xe2\x80\x9d\nbluetoothd[2292]: src/main.c:parse_config() Key file does not have key \xe2\x80\x9cPrivacy\xe2\x80\x9d in group \xe2\x80\x9cGeneral\xe2\x80\x9d\nbluetoothd[2292]: src/main.c:parse_config() Key file does not have key \xe2\x80\x9cJustWorksRepairing\xe2\x80\x9d in group \xe2\x80\x9cGeneral\xe2\x80\x9d\nbluetoothd[2292]: src/main.c:parse_config() Key file does not have key \xe2\x80\x9cTemporaryTimeout\xe2\x80\x9d in group \xe2\x80\x9cGeneral\xe2\x80\x9d\nbluetoothd[2292]: src/main.c:parse_config() Key file does not have key \xe2\x80\x9cName\xe2\x80\x9d in group \xe2\x80\x9cGeneral\xe2\x80\x9d\nbluetoothd[2292]: src/main.c:parse_config() Key file does not have key \xe2\x80\x9cClass\xe2\x80\x9d in group \xe2\x80\x9cGeneral\xe2\x80\x9d\nbluetoothd[2292]: src/main.c:parse_config() Key file does not have key \xe2\x80\x9cDeviceID\xe2\x80\x9d in group \xe2\x80\x9cGeneral\xe2\x80\x9d\nbluetoothd[2292]: src/main.c:parse_config() Key file does not have key \xe2\x80\x9cReverseServiceDiscovery\xe2\x80\x9d in group \xe2\x80\x9cGeneral\xe2\x80\x9d\nbluetoothd[2292]: src/main.c:parse_config() Key file does not have key \xe2\x80\x9cRemoteNameRequestRetryDelay\xe2\x80\x9d in group \xe2\x80\x9cGeneral\xe2\x80\x9d\nbluetoothd[2292]: src/main.c:parse_config() Key file does not have group \xe2\x80\x9cGATT\xe2\x80\x9d\n\xef\xbc\x88...\xef\xbc\x89\nbluetoothd[2292]: src/main.c:parse_mode_config() Key file does not have group \xe2\x80\x9cLE\xe2\x80\x9d\nbluetoothd[2292]: src/adapter.c:adapter_init() Failed to access management interface\nbluetoothd[2292]: src/main.c:main() Adapter handling initialization failed\nRun Code Online (Sandbox Code Playgroud)\n故障3:hciconfig无法打开socket
root@docker-desktop:/# hciconfig\nCan\'t open HCI socket.: Address family not supported by protocol\nroot@docker-desktop:/# hcitool scan\nDevice is not available: Address family not supported by protocol\nroot@docker-desktop:/# hcitool dev\nDevices:\nRun Code Online (Sandbox Code Playgroud)\n故障4:无法添加btusb模块
# lsmod\nModule Size Used by\n# modprobe btusb\n\xef\xbc\x88Windows\xef\xbc\x89\nmodprobe: FATAL: Module btusb not found in directory /lib/modules/5.10.16.3-microsoft-standard-WSL2\n\xef\xbc\x88MacOS\xef\xbc\x89\nmodprobe: FATAL: Module btusb not found in directory /lib/modules/5.10.76-linuxkit\nRun Code Online (Sandbox Code Playgroud)\n参考网址:
\nbluez-firmware,但仍然相同btusb结果lsmod,所以我猜情况有所不同/sys/class/bluetooth不存在btusb模块| 归档时间: |
|
| 查看次数: |
2242 次 |
| 最近记录: |