Node-RED integration: Give Docker container access to USB ports

Hello @pierre-gilles
does that correspond to this instruction?
:sudo chown -R 1000:1000 /var/lib/gladysassistant/node-red

If that’s it
I modified the Docker run like this and it works:

sudo docker run -d \
-u node-red:dialout \
  --name gladys-node-red \
  --restart always \
  -p 1881:1880 \
  -v /var/lib/gladysassistant/node-red:/data \
  --log-opt max-size=10m \
--device=/dev/ttyUSB0 \
  nodered/node-red:3.1

But you have to run, afterwards, this command:

sudo chown -R 1000:1000 /var/lib/gladysassistant/node-red

But if you confirm that it’s in the Node-RED integration code it should work.

With this command --device=/dev/ttyUSB0, do we force the RFLink to be connected to USB0? Does that cause a problem?

That’s it :slight_smile:

Yes that causes a problem, it’s always the same issue, we don’t know which port will be used.

That’s why my original PR proposed an approach based on volume sharing:

-v /dev:/dev \\
-v /run/udev:/run/udev:ro \\

With the additional --privileged option to give extra privileges to the container.

But based on your feedback, it doesn’t work.

I managed to do what you asked me, a long time ago :roll_eyes:
Gladys is indeed running as root, but node-red is run by the user node-red.

pi@rasp3b:~ $ docker exec -it gladys-node-red bash
eeb32d757218:~$ whoami
node-red
eeb32d757218:~$ groups
node-red
eeb32d757218:~$ exit


pi@rasp3b:~ $ docker exec -it gladys bash
root@rasp3b:/src/server# whoami
root
root@rasp3b:/src/server# groups
root

So there’s a problem then? If I understood correctly .

I wanted to add node-red to the dialout group in the docker run of the Gladys image, but since the node-red container hasn’t been created yet, it gives me an error

I don’t think that’s related, you’re comparing the users inside the container, that’s not the same thing.

If you look at the Dockerfile of the Node-RED project (Source), you can see that they create a Node-RED user.

Good evening @pierre-gilles
I’m at the limit of my knowledge and if I don’t get some help to point me in the right direction, I won’t be able to do anything more, sorry :thinking:

1 Like

Ah darn, well it’s true that it’s a very technical subject :smiley:

In this thread, who « needed » this development?

Just you @elfedagger?

I see you mention Somfy roller shutters above, I don’t know if you followed, but I’m

1 Like

Good evening, I think that those who use Arduinos, RFLink, RXcom — launching a poll would be interesting!

It’s a shame not to continue looking, because the internal Node-RED in Gladys is still more convenient to install, and if we could also trigger a backup that could be restored like Zigbee, that would be great. For my part I’m still on an external Node-RED, which once launched works very well, and to back up I export the file to Windows’ Downloads folder which I put aside just in case.

1 Like

Hello,

I would really like to be able to manage my Somfy shutters directly in Gladys. I’m afraid that with the assemblies and settings I might lose everything or mess everything up, so I stick with basic control using the remote. It’s problematic when I’m away.

@Jluc what Somfy equipment do you have?
shutter, blind, curtain, Velux?
IO, RTS?
box (which one), remote?
If needed we can start a new topic to talk about this part and avoid polluting this feed.

I also switched back to an external Node-RED, but when there’s a power outage and Gladys stops, on restart the USB ports get swapped and nothing works anymore. No more Zigbee and no more RFLink — it’s a pain to restart everything. As for Matter, I’m waiting to see. With RFLink there is no control of my blinds. My blinds are solar-powered, so there’s no question of adding hardware to them or investing

Hello everyone,
it’s true I had forgotten this problem as well, which is why this tutorial is useful

Thanks for your feedback @elfedagger :slight_smile:

In that case we can look at it together, it’s not very complicated to change, and nothing is tied to that request if that’s all that’s bothering you!

Is there a dedicated thread where we could discuss this?