Problem with USB to Serial Adapter on Raspberry Pi boot up with incoming NMEA data

219 views
Skip to first unread message

David Burt

unread,
Jul 22, 2016, 12:48:56 AM7/22/16
to kplex

I am running kPlex on a Raspberry Pi with Jessie. Generally it works well with NMEA data but has a problem on reboot described below.


The serial connection to the NMEA device is via a USB to serial (RS232) adapter connected to an RS232 to RS485 converter. The USB to serial is a Targus PA088.


I suspect the problem is to do with how the Raspberry Pi defines the USB to serial adapter on boot up.


It works fine if I start the Raspberry Pi with no incoming serial (NMEA) data on the interface.


If I do an lsusb command I get the following. Note the first device is a serial port. There is a /dev/ttyUSB0 which I have set in kplex.conf. kPlex works as it should.


No incoming serial data

lsusb

Bus 001 Device 005: ID 0711:0230 Magic Control Technology Corp. MCT-232 Serial Port

Bus 001 Device 004: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter

Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter

Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

 

If I reboot the Raspberry Pi with an incoming serial (NMEA) stream on the interface the Raspberry Pi decides the USB device is a mouse and the kPlex system then does not work.

If I do an lsusb command I get the following. Note the first line only is given here:


Incoming serial data

lsusb

Bus 001 Device 005: ID 0711:0231 Magic Control Technology Corp. PS/2 Mouse Port


Note the different productid = 0231 to above (=0230).

In this state there is no /dev/ttyUSB0 present.Hence kPlex does not work.


I think I need to somehow lock down this USB to serial adapter to be a serial port under all conditions. How do I do this?

Keith Young

unread,
Jul 22, 2016, 4:57:30 PM7/22/16
to kplex
Short answer: Dunno. Not a kplex problem and I haven't encountered it before.  However some googling suggests that there are devices which change the id they report to the OS according to whether or not they detect input at startup (hm...found the reference on my way home this evening, can't find it again now...).  All the problems I saw along these lines were on windows though.

Things I'd try? Check which driver you're using (there seem to be a couple for those devices).  See if there's any magic you can do with them. Try asking the manufacturer or the chipset manufacturer, and as a last resort a little investigation suggests (I haven't done this myself) you can always unbind the device from any HID driver it's bound to, change the device id and rebind the serial device to it:
Once again: no idea if that works.  If it does you could do some nasty hacky scripting called form a udev rule or in the kplex startup.  Sorry to not be more help

David Burt

unread,
Aug 2, 2016, 8:29:28 PM8/2/16
to kplex
I have solved this problem.

The TARGUS PA088 USB to serial converter is no good for this application. The Raspberry Pi (Jessie) configures it as a mouse if there is incoming data during boot-up.

I tried a unit from a different manufacturer (brainboxes) and it works fine.

Robbie Wilderspin

unread,
Aug 4, 2016, 4:40:05 AM8/4/16
to kplex
fwiw, this sounds very similar to problems experienced with Windows and GPS pucks over the years. The serial enumeration process can misidentify a GPS as a mouse, this was fixed in later FTDI drivers by providing a switch to disable enumeration for the serial port.
Reply all
Reply to author
Forward
0 new messages