# Serial port authorization problem in beaglebone black board

**URL:** <https://discourse.nodered.org/t/serial-port-authorization-problem-in-beaglebone-black-board/40857>\
**Category:** Hardware\
**Created:** [12 February 2021 09:22 UTC](https://discourse.nodered.org/t/serial-port-authorization-problem-in-beaglebone-black-board/40857 "2021-02-12T09:22:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lpj669](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lpj669/32/68589_2.png) [@lpj669](https://discourse.nodered.org/u/lpj669)\
**Post date:** [12 February 2021 09:22 UTC](https://discourse.nodered.org/t/serial-port-authorization-problem-in-beaglebone-black-board/40857/1 "2021-02-12T09:22:16Z")

</div>

Hi,I have a I have a beaglebone black board and I want to control one serialport, there have 6 serialports(/dev/ttyS0-/ dev/ttyS5). The node-RED flow is simple as follows:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/7/c753ec93bafca031252b7bafb33705e59f182d70.png)  
But after deployment, there has an error message:” Permission denied, cannot open /dev/ttyS2". i run this

```auto
chmod a+rw /dev/ttyS2

```

so serialport can be connected because There is a small green dot below the”serial out” icon.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/a/4a21ceb7126ba98b34076b9e997f1ecde75a816b.png)  
But after reboot, it can not be opened and I need to use “chmod a+rw /dev/ttyS2” again. I know serialport should be authorized before using.I want to serialports could be connected automatically after the BBB is powered on. should I login Node-red as root mode or edit the settings.js ? I am a new user of beaglebone black board and Node-RED. How to do? I hope someone can help me solve this problem, Here I express my gratitude in advance to those who can help me.

---

<div class="post-metadata">

**Author:** ![leftymuller](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/leftymuller/32/102326_2.png) [@leftymuller](https://discourse.nodered.org/u/leftymuller)\
**Post date:** [12 February 2021 09:40 UTC](https://discourse.nodered.org/t/serial-port-authorization-problem-in-beaglebone-black-board/40857/2 "2021-02-12T09:40:20Z")

</div>

Hi!  
You need to add the user that node-red is running as to the group that has access to the serial port.

you can do that with the command

sudo usermod -a -G tty pi

It may not be the group tty on your linux.. you need to check that obviously

---

<div class="post-metadata">

**Author:** ![lpj669](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lpj669/32/68589_2.png) [@lpj669](https://discourse.nodered.org/u/lpj669)\
**Post date:** [12 February 2021 11:20 UTC](https://discourse.nodered.org/t/serial-port-authorization-problem-in-beaglebone-black-board/40857/3 "2021-02-12T11:20:27Z")

</div>

Hardware is beaglebone instead of Pi. So,I think the command "sudo usermod -a -G tty pi" is invalid. The Node-red service is automatically started after power on, so I am not sure about the login user of Node-red. I use this command and got some informations:

```auto
debian@beaglebone:~$ ls -l /dev/ttyS*
crw------- 1 debian tty 4, 64 Feb 12 2021 /dev/ttyS0
crw-rw---- 1 root dialout 4, 65 Feb 12 10:56 /dev/ttyS1
crw-rw---- 1 root dialout 4, 66 Feb 12 10:56 /dev/ttyS2
crw-rw---- 1 root dialout 4, 67 Feb 12 10:56 /dev/ttyS3
crw-rw---- 1 root dialout 4, 68 Feb 12 10:56 /dev/ttyS4
crw-rw---- 1 root dialout 4, 69 Feb 12 10:56 /dev/ttyS5

```

should I login Node-red as root mode or edit the settings.js ?which one ID is Node-red default user and group?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [12 February 2021 11:39 UTC](https://discourse.nodered.org/t/serial-port-authorization-problem-in-beaglebone-black-board/40857/4 "2021-02-12T11:39:02Z")

</div>

I think Node-RED runs as user/group node-red/node-red  
so yes maybe try adding node-red to the dialout group

```auto
sudo usermod -a -G dialout node-red

```

you may need to restart node-red (or reboot) afterwards to ensure that the session picks it up

@RobertCNelson - do you think this should be enabled by default ?

---

<div class="post-metadata">

**Author:** ![lpj669](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lpj669/32/68589_2.png) [@lpj669](https://discourse.nodered.org/u/lpj669)\
**Post date:** [12 February 2021 11:53 UTC](https://discourse.nodered.org/t/serial-port-authorization-problem-in-beaglebone-black-board/40857/5 "2021-02-12T11:53:42Z")

</div>

@dceejay ,Hi,dceejay,The command "sudo usermod -a -G dialout node-red" is valid and I can open every serialport now.thank you very much.

---

<div class="post-metadata">

**Author:** ![RobertCNelson](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/robertcnelson/32/36710_2.png) [@RobertCNelson](https://discourse.nodered.org/u/RobertCNelson)\
**Post date:** [12 February 2021 16:10 UTC](https://discourse.nodered.org/t/serial-port-authorization-problem-in-beaglebone-black-board/40857/6 "2021-02-12T16:10:12Z")

</div>

@dceejay , i agree that should have been the default, all fixed now!

> <https://github.com/rcn-ee/repos/blob/master/bb-node-red-installer/suite/buster/debian/postinst#L25-L29>

```auto
Setting up bb-node-red-installer (1.2.9-0rcnee2~buster+20210212) ...
Creating/updating node-red user account...
groupadd: group 'gpio' already exists
Updating node-red user to group gpio
Updating node-red user to group dialout
bb-node-red-installer:Installed

```

```auto
debian@bbb-pwr01-ser09:~$ cat /etc/group | grep dialout
dialout:x:20:debian,node-red

```

Regards,

---

<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:** [26 February 2021 16:10 UTC](https://discourse.nodered.org/t/serial-port-authorization-problem-in-beaglebone-black-board/40857/7 "2021-02-26T16:10:27Z")

</div>

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