USB NMEA data over TCP

31 views
Skip to first unread message

Oscar Bombacha

unread,
Jun 11, 2020, 8:52:59 AM6/11/20
to kplex
Hello Good day
           I have R400N ais receiver connected on my network it has a USB output. Now I want that NMEA sentence to be received on TCP port on my network using raspberry pi I have downloaded kplex can you tell me the configuration for sudo nano /etc/kplex.conf for driving nmea data from usb to tcp port..

Thanks....


Keith Young

unread,
Jun 13, 2020, 4:38:24 PM6/13/20
to kplex
First work out what device your USB AIS appears as on the pi.  Let's assume it's /dev/ttyUSB0 (it might be something different).
Not sure whether "received on TCP port on my network" means you want to make the data available on a tcp server for other applications to connect to or whether you want to send the data over tcp to a remote server.  Let's cover both :-)

To create a tcp server on the pi running on tcp port 10110:

[serial]
device=/dev/ttyUSB0
direction=in

[tcp]
mode=server
direction=out

You can add a "port=12345" to change the tcp port of your server to "12345".  If the usb out is from the AIS unit I suspect you won't need to set baud rate.  If you were using a usb to serial adapter and needed to set the baud rate on the UART you'd generally need a "baud=38400" under the "[serial]" stanza.

To connect over tcp to a remote server, say something running on tcp pot 12345 on 192.168.1.55:

[serial]
device=/dev/ttyUSB0
direction=in

[tcp]
address=192.168.1.55
port=12345
direction=out

You can use symbolic names instead of addresses, e.g. "myserver.example.com" in place of "192.168.1.55".  Again, 10110 is the default port and if that's what you want to use you don't need to specify a port.

That's the very basic config but there's more you can do

Full details here:


Reply all
Reply to author
Forward
0 new messages