Code: Select all
pi@raspberrypi:~ $ ls -l /dev/serial0 /dev/ttyAMA0
lrwxrwxrwx 1 root root 7 Mar 22 03:56 /dev/serial0 -> ttyAMA0
crw-rw---- 1 root dialout 204, 64 Mar 22 03:56 /dev/ttyAMA0
pi@raspberrypi:~ $ sudo systemctl start serial-getty@serial0.service
pi@raspberrypi:~ $ ls -l /dev/serial0 /dev/ttyAMA0
lrwxrwxrwx 1 root root 7 Mar 22 03:56 /dev/serial0 -> ttyAMA0
crw--w---- 1 root tty 204, 64 Mar 22 03:58 /dev/ttyAMA0
pi@raspberrypi:~ $ sudo systemctl stop serial-getty@serial0.service
pi@raspberrypi:~ $ ls -l /dev/serial0 /dev/ttyAMA0
lrwxrwxrwx 1 root root 7 Mar 22 03:56 /dev/serial0 -> ttyAMA0
crw--w---- 1 root tty 204, 64 Mar 22 03:58 /dev/ttyAMA0
pi@raspberrypi:~ $ sudo systemctl is-active serial-getty@serial0.service
inactiveCode: Select all
dtoverlay=disable-bt
enable_uart=1Code: Select all
sudo raspi-configWe want to be able to use the serial port as the user pi (who is part of the dialout group). This works fine until the getty service gets started for the first time which then changes the permissions and prevents further readings as the user pi, regardless of whether the service is stopped. How do we prevent `/dev/ttyAMA0`’s permissions from being changed when starting a service? We also tried with serial0 pointing to /dev/ttyS0 before disabling bluetooth, but it gave the exact same problem.
It’s our first time working with serial ports, so it may be something obvious we’re missing, but searching the internet hasn’t yielded any solutions.
Many thanks in advance!