Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getty prevents serial port usage #251

Open
ZL4JY opened this issue May 14, 2024 · 4 comments
Open

getty prevents serial port usage #251

ZL4JY opened this issue May 14, 2024 · 4 comments

Comments

@ZL4JY
Copy link

ZL4JY commented May 14, 2024

Despite disabling the console using raspi-config, getty still takes control of both ttyS0 and ttyAMA0.

Version:

Raspberry Pi OS with desktop
Release date: March 15th 2024
System: 64-bit
Kernel version: 6.6
Debian version: 12 (bookworm)

@ZL4JY
Copy link
Author

ZL4JY commented May 14, 2024

To test:

Disable console using raspi-config
Follow usual steps to enable ttyS0 or ttyAMA0
Check permissions on /dev/ttyAMA0
sudo chmod 777 /dev/ttyAMA0
Wait 20 seconds and check permissions again

Work around:

sudo systemctl stop serial-getty@ttyAMA0
sudo systemctl mask [email protected]

Repeat the test procedure to confirm permission changes remain unaltered.

@lurch
Copy link
Collaborator

lurch commented Jul 1, 2024

Could you clarify which model of Raspberry Pi you'e using please? The serial ports are setup slightly differently on different models of Raspberry Pi https://www.raspberrypi.com/documentation/computers/configuration.html#configure-uarts

@ZL4JY
Copy link
Author

ZL4JY commented Jul 1, 2024

RP 5

@lurch
Copy link
Collaborator

lurch commented Jul 2, 2024

I'm unable to reproduce this. Could you please give exact reproduction steps? (e.g. what does "Follow usual steps to enable ttyS0 or ttyAMA0" mean?)

Here's what I did (on a fully up-to-date 64-bit Raspberry Pi OS Bookworm image) on a Pi5:

  • ran sudo raspi-config
  • selected "3 Interface Options"
  • selected "I6 Serial Port"
  • answered "No" when asked "Would you like a login shell to be accessible over serial?"
  • answered "Yes" when asked "Would you like the serial port hardware to be enabled?"
  • selected "OK" and "Finish" to exit raspi-config
  • rebooted as prompted
  • after reboot, ls -l /dev/ttyAMA0 shows the permissions as crw-rw----
  • ran the sudo chmod 777 /dev/ttyAMA0 that you suggested
  • ls -l /dev/ttyAMA0 now shows the permissions as crwxrwxrwx
  • I waited a couple of minutes, and ls -l /dev/ttyAMA0 still shows the permissions as crwxrwxrwx
  • systemctl status serial-getty@ttyAMA0 lists the service as both disabled and inactive (dead)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants