Upboard UART : Error initializing UART

kevink
kevink New Member Posts: 7

I am currently trying to set up my upboard to send and receive UART with a micro-controller and I am struggling to initialize the UART correctly.

I tried to run the commands given here: https://wiki.up-community.org/Pinout#GPIO_Example_.231
and received the error: stty: /dev/ttyS1: Input/output error

I then thought, "Oh well maybe mraa could figure this out," and the sample mraa uart code returned: ValueError: Error initializing UART

I am running ubuntu 16.04 and I've already tried reinstalling the upboard kernel following the instructions here: https://wiki.up-community.org/Ubuntu#Install_Ubuntu_for_UP.2C_UP2.2C_UP_Core_and_UP_Core_Plus_2

I've been searching the forums for solutions and have come up empty. Has anyone else had this experience? Could there be a step that I am missing? Thanks.

Comments

  • waynepiekarski
    waynepiekarski New Member Posts: 28 ✭✭

    I just received my Up Board and am having the same problem as well. /dev/ttyS1 returns "Input/output error" no matter what I do.

    In the BIOS settings, it looks like the pins are allocated to UART1. I am using Ubuntu 18.04, and the problem happens with a default install, as well as following the extra kernel installation instructions at https://wiki.up-community.org/Ubuntu#Ubuntu_18.04_installation_and_configuration

    I made a post in the Up Board Linux category in the hope that someone can provide guidance on this: https://forum.up-community.org/discussion/3649/input-output-error-accessing-dev-ttys1-on-ubuntu-18-04#latest

  • kevink
    kevink New Member Posts: 7
    edited April 2019

    Ok I finally fixed it. The UART appears to actually be running through /dev/ttyS4. The commands I linked above still don't appear to work. However, I am able to send and receive serial messages using the pyserial api.

    Try running this code with the UART tx and rx wired together with a jumper:

    import serial
    ser = serial.Serial('/dev/ttyS4')  # open serial port
    print(ser.name)         # check which port was really used
    
    ser.write('hello')      # write a string
    
    mes = ser.read(5)   # read that string 
    print(mes)
    
    ser.close()             # close port
    
  • waynepiekarski
    waynepiekarski New Member Posts: 28 ✭✭

    Ah yes, you are right, it is /dev/ttyS4. I used the following command with a wire connected from pin 8 to 10:

    picocom -b 115200 /dev/ttyS4

    If you can type and see the characters, it is working. I can now hook my GPS up and see the output too.

  • AdamMiltonBarker
    AdamMiltonBarker New Member Posts: 20

    @waynepiekarski said:
    Ah yes, you are right, it is /dev/ttyS4. I used the following command with a wire connected from pin 8 to 10:

    picocom -b 115200 /dev/ttyS4

    If you can type and see the characters, it is working. I can now hook my GPS up and see the output too.

    Hi mate. When I do this it says terminal ready and just freezes, I am trying to receive and send data to an ESP8266 connected via rx tx. When the ESP8266 is connected it is sending the data, but printing the output of ser.read() it never receives this information. I only get b''. Any suggestions ?

  • AdamMiltonBarker
    AdamMiltonBarker New Member Posts: 20
    edited June 2020

    @AdamMiltonBarker said:

    @waynepiekarski said:
    Ah yes, you are right, it is /dev/ttyS4. I used the following command with a wire connected from pin 8 to 10:

    picocom -b 115200 /dev/ttyS4

    If you can type and see the characters, it is working. I can now hook my GPS up and see the output too.

    Hi mate. When I do this it says terminal ready and just freezes, I am trying to receive and send data to an ESP8266 connected via rx tx. When the ESP8266 is connected it is sending the data, but printing the output of ser.read() it never receives this information. I only get b''. Any suggestions ?

    Can anyone from Aaeon offer any advice? This is still not working, have an ESP8266 12f connected to 5v off of the UP2 and rx tx, the ESP sends data via serial but the UP is unable to receive it.

  • kkannan7
    kkannan7 New Member Posts: 3

    @AdamMiltonBarker I have the same issue. Did you find a solution?

  • waynepiekarski
    waynepiekarski New Member Posts: 28 ✭✭

    Are you able to connect your ESP8266 to a serial port on another computer? Or a USB-Serial converter?

    I've been using the UpBoard serial port on Ubuntu 18.04 for a few years now and it works reliably once the bugs in the documentation were resolved. Make sure you have the BIOS settings configured, and also run the kernel designed for the UpBoard so that the 40-pin connector works properly. I'm not sure if any of this works with the default Linux kernel.

Privacy Policy