1

I have a USB to Serial port adaptor, Prolific Technology, Inc. PL2303 Serial Port which works on ubuntu 10.04, and win xp, win7 machines. However, I have problems with it on Ubuntu 13.10 and 14.04 LTS. It enumerates OK and shows up as /dev/ttyUSB0 or /dev/ttyUSB1. Currently I am trying to connect to a cheap RS232 multimeter which connects to pin 2 (Rx data) and the pin 4 (DTR) line.

1.)Does anybody know whether the usb-serial drivers for PL2303 work or are broken? If they are OK, then 2.)does anyone know how to set or reset the DTR line? This is used to enable or suppress the output from the multimeter.

currently using tcl/tk for accessing hardware.

2
  • To answer my own questions, 1) the usb-serial drivers for PL2303 do work and are not broken. I think most of the problems arise from the initialization where the DTR line defaults to -ve volts ie 0. Previous versions of Ubuntu ie 10.04 the default was +ve volts on the DTR line. Note that other usb to serial converters such as Belkin F5U409 in UBUNTU 14.04 default to +ve volts on DTR line thus work OK. Confirmation of working drivers was done using GTKterm and toggling the DTR line. Furthermore connection to a Stanford Research SR830 Lock-in amplifier was established and its identify verified. – user281443 May 20 '14 at 7:04
  • 2. Having established working drivers, the solution in tcl/tk is to use the -ttycontrol switch within the fconfigure command. ie. ... set device "/dev/ttyUSB0" set dh [open $device r+] fconfigure $dh -mode $baud_rate,$parity,$data_bits,$stop_bits -translation binary -encoding binary -blocking 0 -buffering line -ttycontrol {RTS 0 DTR 1} set tmpstr [ read $dh ] close $dh ... Works for me :). – user281443 May 20 '14 at 7:05
1

To answer my own questions:

  1. the usb-serial drivers for PL2303 do work and are not broken. I think most of the problems arise from the initialization where the DTR line defaults to -ve volts ie 0. Previous versions of Ubuntu (i.e. 10.04) the default was +ve volts on the DTR line. Note that other usb to serial converters such as Belkin F5U409 in UBUNTU 14.04 default to +ve volts on DTR line thus work OK. Confirmation of working drivers was done using GTKterm and toggling the DTR line. Furthermore connection to a Stanford Research SR830 Lock-in amplifier was established and its identify verified.

  2. Having established working drivers, the solution in tcl/tk is to use the -ttycontrol switch within the fconfigure command. i.e.:

    ...
    
    set device "/dev/ttyUSB0"
    
    set dh [open $device r+]
    
    fconfigure $dh -mode $baud_rate,$parity,$data_bits,$stop_bits -translation binary -encoding binary -blocking 0 -buffering line -ttycontrol {RTS 0 DTR 1}
    
    set tmpstr [ read $dh ]
    
    close $dh 
    
    ...
    

Works for me :).

1
  • Thank you for posting your solution. I'm having a similar problem using node-serial (see issue I posted at github.com/EmergingTechnologyAdvisors/node-serialport/issues/…). Do you only have to set those flag once during your port usage? Can you post the output for sudo statserial /dev/ttyUSB0, sudo stty --all -F /dev/ttyUSB0 and anything else you think might be helpful? Thanks! – John Manko Apr 8 '17 at 5:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.