[SOLVED] Input/output error accessing /dev/ttyS1 on Ubuntu 18.04
![waynepiekarski](https://w9.vanillicon.com/939c42fab9e5ee620cef658ba73171e8_100.png)
I am currently getting the error "Input/output error" whenever I try to access /dev/ttyS1 on my Up Board.
I am using Ubuntu 18.04, and installed the custom kernel by following https://wiki.up-community.org/Ubuntu#Ubuntu_18.04_installation_and_configuration
Also, my dmesg output doesn't show any mention of /dev/ttyS1, instead only this is found:
$ dmesg | grep ttyS
[ 2.377490] 00:01: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[ 7.364610] 8086228A:00: ttyS4 at MMIO 0xa171b000 (irq = 39, base_baud = 2764800) is a 16550A
If I reboot to the BIOS settings screen, it looks like the pins are allocated to UART1 correctly, so it appears like everything should work.
Does anyone have any ideas on what else might need to be done to activate it?
Best Answer
-
On another thread it looks like it has been identified that the serial port is actually /dev/ttyS4 and not ttyS1 as indicated in the documentation. https://forum.up-community.org/discussion/3623/upboard-uart-error-initializing-uart#latest
Answers
-
Hi @waynepiekarski ,
Thanks for the reply!
We just updated the pin information for UP board in our Wiki:
https://wiki.up-community.org/Pinout -
Thanks for fixing up the docs, much appreciated!
-
Hi Admin
This Wiki page https://wiki.up-community.org/Serial_console
also needs updating for UP^2 /dev/ttyS4 (INSTEAD of the declared /dev/ttyS0)Another such excursion for bad documentation here: https://forum.up-community.org/discussion/1883/i-installed-ubuntu-16-04-2-desktop-amd64-iso-still-no-serial-port-working
-
Hi @roddines ,
Thank you very much for your contribution!
We will update our Wiki pages as soon as possible,
Cheers! -
Hi and thanks for listening:
I see you have already changed/updated the Wiki but even though I have no UP boards (I have UP^2) I am a little worried that you neglected to point out the difference (if any exists) between UP, UP^2 and UP Xtreme etc. If they are both/all the same that is fine but please be sure they are or you may have to list separate ttySx settings for each. Perhaps add the command that can check this, e.g.
username@up2hostname:~$ dmesg | grep tty
[ 0.000000] console [tty0] enabled
[ 7.952349] dw-apb-uart.8: ttyS4 at MMIO 0x91624000 (irq = 4, base_baud = 115200) is a 16550A
[ 7.973004] dw-apb-uart.9: ttyS5 at MMIO 0x91622000 (irq = 5, base_baud = 115200) is a 16550AAlso, you seem to have missed updating this one entry to ttyS4:
GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX console=tty0 console=ttyS0,115200n8"Further, I just ran through rebuilding Ubuntu 18.04(.2) LTS (server) using https://wiki.up-community.org/Ubuntu
and then implementing a Serial Console on the USB2 10Pin header. I have found some other issues/discrepancies you may want to add to the Wiki section on the serial console:Ubuntu (Ubuntu 18.04 LTS) - Maybe UP^2 Only (perhaps)
To enable the serial console on Ubuntu 18.04, first configure the GRUB default config:$ sudoedit /etc/default/grub
In that file, add/edit the following config (note the change from tty0 to tty1):GRUB_CMDLINE_LINUX="console=tty1 console=ttyS4,115200n8"
GRUB_TERMINAL_INPUT="console serial"
GRUB_TERMINAL_OUTPUT="gfxterm serial"
GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --stop=1"To finish this step, run
~$ sudo update-grubttyS4 - getty (allows console login)
Using ttyS4 with Upstart to get a login console
On Ubuntu 18.04 LTS (Bionic), if you also need a terminal on the serial TTY (which is probably the case), Upstart must be configured to start one. Run sudo /etc/init/ttyS4.conf and add this config:
~$ sudo systemctl enable getty@ttyS4
username@up2hostname:~$ sudo systemctl enable getty@ttyS4
[sudo] password for username:
Created symlink /etc/systemd/system/getty.target.wants/getty@ttyS4.service → /lib/systemd/system/getty@.service.
username@up2hostname:~$ sudo rebootOn Ubuntu 16.04 LTS (Xenial), if you also need a terminal on the serial TTY (which is probably the case), Upstart must be configured to start one. Run sudo /etc/init/ttyS4.conf and add this config:
I suspect this is similar if not the same as Ubuntu 18.04.2 LTS (Bionic Beaver)???? After days of attempts I couldn't get it to work so I changed to 18.04 LTS but then I never tried tty1 in GRUB (as per above) I was using tty0 and had the same results in 18.04 util I changed that according to this reference link: https://www.hiroom2.com/2018/04/30/ubuntu-1804-serial-console-en/
On Ubuntu 14.04 (Trusty), [NOT SUPPORTED ON UP^2] if you also need a terminal on the serial TTY (which is probably the case), Upstart must be configured to start one. Run sudoedit /etc/init/ttyS4.conf and add this config:
ttyS4 - getty (allows console login)
This service maintains a getty on ttyS4 from the point the system is
started until it is shut down again.
start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]respawn
exec /sbin/getty -L 115200 ttyS4 vt102Finally, enable the terminal:
~$ sudo start ttyS4Note: UNRELATED BOOT ERRORS That I get but do not fully understand
[ 2.466963] tpm tpm0: A TPM error (378) occurred get tpm pcr allocation
[ 2.626225] Couldn't get size: 0x800000000000000e
[ 5.825705] systemd-gpt-auto-generator[409]: Failed to dissect: Input/output error
[ 5.887845] systemd[399]: /lib/systemd/system-generators/systemd-gpt-auto-generator failed with exit status 1.
[ 6.929174] EDAC pnd2: Failed to register device with error -22.
[ 6.961232] EDAC pnd2: Failed to register device with error -22.Further references (some out of date but somewhat useful):
https://www.hiroom2.com/2018/04/30/ubuntu-1804-serial-console-en/
https://askubuntu.com/questions/96658/how-do-i-change-the-vga-resolution-for-the-non-graphical-ttys
http://0pointer.de/blog/projects/serial-console.html
https://help.ubuntu.com/community/SerialConsoleHowto
https://forum.up-community.org/discussion/1883/i-installed-ubuntu-16-04-2-desktop-amd64-iso-still-no-serial-port-working
https://superuser.com/questions/1175602/how-to-enable-and-use-the-serial-terminal-of-a-hp-microserver-gen9 -
Hi @roddines ,
Thank you very much for the update.
We will update the Wiki with your contributions. -
I just went to enable my serial console on boot, using the serial output available with the extra 2 USB port adapter, and had problems with the existing instructions at https://wiki.up-community.org/Serial_console#Ubuntu
For the Up Board X86, the correct serial port is /dev/ttyS0 (and /dev/ttyS4 is UART1 on the 40-pin breakout).
GRUB_CMDLINE_LINUX="console=tty1 console=ttyS0,115200n8"
GRUB_TERMINAL_INPUT="console serial"
GRUB_TERMINAL_OUTPUT="gfxterm serial"
GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --stop=1"My system now boots Ubuntu and shows everything on the serial port during grub, and the kernel boot, and also has a terminal that I can log in to. I didn't need to do anything else, but the current wiki looks incorrect saying ttyS4.