Jump to content

ezpl

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by ezpl

  1. On 15/02/2017 at 0:05 AM, martinayotte said:

    For UARTs, you don't need those library, you only need to access kernel serial device, such /dev/ttyS1, using python-serial.

     

    For example, the following piece of code will print any character received on RX :

    
    import serial
    
    serport = serial.Serial("/dev/ttyS1", 115200, timeout=1)
    while True:
        while serport.inWaiting() > 0:
            c = serport.read()
            print c

     

    Thanks for the tip!

    I'm on Orange Pi Zero running  4.10.1-sun8i 

    After importing pySerial, I tested this code:

    import serial
    
    port = serial.Serial("/dev/ttyS1", 115200, timeout=1)
    print(port.name)

    Unfortunately it fails with 'serial.serialutil.SerialException: Could not configure port: (5, 'Input/output error')'

     

    Listing the ports using:  python -m serial.tools.list_ports , results in "no ports found"

     

    I also tried adding the port using overlays as suggested in this post : https://forum.armbian.com/index.php?/topic/3651-uart-on-orange-pi-zero/#comment-26402

     

     

    Any other suggestions?

     

    Thanks,

     

    ezpl

  2. I am just getting started using the Orange Pi Zero and installed Xenial 4.10.1. Currently I am using Python and am able to address the GPIO pins

    (using this project: https://github.com/duxingkei33/orangepi_PC_gpio_pyH3)

     

    However, I need to communicate with a serial device (projector) using RS232 on 9600 BAUD. For this, the built-in UART should do the trick (with an additional voltage converter).

    Does anyone know how I can address this device from Python? Alternatively, is there a way to clock" an GPIO output to 9600 BAUD and manually send the data?

     

    Thanks,

     

    Ezpl

×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines