skylab
Posts: 2
Joined: Fri Sep 15, 2017 7:55 pm

Using the Raspberry Pi as a bridge between USB and Ethernet

Fri Sep 15, 2017 8:16 pm

Before we start with 'this is already posted'...I have an application that I haven't seen any info on this forum yet.
My USB device collects GPS data and outputs NMEA Sentences to USB.
I want to use one of the Raspberry Pi's USB ports to collect the NMEA sentences and send them out the Ethernet Port.

All of the posts on the forums that I have seen involve bridging a WiFi dongle or an Ethernet dongle that is plugged in to the PIs USB port with the built in Ethernet Port, and the commands contain specific parameters for WiFi...this doesn't seem to be what I need...any ideas?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26714
Joined: Sat Jul 30, 2011 7:41 pm

Re: Using the Raspberry Pi as a bridge between USB and Ethernet

Fri Sep 15, 2017 8:45 pm

There are LOT of different ways USB can be used - do you know what protocol the USB on your device uses?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

skylab
Posts: 2
Joined: Fri Sep 15, 2017 7:55 pm

Re: Using the Raspberry Pi as a bridge between USB and Ethernet

Fri Sep 15, 2017 10:58 pm

I am really ignorant of USB Protocols, so I don't have an answer to that.
I *can* tell you that the device is normally used with a Windows Laptop, so it is not a 'Master' (assuming that there is a Master/not Master hierarchy in USB), and it is an off-the-shelf item (uBlox EVK-6T). It normally spews out NMEA sentences without any prompt or setup from supporting software, so, I am guessing that once USB does all of its protocol dancing, there should be text to forward...but maybe that preconception is just more ignorance on my part.

Heater
Posts: 16091
Joined: Tue Jul 17, 2012 3:02 pm

Re: Using the Raspberry Pi as a bridge between USB and Ethernet

Sat Sep 16, 2017 5:19 am

I'm pretty sure your GPS thing shows up as a serial port when plugged into a USB port. A COM port in Windows parlance.

You could use a program like ser2net to forward incoming data from the serial port to a network connection:
viewtopic.php?f=29&t=71617

Personally I would write a little program of my own to open and read from that serial port, parse the NEMA text strings from the GPS and make a network connection to where ever.

I'd do it using Javascript running under node.js. Its only a few tens of lines of code.
Memory in C++ is a leaky abstraction .

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Using the Raspberry Pi as a bridge between USB and Ethernet

Sat Sep 16, 2017 9:22 am

ser2net is most likely what the OP needs. It transports whatever is input into the serial port over a network
and vice-versa.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Return to “General programming discussion”