Container does seems not to work
Closed this issue · 5 comments
As I had no success via PIP I thought, let´s try a container as there are the libs guranteed.
I created the container and faced no issue during building but I can not run it not as user nor as root.
I always get the following error (regardles if root or user):
podman run --rm -ti --privileged --net=host bluetooth_battery_level 88:D0:39:BB:4A:76
[2] Error loading Python lib '/tmp/_MEIx6iKbm/libpython3.9.so.1.0': dlopen: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /tmp/_MEIx6iKbm/libpython3.9.so.1.0)
same here
Hi, sorry for the late response. I've updated the Dockerfile and now it seems to work. Can you give it a try?
It is also on DockerHub! (bluetooth_battery)
It would be great if someone could test and confirm it's working.
Seems to work (the container) however my headset not, but I assume that it not due to the container, as the extension does not work as well (JBL LIVE 650BTNC)... Just Android and Windows is able to show the percentage... that sucks...
podman run --rm -ti --privileged bluetooth_battery:1.3.1 "88:D0:39:BB:4A:76"
Traceback (most recent call last):
File "/app/./bluetooth_battery.py", line 166, in <module>
main()
File "/app/./bluetooth_battery.py", line 162, in main
query = BatteryStateQuerier(*device.split("."))
File "/app/./bluetooth_battery.py", line 81, in __init__
self._bt_settings = bluetooth_mac, int(bluetooth_port or RFCOMMSocket.find_rfcomm_port(bluetooth_mac))
File "/app/./bluetooth_battery.py", line 60, in find_rfcomm_port
raise bluetooth.BluetoothError("Couldn't find the RFCOMM port number. Perhaps the device is offline?")
bluetooth.btcommon.BluetoothError: Couldn't find the RFCOMM port number. Perhaps the device is offline?
Mind trying a couple more times? I got that error on the first try but the next time it worked.
Also try specifying the port number manually with a dot at the end (e.g: 88:D0:39:BB:4A:76.1). Numbers from 1 to 30-ish might work.
If those didn't do the trick then you are probably right. The script doesn't support all devices.