Results 1 to 9 of 9

Thread: How to access USB Serial devices

  1. #1

    Default How to access USB Serial devices

    Hi,
    Firstly this used to work in Leap 15 beta but stopped in the official release. It also woks in Tumbleweed.
    Secondly, this is what has stopped working:
    Code:
    >kermit testing.ksc
    Now this is the venerable serial communications program (& not the frog!) which then pulls in the script (testing.ksc).
    This is the script:
    Code:
    SET MODEM TYPE NONE
    SET LINE /dev/ttyUSB0
    IF FAIL EXIT 1 "/dev/ttyUSB0 is not available"
    exit
    Each of these lines will execute without error if entered in the Kermit command shell but the "SET LINE /dev/ttyUSB" will fail when executed within the script?

    This has worked for me for years and has only failed on my PCs with the upgrade from Leap 15 Beta to Leap 15? My suspicion is something along the lines of permissions passing to child process but I lack the skills to debug to that level.

    Regards, Martin
    openSUSE Leap 15.3, KDE Plasma Version: 5.18.6

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,777

    Default Re: How to access USB Serial devices

    And did you check if there is any ttyUSB* device file available in /dev?

    As most of the device files are generated dynamically I assume that ttyUSB* special files are created on detecting ann USB device that reports having async data communication support. Thus you could check if the device is plugged properly. Also it could be that 15.0 does not detect the device correct. Thus remove it and connect it while looking with
    Code:
    dmsg -w
    Just some suggestions.
    Henk van Velden

  3. #3

    Default Re: How to access USB Serial devices

    Quote Originally Posted by hcvv View Post
    And did you check if there is any ttyUSB* device file available in /dev?
    Thank you for the suggestions.
    And, yes the USB device is plugged in an working as far as I can tell? Perhaps I should have called it /dev/tty_XXX or /dev/ttyACM0 because in this context any and all USB serial devices are failing.
    For example, these are some of tests:

    On a Tumbleweed PC run Kermit testing.ksc = Working
    On same Tumbleweed PC run a VirtualBox Tumbleweed Client = Working.
    On same Tumblweed PC run a VirtualBox Leap 15 beta Client = Working
    On same Tumbleweed PC run VirtualBox Leap 15 Release Client = NOT Working?

    Repeat all above with a LEAP 15 release as the VirtualBox host and no combinations work?

    Repeat all above with different tests. For example using MiniCom -S dummyScript.msc All work.
    However, this is not a valid comparison because MiniCom will either connect to the required device using parameters on the command line or default values in the config file not from instruction in the script file. It does, however, tell me that the USB device is working in all that do not include Leap 15 release.

    Don't get hung up on the possibilities for failure with VirtualBox. I am only using that to reduce the possibilities of variance in testing across multiple PCs.

    Regards, Martin
    openSUSE Leap 15.3, KDE Plasma Version: 5.18.6

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,777

    Default Re: How to access USB Serial devices

    I think you missed something of my suggestion.
    And did you check if there is any ttyUSB* device file available in /dev?
    Because I see nothing of the kind in your post. I would do that e.g. with
    Code:
    ls -l /dev/ttyUSB*
    or when you think they have other names, by looking at (and posting) those.

    It is a simple straight stupid action. When some error tells me that a file does not exist, my first action is then to go and look if that is true doing an ls -l of such a file. And of course when I start a thread about such a problem, I do post that so that everybody believes me (well, in fact they believe the computer).

    That would probably look like:
    Code:
    boven:~ # ls -l /dev/ttyUSB*
    ls: cannot access /dev/ttyUSB*: No such file or directory
    boven:~ #
    Henk van Velden

  5. #5

    Default Re: How to access USB Serial devices

    Quote Originally Posted by hcvv View Post
    It is a simple straight stupid action. When some error tells me that a file does not exist, my first action is then to go and look if that is true doing an ls -l of such a file. And of course when I start a thread about such a problem, I do post that so that everybody believes me (well, in fact they believe the computer).
    Yes, you are quite right to ask the question, but I am sure that the device is there, not only via the test you suggest, but because, it is seen in the working examples I have given and lastly because I have a /etc/udev/rules.d file that says:
    Code:
    SUBSYSTEM=="tty", ATTRS{serial}=="113010823430", SYMLINK+="tty_OBDLink" 
    SUBSYSTEM=="tty", ATTRS{serial}=="FT93S0PD", SYMLINK+="tty_ToCar"
    SUBSYSTEM=="tty", ATTRS{serial}=="FT93S0N9", SYMLINK+="tty_FromCar" 
    SUBSYSTEM=="tty", ATTRS{serial}=="FTFP8OLT", SYMLINK+="tty_FTDI5v" 
    SUBSYSTEM=="tty", ATTRS{serial}=="75331313133351D070F1", SYMLINK+="tty_Arduino"
    and I would like to use any/all these USB devices in Leap 15 but can't. Because, I suspect there is something funny going on deep in the Leap 15 innards?

    However, for completeness here is the evidence you requested:
    Code:
    gzunder:/home/mprowe # ls -l /dev/tty* | grep USB
    crw-rw---- 1 root dialout 188,  0 May 26 14:31 /dev/ttyUSB0
    lrwxrwxrwx 1 root root          7 May 26 14:31 /dev/tty_OBDLink -> ttyUSB0
    gzunder:/home/mprowe #
    The scripts I wish to use will reference the symlinks and the user is a member of Dialout.

    Regards, Martin
    openSUSE Leap 15.3, KDE Plasma Version: 5.18.6

  6. #6
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    32,336
    Blog Entries
    15

    Default Re: How to access USB Serial devices

    Quote Originally Posted by martinprowe View Post
    Yes, you are quite right to ask the question, but I am sure that the device is there, not only via the test you suggest, but because, it is seen in the working examples I have given and lastly because I have a /etc/udev/rules.d file that says:
    Code:
    SUBSYSTEM=="tty", ATTRS{serial}=="113010823430", SYMLINK+="tty_OBDLink" 
    SUBSYSTEM=="tty", ATTRS{serial}=="FT93S0PD", SYMLINK+="tty_ToCar"
    SUBSYSTEM=="tty", ATTRS{serial}=="FT93S0N9", SYMLINK+="tty_FromCar" 
    SUBSYSTEM=="tty", ATTRS{serial}=="FTFP8OLT", SYMLINK+="tty_FTDI5v" 
    SUBSYSTEM=="tty", ATTRS{serial}=="75331313133351D070F1", SYMLINK+="tty_Arduino"
    and I would like to use any/all these USB devices in Leap 15 but can't. Because, I suspect there is something funny going on deep in the Leap 15 innards?

    However, for completeness here is the evidence you requested:
    Code:
    gzunder:/home/mprowe # ls -l /dev/tty* | grep USB
    crw-rw---- 1 root dialout 188,  0 May 26 14:31 /dev/ttyUSB0
    lrwxrwxrwx 1 root root          7 May 26 14:31 /dev/tty_OBDLink -> ttyUSB0
    gzunder:/home/mprowe #
    The scripts I wish to use will reference the symlinks and the user is a member of Dialout.

    Regards, Martin
    Hi
    If you exclude your udev rules and the symlink and just use /dev/ttyUSB0 does your kermit script work in Leap 15? If it does then try a manual creation of the symlink and test again.

    In the versions that work if you monitor udev (udevadm monitor) do you see the same output in Leap 15. Did you add the rule and reload via udevadm trigger?
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  7. #7

    Default Re: How to access USB Serial devices

    Hi Malcolm,
    Quote Originally Posted by malcolmlewis View Post
    Hi, If you exclude your udev rules and the symlink and just use /dev/ttyUSB0 does your kermit script work in Leap 15?
    Nop. Tried that too. Edited the script to use the raw port names but made no difference.
    In the versions that work if you monitor udev (udevadm monitor) do you see the same output in Leap 15. Did you add the rule and reload via udevadm trigger?
    Not tried that one yet. Will come back with the info.
    I have tried strace kermit testing.ksc and no the output between Tumbleweed and Leap 15 is quite different. But not been able to determine where the significant deviation starts though.

    Regards, Martin
    openSUSE Leap 15.3, KDE Plasma Version: 5.18.6

  8. #8

    Default Re: How to access USB Serial devices

    Quote Originally Posted by malcolmlewis View Post
    In the versions that work if you monitor udev (udevadm monitor) do you see the same output in Leap 15.
    HI Malcolm,

    Sorry for the delay. Had to go and Google to get up-to-speed on udevadm. Still not sure what we may be looking for? But anyway, to answer you question (I think), no the output on Tumbleweed & Leap 15 are different.
    This is the output (46 lines) for udevadm monitor while I plug in and then remove the USB device:
    Code:
    monitor will print the received events for:
    UDEV - the event which udev sends out after rule processing
    KERNEL - the kernel uevent
    
    KERNEL[29692.258397] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4 (usb)
    KERNEL[29692.260426] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0 (usb)
    KERNEL[29692.261814] bind     /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4 (usb)
    UDEV  [29692.288573] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4 (usb)
    KERNEL[29692.295119] add      /module/usbserial (module)
    KERNEL[29692.296326] add      /bus/usb-serial (bus)
    KERNEL[29692.297675] add      /bus/usb/drivers/usbserial_generic (drivers)
    UDEV  [29692.298845] add      /bus/usb-serial (bus)
    KERNEL[29692.300056] add      /bus/usb-serial/drivers/generic (drivers)
    UDEV  [29692.301340] add      /module/usbserial (module)
    KERNEL[29692.302551] add      /module/ftdi_sio (module)
    UDEV  [29692.303847] add      /bus/usb-serial/drivers/generic (drivers)
    KERNEL[29692.305153] add      /bus/usb/drivers/ftdi_sio (drivers)
    UDEV  [29692.306364] add      /bus/usb/drivers/usbserial_generic (drivers)
    KERNEL[29692.307726] add      /bus/usb-serial/drivers/ftdi_sio (drivers)
    UDEV  [29692.309047] add      /module/ftdi_sio (module)
    KERNEL[29692.310273] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/ttyUSB0 (usb-serial)
    UDEV  [29692.311678] add      /bus/usb-serial/drivers/ftdi_sio (drivers)
    KERNEL[29692.313049] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/ttyUSB0/tty/ttyUSB0 (tty)
    UDEV  [29692.314380] add      /bus/usb/drivers/ftdi_sio (drivers)
    KERNEL[29692.315574] bind     /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/ttyUSB0 (usb-serial)
    UDEV  [29692.319842] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0 (usb)
    KERNEL[29692.321119] bind     /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0 (usb)
    UDEV  [29692.322577] bind     /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4 (usb)
    UDEV  [29692.323891] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/ttyUSB0 (usb-serial)
    UDEV  [29692.325332] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/ttyUSB0/tty/ttyUSB0 (tty)
    UDEV  [29692.326733] bind     /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/ttyUSB0 (usb-serial)
    UDEV  [29692.328154] bind     /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0 (usb)
    KERNEL[29697.877747] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/ttyUSB0/tty/ttyUSB0 (tty)
    KERNEL[29697.879183] unbind   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/ttyUSB0 (usb-serial)
    KERNEL[29697.880489] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/ttyUSB0 (usb-serial)
    KERNEL[29697.881892] unbind   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0 (usb)
    UDEV  [29697.883733] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/ttyUSB0/tty/ttyUSB0 (tty)
    KERNEL[29697.885450] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0 (usb)
    UDEV  [29697.887720] unbind   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/ttyUSB0 (usb-serial)
    KERNEL[29697.888985] unbind   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4 (usb)
    UDEV  [29697.890326] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/ttyUSB0 (usb-serial)
    KERNEL[29697.891736] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4 (usb)
    UDEV  [29697.893064] unbind   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0 (usb)
    UDEV  [29697.894470] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0 (usb)
    UDEV  [29697.895803] unbind   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4 (usb)
    UDEV  [29697.897462] remove   /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4 (usb)
    While this (36 lines?) is the equivalent output on a Leap 15 PC:
    Code:
    monitor will print the received events for:
    UDEV - the event which udev sends out after rule processing
    KERNEL - the kernel uevent
    
    KERNEL[84.463734] add      /devices/pci0000:00/0000:00:1d.0/usb5/5-1 (usb)
    KERNEL[84.467556] add      /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0 (usb)
    UDEV  [85.026542] add      /devices/pci0000:00/0000:00:1d.0/usb5/5-1 (usb)
    KERNEL[85.039407] add      /module/usbserial (module)
    KERNEL[85.042100] add      /bus/usb-serial (bus)
    UDEV  [85.043901] add      /module/usbserial (module)
    KERNEL[85.045822] add      /bus/usb/drivers/usbserial (drivers)
    UDEV  [85.047414] add      /bus/usb/drivers/usbserial_generic (drivers)
    KERNEL[85.048920] add      /bus/usb/drivers/usbserial_generic (drivers)
    UDEV  [85.050593] add      /bus/usb/drivers/usbserial (drivers)
    KERNEL[85.052187] add      /bus/usb-serial/drivers/generic (drivers)
    UDEV  [85.053809] add      /module/ftdi_sio (module)
    KERNEL[85.055445] add      /module/ftdi_sio (module)
    UDEV  [85.057012] add      /bus/usb/drivers/ftdi_sio (drivers)
    KERNEL[85.058609] add      /bus/usb/drivers/ftdi_sio (drivers)
    UDEV  [85.060169] add      /bus/usb-serial (bus)
    KERNEL[85.064108] add      /bus/usb-serial/drivers/ftdi_sio (drivers)
    UDEV  [85.073633] add      /bus/usb-serial/drivers/generic (drivers)
    KERNEL[85.075335] add      /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/ttyUSB0 (usb-serial)
    UDEV  [85.076882] add      /bus/usb-serial/drivers/ftdi_sio (drivers)
    KERNEL[85.078461] add      /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/ttyUSB0/tty/ttyUSB0 (tty)
    UDEV  [85.080133] add      /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0 (usb)
    UDEV  [85.081881] add      /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/ttyUSB0 (usb-serial)
    UDEV  [85.083567] add      /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/ttyUSB0/tty/ttyUSB0 (tty)
    KERNEL[92.326796] remove   /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/ttyUSB0/tty/ttyUSB0 (tty)
    KERNEL[92.336488] remove   /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/ttyUSB0 (usb-serial)
    UDEV  [92.338209] remove   /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/ttyUSB0/tty/ttyUSB0 (tty)
    KERNEL[92.339805] remove   /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0 (usb)
    UDEV  [92.341645] remove   /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/ttyUSB0 (usb-serial)
    KERNEL[92.343767] remove   /devices/pci0000:00/0000:00:1d.0/usb5/5-1 (usb)
    UDEV  [92.345715] remove   /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0 (usb)
    UDEV  [92.347294] remove   /devices/pci0000:00/0000:00:1d.0/usb5/5-1 (usb)
    Mean anything to you?

    Regards, Martin
    PS - Is there an "Attach File(s)" function on this forum?
    openSUSE Leap 15.3, KDE Plasma Version: 5.18.6

  9. #9
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,777

    Default Re: How to access USB Serial devices

    Quote Originally Posted by martinprowe View Post
    PS - Is there an "Attach File(s)" function on this forum?
    You can upload to http://paste.opensuse.org and post the URL.
    Henk van Velden

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •