Hi
I am trying to get comms between a Pico and Pi3 (Pico as kHz freq counter). Looks like serial is the best option, so I have setup the Pico to send out serial data (looks OK on a scope) and trying to use the serial pins GPIO14+15 on the Pi3 (is this dev/ttyS0 ?).
I have enabled SERIAL in Raspi Config, but when I use the serial node I keep getting Permission Denied. I have tried all sorts of permission settings from other forums but nothing fixes it.
ls -l /dev/ttyS*
crw-rw---- 1 root dialout 4, 64 Mar 29 04:02 /dev/ttyS0
crw-rw---- 1 root dialout 4, 65 Mar 29 04:02 /dev/ttyS1
crw-rw---- 1 root dialout 4, 66 Mar 29 04:02 /dev/ttyS2
crw-rw---- 1 root dialout 4, 67 Mar 29 04:02 /dev/ttyS3
You can safely change the group owner to dialout (which should already exist, if not create it). This is the traditional setting for serial ports since they were most often used for modems back in the day.
Once that is done, add the user that runs Node-RED to the dialout group. Restart and all will be well.
You could, of course, add the node-red user to group tty but that is less secure, best to stick with the well trodden path.
@all I have fixed it, I had a hunch and disabled the SERIAL CONSOLE in the Raspi Config and all has come good, had a hunch that the port was actually in use instead. Didnt find this anywhere, how obscure!
Thanks all, appreciated.
That is a well known problem and usually listed high on any forum talking about using the serial and usb ports. So well known that probably all of us have long ago disabled the serial console and no longer think about or remember it!
Because the tty group has access to all terminals (including psudo terminals used by things like ssh and x-terms) so can effectively snoop on all terminal access including password entry.
Modern systems normally only give the tty group write access (for tools like write and wall to send terminal broadcast messages, but it is still VERY bad practice for a normal user to be a member of this group.