# USB Passthrough (for Modbus) from Pi 5 to a Docker container

**URL:** <https://discourse.nodered.org/t/usb-passthrough-for-modbus-from-pi-5-to-a-docker-container/89541>\
**Category:** General\
**Tags:** modbus, docker\
**Created:** [16 July 2024 11:11 UTC](https://discourse.nodered.org/t/usb-passthrough-for-modbus-from-pi-5-to-a-docker-container/89541 "2024-07-16T11:11:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![DuncanCT](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/duncanct/32/41639_2.png) [@DuncanCT](https://discourse.nodered.org/u/DuncanCT)\
**Post date:** [16 July 2024 11:11 UTC](https://discourse.nodered.org/t/usb-passthrough-for-modbus-from-pi-5-to-a-docker-container/89541/1 "2024-07-16T11:11:06Z")

</div>

I would like to pass though an USB FTDI RS485 to Node-RED on a RPi 5.

This is my compose file:

```auto
services:
  node-red_dev:
    image: nodered/node-red:4.0.2
    container_name: node-red_dev
    restart: unless-stopped
    privileged: true
    user: node-red
    group_add:
      - dialout
    ports:
      - 1880:1880
    networks:
      - net
    volumes:
      - dev_data:/data
    devices:
      - /dev/ttyUSB0:/dev/ttyUSB0

networks:
  net:

volumes:
  dev_data:

```

This is the output from the console:

```auto
~$ whoami
node-red
~$ id
uid=1000(node-red) gid=1000(node-red) groups=20(dialout),1000(node-red)
~$ ls -l /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Jul 16 12:57 /dev/ttyUSB0
~$ dmesg | grep ttyUSB
[30.610798] usb 3-1: FTDI USB Serial Device converter now attached to ttyUSB0

```

I can see the FTDI device in the console but I can't get the node-red-contrib-modbus node to work in Node-RED.

Not sure if there is a dialout group mismatch.

I am out of my depth and any assistance would be appreciated. TIA.

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [17 July 2024 11:01 UTC](https://discourse.nodered.org/t/usb-passthrough-for-modbus-from-pi-5-to-a-docker-container/89541/3 "2024-07-17T11:01:19Z")

</div>

When you say console, you mean on the host or a shell inside the container?

---

<div class="post-metadata">

**Author:** ![DuncanCT](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/duncanct/32/41639_2.png) [@DuncanCT](https://discourse.nodered.org/u/DuncanCT)\
**Post date:** [18 July 2024 06:09 UTC](https://discourse.nodered.org/t/usb-passthrough-for-modbus-from-pi-5-to-a-docker-container/89541/4 "2024-07-18T06:09:52Z")

</div>

The above is from inside the container. Below is from the host.

```auto
~$ whoami
pi
~$ ls -l /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Jul 17 18:17 /dev/ttyUSB0
~$ id
uid=1000(pi) gid=1000(pi) groups=1000(pi),4(adm),20(dialout),24(cdrom),27(sudo),29(audio),44(video),46(plugdev),60(games),100(users),102(input),105(render),106(netdev),993(gpio),994(i2c),995(spi)

```

---

<div class="post-metadata">

**Author:** ![DuncanCT](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/duncanct/32/41639_2.png) [@DuncanCT](https://discourse.nodered.org/u/DuncanCT)\
**Post date:** [18 July 2024 12:31 UTC](https://discourse.nodered.org/t/usb-passthrough-for-modbus-from-pi-5-to-a-docker-container/89541/5 "2024-07-18T12:31:32Z")

</div>

So by using image tag 4.0.0-debian it works. Assume it something to do with Alpine base?

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [19 July 2024 10:46 UTC](https://discourse.nodered.org/t/usb-passthrough-for-modbus-from-pi-5-to-a-docker-container/89541/6 "2024-07-19T10:46:50Z")

</div>

What host OS are you running on? 32 or 64bit?

---

<div class="post-metadata">

**Author:** ![DuncanCT](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/duncanct/32/41639_2.png) [@DuncanCT](https://discourse.nodered.org/u/DuncanCT)\
**Post date:** [19 July 2024 13:20 UTC](https://discourse.nodered.org/t/usb-passthrough-for-modbus-from-pi-5-to-a-docker-container/89541/7 "2024-07-19T13:20:14Z")

</div>

Raspberry Pi OS Lite 64bit

---

<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:** [17 October 2024 13:20 UTC](https://discourse.nodered.org/t/usb-passthrough-for-modbus-from-pi-5-to-a-docker-container/89541/8 "2024-10-17T13:20:33Z")

</div>

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