3

When I log into my serial console using screen /dev/ttyUSB0 115200, I see some garbage in the output:

��
Arch Linux 3.6.11-10-ARCH+ (ttyAMA0)

raspberry login: root
�Password: 
Login incorrect

raspberry login: root
Password: 

These question marks are the FD bytes (hexadecimal) according to the hardcopy I made using Ctrl + A, H and F8 according to the screen log (screen -L). Observe that only the first Password line has the question mark, subsequent password prompts do not have that byte.

How can I stop these question marks from appearing? Do I need to change the tty settings or specify other screen parameters?

The getty process that is started by systemd has the following command:

/sbin/agetty --noclear ttyAMA0 115200 linux

I am using a USB device for hooking up the serial line:

067b:2303 Prolific Technology, Inc. PL2303 Serial Port

  • Prolific is well known for buggy hardware, did you try any other USB-Serial adapter? – lenik May 15 '13 at 12:05
  • @lenik I haven't got another. This adapter works fine with an other device (router), it only shows issues with this configuration. It looks like a software issue to me. Have you tried the serial console yourself? (btw, I tested with other baud rates too, it makes no difference) – Lekensteyn May 15 '13 at 22:25
  • I would say that is normal. Have seen a lot of network devices giving out weird characters. – Harijs Krūtainis Oct 9 '14 at 6:26
5

This is probably the well known bug of the spurious character when the serial port is opened. I don't remember the details, something to do with the TX line dropping for an instant so signalling a spurious start bit. From memory it is a bug in the Raspberry Pi Linux driver. I don't know why it hasn't been fixed, it has been commented on for several years.

As I say the character happens on port open, e.g.

fd = open("/dev/ttyAMA0", O_RDWR);

will cause the error.

The work around is to ignore the first byte and not to needlessly close/open the serial port.

  • What about Password? The behavior is so deterministic that it looks like a special control character which somehow does not get handled? – Lekensteyn Oct 9 '14 at 8:05
  • I'd have to connect a serial cable and have a look while a Pi is booting. Of course serial data can be corrupted for all sorts of additional reasons. In my case it's usually because I've forgotten to connect the grounds. Give me an hour or so and I'll have a look. – joan Oct 9 '14 at 8:14
  • @Lekensteyn A link to a boot up webm. I only see spurious characters pretty much where I'd expect, the times the port is opened, apart from one character early on which was probably just corrupt. – joan Oct 9 '14 at 8:42
  • Must be a bug in the RPi driver, the wires were already connected so any bit flipping happens because the driver is in a wrong state. No time to look into the driver source code, but thanks for your answer! – Lekensteyn Oct 9 '14 at 9:37
  • 2
    "ignore the first byte" means ignoring one character, Yet the OP defines clearly this goes beyond the first byte... – Tyson Oct 9 '14 at 11:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.