RFE : autobaud or list of baud rates

26 views
Skip to first unread message

Ken Harris

unread,
Feb 27, 2020, 10:43:39 AM2/27/20
to kplex

First off, kplex is great !

One idea : on the serial port, allow a list of baud rates and a heuristic that would cycle through the baud rate list and look for NMEA traffic (if the first character is a '$' and the check sum passes, then it's NMEA) ...

The reason is that with USB serial ports, if you have more than 1 port, it's not possible to tell what the port number will be.

For example, I set up kplex with one port to a gx2200 at 38400 bps and the other port to a e85001 (seatalk to NMEA) at 4800. FYI, I was running kplex on OpenWRT (on a Alfa Networks AP121U),

-K

Keith Young

unread,
Mar 11, 2020, 3:55:03 AM3/11/20
to kplex

One idea : on the serial port, allow a list of baud rates and a heuristic that would cycle through the baud rate list and look for NMEA traffic (if the first character is a '$' and the check sum passes, then it's NMEA) ...

The reason is that with USB serial ports, if you have more than 1 port, it's not possible to tell what the port number will be.

Sorry for the delay in replying.  Yes it's a good idea and I think has been suggested before.  I've created an issue for it:

However it may not be trivial: The read logic in kplex is entirely independent of  connection establishment so this may involve something a bit "nasty" but I'll look at what can be done.

A couple of other points:
- If the source is entirely USB baud rate doesn't matter at all.  If the source is a serial-to-usb converter then yes, you have to set the converter's UART to the right baud
- If you're using a flavour of Linux which uses udev you can use udev rules to assign a device name based on things like the identifier for a given serial-to-usb device or a particular usb port to add a little more determinacy to USB device name selection which might cure your problem in a different way

Ken Harris

unread,
Mar 11, 2020, 12:02:42 PM3/11/20
to kplex


On Wednesday, March 11, 2020 at 12:55:03 AM UTC-7, Keith Young wrote:

One idea : on the serial port, allow a list of baud rates and a heuristic that would cycle through the baud rate list and look for NMEA traffic (if the first character is a '$' and the check sum passes, then it's NMEA) ...

The reason is that with USB serial ports, if you have more than 1 port, it's not possible to tell what the port number will be.

Sorry for the delay in replying.  Yes it's a good idea and I think has been suggested before.  I've created an issue for it:

However it may not be trivial: The read logic in kplex is entirely independent of  connection establishment so this may involve something a bit "nasty" but I'll look at what can be done.

A couple of other points:
- If the source is entirely USB baud rate doesn't matter at all.  If the source is a serial-to-usb converter then yes, you have to set the converter's UART to the right baud

True.  For example, the Garmin GND10 shows up as ttyACM0, but it's not a real UART.
 
- If you're using a flavour of Linux which uses udev you can use udev rules to assign a device name based on things like the identifier for a given serial-to-usb device or a particular usb port to add a little more determinacy to USB device name selection which might cure your problem in a different way

Yes, that works great, but I often run kplex on OpenWRT, which doesn't do udev ...
 

Ken Harris

unread,
Mar 14, 2020, 5:23:58 PM3/14/20
to kplex
 FYI, Michael Rausch seems to have a script for OpenWRT to "create persistent USB tty device links under /dev/serial/by-port" : http://www.netadair.de/openwrt/ . I'll test it.


 
Reply all
Reply to author
Forward
0 new messages