io.getportstatus returns 53?



  • Hi,

    I'm trying to use the serial port /dev/ttyUSB0 on an Axon M505, but I'm getting a port status code of 53 after attempting to open the port. According to the table shown at https://forum.unipi.technology/topic/763/undefined-code-from-io-getportstatus-handle/3 this corresponds to "FileNotFound". I'm supplying the string 'serial:10:115200,8,N,1' to io.openport.

    Any ideas?


  • administrators

    Hi @matt,
    can you please verify how your USB device is enumerated in the system? Can you please post the dmesg output issued after connecting the device?

    Thank you in advance and have a nice day,
    Martin



  • Thanks @martin-kudláček. Here's the dmesg output:

    [237619.915800] usb 2-1: new full-speed USB device number 2 using ohci-platform
    [237620.166155] usbcore: registered new interface driver usbserial
    [237620.166234] usbcore: registered new interface driver usbserial_generic
    [237620.166296] usbserial: USB Serial support registered for generic
    [237620.171302] usbcore: registered new interface driver cp210x
    [237620.171386] usbserial: USB Serial support registered for cp210x
    [237620.181473] cp210x 2-1:1.0: cp210x converter detected
    [237620.191236] usb 2-1: cp210x converter now attached to ttyUSB0
    

    I had to compile the cp210x module to get this device to work, but I can now talk to it Python script so the driver seems to be working fine.



  • Hi @Martin-Kudláček, any ideas on this? I implemented a workaround with a Raspberry Pi talking to the device and sending the readout to the UniPi over Modbus, but it'd be nice to figure this out.



  • Hi @martin-kudláček, same issue for me.
    Serial device connected on Axon M505 via USB port 1
    (Baud=300, Databits=7, Parity=Even, Stopbits=1)

    def := 'serial:10:300,7,E,1';
    handle := io.openport(def);
    

    I get also status code 53 after opening the port, could you help?


  • administrators

    What device is it?



  • Hi @tomas_hora

    Thanks for your help.

    It is a optical meter reader:

    Here are the technical specifications:
    https://shop.weidmann-elektronik.de/index.php?page=product&info=24

    Here is also the dmesg output issued after connecting the USB device:

    [ 3051.254500] usb 2-1: new full-speed USB device number 2 using ohci-platform
    [ 3051.541253] usbcore: registered new interface driver usbserial
    [ 3051.541302] usbcore: registered new interface driver usbserial_generic
    [ 3051.541339] usbserial: USB Serial support registered for generic
    [ 3051.551364] usbcore: registered new interface driver ftdi_sio
    [ 3051.551419] usbserial: USB Serial support registered for FTDI USB Serial Device
    [ 3051.551798] ftdi_sio 2-1:1.0: FTDI USB Serial Device converter detected
    [ 3051.551964] usb 2-1: Detected FT-X
    [ 3051.555614] usb 2-1: FTDI USB Serial Device converter now attached to ttyUSB0
    

  • administrators

    Hello @pascal37,

    thanks for pointing this out. We have missed the config file responsible for static mapping of the USB ports. Its now part of the unipi-common package in version 1.2.15.test.20191129155215 so you can install it by "apt update && apt install unipi-common=1.2.15.test.20191129155215" or get a fixed OS image version 2.2.0.20 from our knowledge base.


  • administrators

    Hi @pascal37,
    just to let you know, that the neccessary changes has been merged into unipi-common v1.2.16 and the MervisOS image 2.2.0.20 is online.