# How do I connect to an rfxtrx from Node-RED in container with Docker Compose?

**URL:** <https://discourse.nodered.org/t/how-do-i-connect-to-an-rfxtrx-from-node-red-in-container-with-docker-compose/82074>\
**Category:** General\
**Tags:** docker\
**Created:** [16 October 2023 08:32 UTC](https://discourse.nodered.org/t/how-do-i-connect-to-an-rfxtrx-from-node-red-in-container-with-docker-compose/82074 "2023-10-16T08:32:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mastiff](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@Mastiff](https://discourse.nodered.org/u/Mastiff)\
**Post date:** [16 October 2023 08:32 UTC](https://discourse.nodered.org/t/how-do-i-connect-to-an-rfxtrx-from-node-red-in-container-with-docker-compose/82074/1 "2023-10-16T08:32:01Z")

</div>

I have searched around and tried several different solutions (instead of working, as I should be...), and I can't get this to work. This is my Docker Compose file:

```auto
version: "3.7"

services:
  node-red:
    user: 1000:1000
    image: nodered/node-red:latest
    restart: unless-stopped
# group_add:
 # - dialout
    environment:
      - TZ=Europe/Oslo
      - LD_LIBRARY_PATH=/opt/vc/lib
    ports:
      - "1880:1880"
    networks:
      - node-red-net
    devices:
      - "/dev/ttyUSB0:/dev/ttyUSB0"
    volumes:
      - /home/pi/Node-RED:/data
      - /home/pi/Sikkerhetskopier:/home/pi/Sikkerhetskopier
networks:
  node-red-net:

```

I'm using my own user, and I am in the dialout group. But I still can't connect to the rfxtrx. I know it's on the right port. I think the problem is that dialout isn't added correctly, and when I try to run with the now commented out group add, I get an error message:

> ./entrypoint.sh: line 14: 8 Segmentation fault (core dumped) /usr/local/bin/node $NODE\_OPTIONS node\_modules/node-red/red.js --userDir /data $FLOWS "${@}"

Does anybody know what I should do to get it working? It's the final important thing that's not working before I can go all Docker on all my home automation stuff.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [16 October 2023 17:06 UTC](https://discourse.nodered.org/t/how-do-i-connect-to-an-rfxtrx-from-node-red-in-container-with-docker-compose/82074/2 "2023-10-16T17:06:40Z")

</div>

Have you tried changing permissions on the OS port to make it available to everyone? Don't recommend leaving it that way but it would confirm or eliminate the group membership as the issue.

---

<div class="post-metadata">

**Author:** ![Mastiff](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@Mastiff](https://discourse.nodered.org/u/Mastiff)\
**Post date:** [16 October 2023 17:21 UTC](https://discourse.nodered.org/t/how-do-i-connect-to-an-rfxtrx-from-node-red-in-container-with-docker-compose/82074/3 "2023-10-16T17:21:48Z")

</div>

@TotallyInformation Thanks for answering! I used `sudo chmod 777 /dev/ttyUSB0` And that actually made the same error surface, this time without adding the container to the group. It actually looks like it's when the Node-RED container can access the RFXtrx that error comes! Confuses me more and more...

Edit: I don't know if the full startup helps? And I have tested a few times, and it really does happen when the USB port is available.

> nodered | 16 Oct 19:50:01 - [info] Node-RED version: v3.1.0  
> nodered | 16 Oct 19:50:01 - [info] Node.js version: v16.20.2  
> nodered | 16 Oct 19:50:01 - [info] Linux 6.1.21-v7l+ arm LE  
> nodered | 16 Oct 19:50:03 - [info] Loading palette nodes  
> nodered | 16 Oct 19:50:07 - [warn] rpi-gpio : Raspberry Pi specific node set inactive  
> nodered | 16 Oct 19:50:08 - [warn] ------------------------------------------------------  
> nodered | 16 Oct 19:50:08 - [warn] [node-red-node-rbe/rbe] 'rbe' already registered by module node-red  
> nodered | 16 Oct 19:50:08 - [warn] ------------------------------------------------------  
> nodered | 16 Oct 19:50:08 - [info] Settings file : /data/settings.js  
> nodered | 16 Oct 19:50:08 - [info] Context store : 'default' [module=memory]  
> nodered | 16 Oct 19:50:08 - [info] User directory : /data  
> nodered | 16 Oct 19:50:08 - [warn] Projects disabled : editorTheme.projects.enabled=false  
> nodered | 16 Oct 19:50:08 - [info] Flows file : /data/flows.json  
> nodered | 16 Oct 19:50:08 - [info] Server now running at [http://127.0.0.1:1880/](http://127.0.0.1:1880/)  
> nodered | 16 Oct 19:50:08 - [warn] Using unencrypted credentials  
> nodered | 16 Oct 19:50:08 - [info] Starting flows  
> nodered | ./entrypoint.sh: line 14: 7 Segmentation fault (core dumped) /usr/local/bin/node $NODE\_OPTIONS node\_modules/node-red/red.js --userDir /data $FLOWS "${@}"  
> nodered exited with code 0

---

<div class="post-metadata">

**Author:** ![Mastiff](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@Mastiff](https://discourse.nodered.org/u/Mastiff)\
**Post date:** [16 October 2023 18:31 UTC](https://discourse.nodered.org/t/how-do-i-connect-to-an-rfxtrx-from-node-red-in-container-with-docker-compose/82074/4 "2023-10-16T18:31:20Z")

</div>

I deleted the setup, copied in only the flows in and installed the nodes from scratch. And now it works! The problem is that I have another error now:

`(node:7) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 temphumbaro1 listeners added to [RfxCom]. Use emitter.setMaxListeners() to increase limit`

And a bit more searching shows that it's just because I have a lot of inputs for the RFXtrx, so nothing to worry about. Seems like I'm up and running!

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [16 October 2023 21:37 UTC](https://discourse.nodered.org/t/how-do-i-connect-to-an-rfxtrx-from-node-red-in-container-with-docker-compose/82074/5 "2023-10-16T21:37:58Z")

</div>

Yes, that is just a warning. I seem to remember there's a way to get rid of it but I no longer remember how sorry. I use an RFXtrx433e by the way.

Glad you sorted it. A reinstall was my next advice on the assumption that you had something corrupted.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [30 October 2023 21:38 UTC](https://discourse.nodered.org/t/how-do-i-connect-to-an-rfxtrx-from-node-red-in-container-with-docker-compose/82074/6 "2023-10-30T21:38:58Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
