I try to connect my Arduino on MacOS to a node-red docker container using serial port, but it doesn't work. Someone has a solution for this ? I use this docker-compose file:
networks:
node-red:
services:
nodered:
image: nodered/node-red
ports:
- "1880:1880"
volumes:
- ./data:/data
- ./public:/home/nol/node-red-static
links:
- mongodb:mongodb
networks:
- node-red
user: root
devices:
- "/dev/cu.usbmodem101"
group_add:
- dialout
CodePudding user response:
This is most likely because docker actually runs in a virtual machine on MacOS so you will need to map the serial port into the virtual machine first so it can then be mounted into the container.
The following gist may help: https://gist.github.com/stonehippo/e33750f185806924f1254349ea1a4e68
It explains how to map the serial port into the VM as a virtual USB serial port when using a version of Docker that uses VirtualBox.
If you are on a new M1 Mac then it may not be currently be possible: