Using a USB Serial Converter

  • Death Rider

    Death Rider - 2005-08-19

    I have a USB Serial converter that hotplugs to /dev/ttyUSB0.  I hacked the code to use /dev/ttyUSBx versus ttySx.  When I build and run in debug l0=1, I get <br>
    Trying ...  diag_l2: diag_l2_open BR1 subid 0 L1proto2 called<br>
    diag_l0_br: open subinterface 0 protocol 2<br>
    diag_l0_br: Device /dev/ttyUSB0 opened, fd 3 features 0x2<br>
    diag_os: open: Ioctl TIOCGSERIAL failed 22<br>
    diag_l0_br: tty_init failed for /dev/ttyUSBS0<br>
    Failed to open hardware interface<br>
    ... Connection to ECU failed.

    When I connect to minicom and manually enter the BR1 codes to wakeup (0x20) I get the FF return expected.  When I then send 46 03 C1 33 F1 81 66 (as exampled in the odbdiagnostics pdf) I also get some data return. So it appears that the interface is working.
    I am not a serial port / USB serial port guru here and I do not have a PC that I can locate near enough to a vehicle to verify that a standard serial port works with scantool.
    Any suggestions as to what needs to be hacked to get scantool to work with a USB serial adapter?

    • Paul R. Kasper

      Paul R. Kasper - 2005-08-19

      I have had success with my FTDI converter w/o any code changes by simply creating a symbolic link  of

          /dev/obdII0 -> /dev/ttyUSB0

    • Death Rider

      Death Rider - 2005-08-19

      I did not see any mentions to /dev/odbii0.  Is this added by the code when it runs?

    • Paul R. Kasper

      Paul R. Kasper - 2005-08-21

      From diag_tty.c:

           * For historical compatability, if the subinterface decodes cleanly
           * as an integer we will write it into a string to get the name.
           * You can create a symlink to "/dev/obdII<NUMBER>" if you want to,
               * or just set the subinterface to a valid device name.

      I only discovered it by bumping up the "debug" levels and examining the logs.


Log in to post a comment.