Gateway Addon for Hass.io
-
oops, sorry, I've fixed that locally after I pushed the code to git. I see just now I'm not exposing the 5003 port... :|
I'll add the RUN command.
I mean, mysgw hangs on activating the transport.
@hautomate said in Gateway Addon for Hass.io:
@ghiglie I presume you've seen this. Tried them all?
Privilege for access to hardware/system. Available access: NET_ADMIN, SYS_ADMIN, SYS_RAWIO, SYS_TIME, SYS_NICE
Yes, tried all, even with gpio set to true.
-
Add...
"host_network": true,
and for port 5003, what about this?
"ports": {
"5003/tcp": 5003
},Or put the port as an option so it could be configured by the user. I'm not sure what else would be needed for this to work.
"options": {
"port": 5003, -
Add...
"host_network": true,
and for port 5003, what about this?
"ports": {
"5003/tcp": 5003
},Or put the port as an option so it could be configured by the user. I'm not sure what else would be needed for this to work.
"options": {
"port": 5003,@hautomate said in Gateway Addon for Hass.io:
Add...
"host_network": true,
and for port 5003, what about this?
"ports": {
"5003/tcp": 5003
},Or put the port as an option so it could be configured by the user. I'm not sure what else would be needed for this to work.
"options": {
"port": 5003,I've added it locally, since it's primaly a MQTT image.
I'm stopping here now:
mysgw: Starting gateway...
mysgw: Protocol version - 2.2.0-rc.2
mysgw: MCO:BGN:INIT GW,CP=RNNGL---,VER=2.2.0-rc.2
mysgw: TSF:LRT:OK
mysgw: TSM:INIT
mysgw: TSF:WUR:MS=0so it's not starting the transport.
Any idea on what I shoudl enable? -
@hautomate said in Gateway Addon for Hass.io:
Add...
"host_network": true,
and for port 5003, what about this?
"ports": {
"5003/tcp": 5003
},Or put the port as an option so it could be configured by the user. I'm not sure what else would be needed for this to work.
"options": {
"port": 5003,I've added it locally, since it's primaly a MQTT image.
I'm stopping here now:
mysgw: Starting gateway...
mysgw: Protocol version - 2.2.0-rc.2
mysgw: MCO:BGN:INIT GW,CP=RNNGL---,VER=2.2.0-rc.2
mysgw: TSF:LRT:OK
mysgw: TSM:INIT
mysgw: TSF:WUR:MS=0so it's not starting the transport.
Any idea on what I shoudl enable? -
@ghiglie hmm, not sure. Would you please update your repo with the latest and I'll try a reinstall and have a closer look?
@hautomate said in Gateway Addon for Hass.io:
@ghiglie hmm, not sure. Would you please update your repo with the latest and I'll try a reinstall and have a closer look?
sorry, I'm out for work :( I'll do ASAP tomorrow!
EDIT: Updated!
-
@hautomate said in Gateway Addon for Hass.io:
@ghiglie hmm, not sure. Would you please update your repo with the latest and I'll try a reinstall and have a closer look?
sorry, I'm out for work :( I'll do ASAP tomorrow!
EDIT: Updated!
-
Will be watching with interest. I'd like to move to hass.io but this is the one thing stopping me.
-
@hautomate said in Gateway Addon for Hass.io:
@ghiglie It shows the last commit as 14 days ago...
git-noob mistake! updated!
-
@hautomate said in Gateway Addon for Hass.io:
@ghiglie It shows the last commit as 14 days ago...
git-noob mistake! updated!
-
I'm also trying to make a hassio addon for the mysensors gateway which is connected on the same raspberry pi 2.
If I run the docker image with --privileged then it runs correctly: it manages to read from the nrf2401, it connects to the MQTT server and publishes incoming messages.
However, if I run the container without --privileged (like hassio does), the mysgw program does not output anything else after:
: Starting gateway... : Protocol version - 2.2.0 : MCO:BGN:INIT GW,CP=RNNGL---,VER=2.2.0 : TSF:LRT:OK : TSM:INIT : TSF:WUR:MS=0I'm running the container like this:
docker run -it --rm --cap-add SYS_RAWIO --device /dev/mem --device /dev/gpiomem local/mysgwIf I run a strace on the mysgw binary, I see:
bash-4.4# strace mysgw -d 2>&1 | grep open open("/sys/class/gpio", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3 open("/sys/class/gpio/gpiochip0/base", O_RDONLY|O_LARGEFILE) = 4 open("/sys/class/gpio/gpiochip0/ngpio", O_RDONLY|O_LARGEFILE) = 4 open("/sys/class/gpio/gpiochip100/base", O_RDONLY|O_LARGEFILE) = 4 open("/sys/class/gpio/gpiochip100/ngpio", O_RDONLY|O_LARGEFILE) = 4 open("/etc/mysensors.dat", O_RDONLY|O_LARGEFILE) = 3 open("/dev/urandom", O_RDONLY|O_LARGEFILE) = 3 open("/dev/console", O_WRONLY|O_NOCTTY|O_LARGEFILE|O_CLOEXEC) = 5 open("/dev/console", O_WRONLY|O_NOCTTY|O_LARGEFILE|O_CLOEXEC) = 5 open("/dev/console", O_WRONLY|O_NOCTTY|O_LARGEFILE|O_CLOEXEC) = 5 open("/etc/mysensors.dat", O_RDONLY|O_LARGEFILE) = 5 open("/dev/console", O_WRONLY|O_NOCTTY|O_LARGEFILE|O_CLOEXEC) = 5 open("/dev/console", O_WRONLY|O_NOCTTY|O_LARGEFILE|O_CLOEXEC) = 5 open("/dev/console", O_WRONLY|O_NOCTTY|O_LARGEFILE|O_CLOEXEC) = 5 open("/proc/cpuinfo", O_RDONLY|O_LARGEFILE) = 5 open("/proc/device-tree/soc/ranges", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/dev/mem", O_RDWR|O_SYNC|O_LARGEFILE) = 5It looks like it can't open a device which is also described in https://www.mysensors.org/apidocs/group__BCM2835grp.html
It seems to be a symlink to some device in /sys, but this directory is empty somehow.
bash-4.4# ls -al /proc/device-tree lrwxrwxrwx 1 root root 29 May 7 15:10 /proc/device-tree -> /sys/firmware/devicetree/base bash-4.4# ls -al /sys/firmware total 0 drwxrwxrwt 2 root root 40 May 7 15:34 . dr-xr-xr-x 12 root root 0 May 7 15:34 ..That's how far I got. Does anyone know how to make this device available within the container without having to use --privileged?
-
I'm also trying to make a hassio addon for the mysensors gateway which is connected on the same raspberry pi 2.
If I run the docker image with --privileged then it runs correctly: it manages to read from the nrf2401, it connects to the MQTT server and publishes incoming messages.
However, if I run the container without --privileged (like hassio does), the mysgw program does not output anything else after:
: Starting gateway... : Protocol version - 2.2.0 : MCO:BGN:INIT GW,CP=RNNGL---,VER=2.2.0 : TSF:LRT:OK : TSM:INIT : TSF:WUR:MS=0I'm running the container like this:
docker run -it --rm --cap-add SYS_RAWIO --device /dev/mem --device /dev/gpiomem local/mysgwIf I run a strace on the mysgw binary, I see:
bash-4.4# strace mysgw -d 2>&1 | grep open open("/sys/class/gpio", O_RDONLY|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3 open("/sys/class/gpio/gpiochip0/base", O_RDONLY|O_LARGEFILE) = 4 open("/sys/class/gpio/gpiochip0/ngpio", O_RDONLY|O_LARGEFILE) = 4 open("/sys/class/gpio/gpiochip100/base", O_RDONLY|O_LARGEFILE) = 4 open("/sys/class/gpio/gpiochip100/ngpio", O_RDONLY|O_LARGEFILE) = 4 open("/etc/mysensors.dat", O_RDONLY|O_LARGEFILE) = 3 open("/dev/urandom", O_RDONLY|O_LARGEFILE) = 3 open("/dev/console", O_WRONLY|O_NOCTTY|O_LARGEFILE|O_CLOEXEC) = 5 open("/dev/console", O_WRONLY|O_NOCTTY|O_LARGEFILE|O_CLOEXEC) = 5 open("/dev/console", O_WRONLY|O_NOCTTY|O_LARGEFILE|O_CLOEXEC) = 5 open("/etc/mysensors.dat", O_RDONLY|O_LARGEFILE) = 5 open("/dev/console", O_WRONLY|O_NOCTTY|O_LARGEFILE|O_CLOEXEC) = 5 open("/dev/console", O_WRONLY|O_NOCTTY|O_LARGEFILE|O_CLOEXEC) = 5 open("/dev/console", O_WRONLY|O_NOCTTY|O_LARGEFILE|O_CLOEXEC) = 5 open("/proc/cpuinfo", O_RDONLY|O_LARGEFILE) = 5 open("/proc/device-tree/soc/ranges", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) open("/dev/mem", O_RDWR|O_SYNC|O_LARGEFILE) = 5It looks like it can't open a device which is also described in https://www.mysensors.org/apidocs/group__BCM2835grp.html
It seems to be a symlink to some device in /sys, but this directory is empty somehow.
bash-4.4# ls -al /proc/device-tree lrwxrwxrwx 1 root root 29 May 7 15:10 /proc/device-tree -> /sys/firmware/devicetree/base bash-4.4# ls -al /sys/firmware total 0 drwxrwxrwt 2 root root 40 May 7 15:34 . dr-xr-xr-x 12 root root 0 May 7 15:34 ..That's how far I got. Does anyone know how to make this device available within the container without having to use --privileged?
Hi @kwek, sorry for taking so much to reply. We've been taking the same path!
@kwek said in Gateway Addon for Hass.io:
I'm also trying to make a hassio addon for the mysensors gateway which is connected on the same raspberry pi 2.
If I run the docker image with --privileged then it runs correctly: it manages to read from the nrf2401, it connects to the MQTT server and publishes incoming messages.
However, if I run the container without --privileged (like hassio does), the mysgw program does not output anything else after:
Same here. I've been trying some time ago, if I get to start the container in privileged mode it runs without any problems!
So, I've been looking to how enable the GPIO on the board to the container, using the ResinOS guide: https://docs.resin.io/learn/develop/hardware/gpio/
...but I got nothing of use. You see anyway that the GPIO definitions are under the /sys/class/gpio/ device tree...
I hope to have some more spare time to test this.
-
Hi @kwek, sorry for taking so much to reply. We've been taking the same path!
@kwek said in Gateway Addon for Hass.io:
I'm also trying to make a hassio addon for the mysensors gateway which is connected on the same raspberry pi 2.
If I run the docker image with --privileged then it runs correctly: it manages to read from the nrf2401, it connects to the MQTT server and publishes incoming messages.
However, if I run the container without --privileged (like hassio does), the mysgw program does not output anything else after:
Same here. I've been trying some time ago, if I get to start the container in privileged mode it runs without any problems!
So, I've been looking to how enable the GPIO on the board to the container, using the ResinOS guide: https://docs.resin.io/learn/develop/hardware/gpio/
...but I got nothing of use. You see anyway that the GPIO definitions are under the /sys/class/gpio/ device tree...
I hope to have some more spare time to test this.
@ghiglie Here's an add-on that uses a pi gpio pin. Maybe it will help.
https://github.com/pantomax/hassio-addons/tree/master/rpi-rf-receiver
It's discussed in this thread:
https://community.home-assistant.io/t/rpi-rf-receiver-addon/32947 -
@ghiglie Here's an add-on that uses a pi gpio pin. Maybe it will help.
https://github.com/pantomax/hassio-addons/tree/master/rpi-rf-receiver
It's discussed in this thread:
https://community.home-assistant.io/t/rpi-rf-receiver-addon/32947@hautomate Thanks! I didn't notice it at all.
EDIT: A quick look:
@pantomax in config.json "only" has:"devices": ["/dev/mem:/dev/mem:rw"], "privileged": ["SYS_RAWIO"], "gpio": "true",...while I put an overpowered:
"devices": [ "/dev/mem:/dev/mem:rw" ], "privileged": [ "SYS_RAWIO", "SYS_ADMIN", "NET_ADMIN" ], "gpio": "true",so... it should work :(
-
Did you get this up and running?