[SOLVED] Input/output error accessing /dev/ttyS1 on Ubuntu 18.04

waynepiekarskiwaynepiekarski New Member Posts: 13
edited April 29 in UART

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?

Tagged:

Best Answer

Answers

  • ccaldeccalde Administrator, Moderator, Emutex Posts: 331 admin

    Hi @waynepiekarski ,

    Thanks for the reply!

    We just updated the pin information for UP board in our Wiki:
    https://wiki.up-community.org/Pinout

  • waynepiekarskiwaynepiekarski New Member Posts: 13

    Thanks for fixing up the docs, much appreciated!

  • roddinesroddines New Member Posts: 8
    edited July 22

    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

  • ccaldeccalde Administrator, Moderator, Emutex Posts: 331 admin

    Hi @roddines ,

    Thank you very much for your contribution!
    We will update our Wiki pages as soon as possible,
    Cheers!

  • roddinesroddines New Member Posts: 8

    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.
    [email protected]:~$ 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 16550A

    Also, 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-grub

    ttyS4 - 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 [email protected]
    [email protected]:~$ sudo systemctl enable [email protected]
    [sudo] password for username:
    Created symlink /etc/systemd/system/getty.target.wants/[email protected] → /lib/systemd/system/[email protected]
    [email protected]:~$ sudo reboot

    On 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 vt102

    Finally, enable the terminal:
    ~$ sudo start ttyS4

    Note: 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

  • ccaldeccalde Administrator, Moderator, Emutex Posts: 331 admin

    Hi @roddines ,

    Thank you very much for the update.
    We will update the Wiki with your contributions.

  • waynepiekarskiwaynepiekarski New Member Posts: 13

    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.

Sign In or Register to comment.