Comments (11)
How are you running the container? Docker can't access bluetooth on the host by default. I think you might need to pass --net=host
and possibly --privileged
. Anyway this is not an issue directly related to this plugin but how to run bluetooth related stuff through docker so I'll close this.
from homebridge-mi-hygrothermograph.
I run it like this:
docker run -d --restart=always --net=host \ --name=homebridge \ -v /storage/homebridge:/homebridge \ -e HOMEBRIDGE_CONFIG_UI=1 \ -e HOMEBRIDGE_CONFIG_UI_PORT=8581 \ oznu/homebridge:raspberry-pi
Adding --privileged, makes no difference: "noble warning: adapter state unauthorized, please run as root or with sudo"
from homebridge-mi-hygrothermograph.
You might need to add some capabilities to the container. I use CAP_NET_RAW
when running homebridge in systemd to allow access to the bluetooth socket without sudo. You can try to add it with --cap-add=NET_RAW
you might also want to try --cap-add=SYS_ADMIN --cap-add=NET_ADMIN
.
You can probably find a lot more information by googling for "docker bluetooth" or something like that. Good luck!
from homebridge-mi-hygrothermograph.
I've tried to turn off BT on host (systemctl stop bluetooth) - it helped a little bit - now I see this in logs:
[4/16/2019, 8:49:04 PM] Loaded plugin: homebridge-mi-hygrothermograph
[4/16/2019, 8:49:05 PM] [homebridge-config-ui-x] Console v4.0.0-beta16 is listening on port 8581
[4/16/2019, 8:49:06 PM] Registering accessory 'homebridge-mi-hygrothermograph.Hygrotermograph'
[4/16/2019, 8:49:06 PM] ---
[4/16/2019, 8:49:06 PM] Loaded plugin: homebridge-config-ui-x
[4/16/2019, 8:49:06 PM] Registering platform 'homebridge-config-ui-x.config'
[4/16/2019, 8:49:06 PM] ---
[4/16/2019, 8:49:06 PM] Loading 0 platforms...
[4/16/2019, 8:49:06 PM] Loading 1 accessories...
[4/16/2019, 8:49:06 PM] [Temperature & Humidity] Initializing Hygrotermograph accessory...
[4/16/2019, 8:49:06 PM] [Temperature & Humidity] Stop scanning. (poweredOff)
[4/16/2019, 8:49:06 PM] Homebridge is running on port 51826.
from homebridge-mi-hygrothermograph.
Can you try running hciconfig hci0 up
before starting homebridge?
Some discussion regarding bluetooth in docker can be found here moby/moby#16208
from homebridge-mi-hygrothermograph.
@hannseman
When bluetooth is enabled on host (LibreELEC@Raspberry Pi 3 B+) I receive:
[4/13/2019, 8:17:12 PM] [Temperature & Humidity] Stop scanning. (unauthorized)
When I disable bluetooth on host (systemctl stop bluetooth) I receive this:
[4/16/2019, 8:49:06 PM] [Temperature & Humidity] Stop scanning. (poweredOff)
In case I'll run hciconfig hci0
on host it will enable bluetooth and I will get again:
[4/13/2019, 8:17:12 PM] [Temperature & Humidity] Stop scanning. (unauthorized)
With external bluetooth dongle I receive the same error:
Stop scanning. (unauthorized)
Some discussion regarding bluetooth in docker can be found here moby/moby#16208
Unfortunately :( I've tried everything: like docker run -ti --net=host
,docker run -ti --privileged --net=host
etc.
from homebridge-mi-hygrothermograph.
@mrdc Did you install the noble dependencies via sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev
and run sudo setcap cap_net_raw+eip $(eval readlink -f `which node`)
as the suggested by the noble README which is referred to in the log? Of course, both must executed inside the Docker container.
from homebridge-mi-hygrothermograph.
@mrdc Did you install the noble dependencies via
sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev
and runsudo setcap cap_net_raw+eip $(eval readlink -f `which node`)
as the suggested by the noble README which is referred to in the log? Of course, both must executed inside the Docker container.
Yes, I've fixed it with
sudo setcap cap_net_raw+eip $(eval readlink -f
which node
)
from homebridge-mi-hygrothermograph.
I have to run "sudo setcap cap_net_raw+eip $(eval readlink -f which node
)" after every restart to make bluetooth work. Is there a way to do this automatically in the docker-compose?
from homebridge-mi-hygrothermograph.
@plantoschka have you found a way to automate it? To run it after restart?
from homebridge-mi-hygrothermograph.
@plantoschka have you found a way to automate it? To run it after restart?
Unfortunately not.
from homebridge-mi-hygrothermograph.
Related Issues (20)
- 'Current Temperature': characteristic was supplied illegal value: number -21.1 exceeded minimum of -10 HOT 1
- how to install mi-hygrothermograph on the terminal HOT 1
- Homebridge restarting ENODEV error HOT 3
- Error: Error: Unsupported state or unable to authenticate data HOT 2
- ERROR INITIALIZING PLUGIN homebridge-mi-hygrothermograph HOT 2
- error installing plugin
- Fertility, Light, Moisture not shown in Apple Home Kit HOT 3
- Mac adress HOT 1
- shutting down Homebridge ?,Hygrothermograph 2 / LYWSD03MMC HOT 5
- Missing dependency 404 (nonexistent) HOT 18
- Plugin can't read data from LYWSD02MMC
- Plugin won't load after homebridge and node update HOT 3
- issues with cap_net_raw priviliges HOT 2
- No data from LYWSD03MMC HOT 5
- Error log
- Not working after updated to NodeJS 20.x version HOT 7
- LYWSDCGQ01ZM not showing in EVE rooms HOT 6
- Offset-Humidity in Advanced Configuration not working correctly
- Not receiving decimal/float temperature values in influxDB/Grafana
- LYWSDCGQ01ZM error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homebridge-mi-hygrothermograph.