Pass a USB device to node-RED docker - permission denied


Struck

Recommended Posts

Hi

 

I am trying to connect an arduino pro micro via usb serial to the node-RED docker container, but i have no luck.

 

I have made a minimalistic arduino code that just outputs a number on the serial. 

When i connect the arduino to the unraid server, i can from the console use the screen command, to see the output on the serial port (/dev/ttyACM0)

 

I have then tried to map this device into the node-red docker by adding a new device into the docker, with the  value field to "/dev/ttyACM0"

 

Wheni then try to run node-RED with the serial port plugin, and try to set the serial port to /dev/ttyACM0 it tells me 

"serial port /dev/ttyACM0 error: Error: Error: Permission denied, cannot open /dev/ttyACM0"

I have also tried with the privileged mode.

Any ideas?

 

As bonus info, I have successfully connected to the serial port with a VM running windows as a test.

Link to comment

You probably need to change the permission on the host side so that the user in the container running the software have the rights to read/write to the device. 

If you want to be sure, do a chmod 777 /dev/ttyACM0 and restart the container. 

Edited by saarg
Link to comment

Ok, i tried to do chmod 777 ttyACM0, and it worked.

But as far as i know, the permission will reset when restarted, right?

How do i make it persistent?

root@Hotbox:/dev# ls -l ttyACM0
crw-rw---- 1 root dialout 166, 0 Feb  1 00:45 ttyACM0
root@Hotbox:/dev# chmod 777 ttyACM0
root@Hotbox:/dev# ls -l ttyACM0
crwxrwxrwx 1 root dialout 166, 0 Feb  1 00:45 ttyACM0

 

Link to comment
10 hours ago, Struck said:

Ok, i tried to do chmod 777 ttyACM0, and it worked.

But as far as i know, the permission will reset when restarted, right?

How do i make it persistent?


root@Hotbox:/dev# ls -l ttyACM0
crw-rw---- 1 root dialout 166, 0 Feb  1 00:45 ttyACM0
root@Hotbox:/dev# chmod 777 ttyACM0
root@Hotbox:/dev# ls -l ttyACM0
crwxrwxrwx 1 root dialout 166, 0 Feb  1 00:45 ttyACM0

 

 

You just add it to your go file in /boot/config/go.

Link to comment
  • 3 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.