0

I have a USB device that I need to control in Linux using Python and serial commands, it works with ASCII commands.

In Windows it works fine after I install the vendor driver and in Device Manager I see it as a COM3 port and I communicate using pyserial or pyvisa modules.

In Linux I see it as /dev/ttyUSB1 but I cannot communicate with it using pyserial or pyvisa. The problem is that the vendor doesn't provide Linux drivers.

How am I able to get the device behave as a serial port in Linux?

betelgeuse
  • 430
  • 2
  • 10
  • 24
  • There must already be a driver for your device in your Linux kernel; that's why you are seeing the `/dev/ttyS0` entry. So this is not a missing driver issue. I suggest closing this question and asking a better one that properly explains what the problem is ("cannot communicate" doesn't give us much info). – David Grayson Nov 29 '17 at 18:21
  • 1
    plug the thing in and do 'dmesg | tail' and see what happened. Also, the most common problem in linux is that you might not have permissions on the serial port. Make sure you are in the dialout group. – electrogas Nov 29 '17 at 19:34
  • `/dev/ttyS0` is not your USB2Serial adapter. So find the proper device file to use. – Alex P. Nov 29 '17 at 21:44
  • @electrogas 'dmesg | tail' output the following: – betelgeuse Nov 30 '17 at 09:55
  • @electrogas [53301.615703] ftdi_sio 3-3:1.0: device disconnected [55579.152079] usb 3-3: new full-speed USB device number 6 using xhci_hcd [55579.284933] usb 3-3: New USB device found, idVendor=104d, idProduct=3000 [55579.284939] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3 – betelgeuse Nov 30 '17 at 09:56
  • @electrogas [55579.284942] usb 3-3: Product: Agilis [55579.284945] usb 3-3: Manufacturer: Newport [55579.284947] usb 3-3: SerialNumber: FT0GPY0Y [55579.286399] ftdi_sio 3-3:1.0: FTDI USB Serial Device converter detected [55579.286447] usb 3-3: Detected FT232RL [55579.286641] usb 3-3: FTDI USB Serial Device converter now attached to ttyUSB1 – betelgeuse Nov 30 '17 at 09:58
  • @AlexP. sorry, it was /dev/ttyUSB1 but still not working – betelgeuse Nov 30 '17 at 09:59
  • And are you a member of the dialout group? At a command line do "groups" – electrogas Dec 01 '17 at 03:33
  • @electrogas yes, my user is already in dialout – betelgeuse Dec 01 '17 at 09:46

1 Answers1

2

try python -m serial.tools.miniterm /dev/ttyUSB1 and read the issue on https://github.com/pyserial/pyserial/issues/67 especially the version of pyserial

if this issue is related to yours possibly this also works :

Managed to bypass this issue by passing dsrdtr=True and rtscts=True to serial.Serial() ... as described here

your device is based on an FTDI chip, the inbuilt linux kernel module for this is ftdi_sio and usb_serial see http://www.ftdichip.com/Support/Documents/AppNotes/AN_220_FTDI_Drivers_Installation_Guide_for_Linux.pdf

ralf htp
  • 9,149
  • 4
  • 22
  • 34