I want to start a serial terminal session after boot.
I get the "Uncompressing Linux... done, booting the kernel." message from the bootloader so the connection is OK.
In raspi-config I disabled the serial option.
On the console (tty1) I see that there is no getty started for ttyAMA0.
The documentation (http://0pointer.de/blog/projects/serial-console.html) gives:
systemctl start serial-getty@ttyS2.service
I changed it to:
sudo systemctl start serial-getty@ttyAMA0.service
I checked with:
sudo systemctl status serial-getty@ttyAMA0.service
● serial-getty@ttyAMA0.service - Serial Getty on ttyAMA0
Loaded: loaded (/lib/systemd/system/serial-getty@.service; disabled)
Active: active (running) since Tue 2015-11-24 09:17:29 CET; 9s ago
Main PID: 616 (agetty)
└─616 /sbin/agetty --keep-baud 115200 ttyAMA0 vt102
Nov 24 09:17:29 radio_keuken systemd: Started Serial Getty on ttyAMA0.
Running ps a gives:
PID TTY STAT TIME COMMAND
522 tty1 Ss 0:00 /bin/login -f
546 tty1 S+ 0:01 -bash
575 pts/0 Ss 0:01 -bash
616 ? Ss+ 0:00 /sbin/agetty --keep-baud 115200 ttyAMA0 vt102
644 pts/0 R+ 0:00 ps a
I'm using the console for the boot messages. (PID 522 and 546)
I'm also using a SSH session to copy and paste the results in this post. (PID 575 and 644)
There is no prompt at the serial terminal and a question mark in the TTY column of the process.
If I enabled the serial option in raspi-config the serial terminal is working.
If a run a minicom session:
minicom -b 115200 -o -D /dev/ttyAMA0
Stop the session with ctrl-A q (without reset)
Now I start the service and I get the prompt in my serial terminal.
Question still is what's wrong?
I changed the ExecStart to:
ExecStart=-/sbin/agetty -8 -a pi 115200 %I $TERM
Now it's working in both the boot and manual start of the service.
Still no idea what's wrong but now I've got a workaround.
I copied the /lib/systemd/system/serial-getty@.service file to /etc/systemd/system/serial-autologin@.service
Made the changes to ExecStart in that file.
Created this link in /etc/systemd/system/getty.target.wants:
serial-getty@ttyAMA0.service -> /etc/systemd/system/serial-autologin@.service
Now the serial terminal is started at boot.
1 post • Page 1 of 1