Reputation: 11
My dell laptop has an internal GPS card that outputs NMEA GPS info over COM 4. I want to capture the COM4 traffic and send it to a USB port, then connect the USB port to a NMEA compatible device (a VHF radio). I will be using .NET to capture the data and route it to the USB port, unless there is already a utility/driver that does this.
So I have a few issues:
I think it should be fairly straight forward to capture the COM port data, and so the problem is sending it to a USB port - which leads to my next problem
NEMA devices use 2 wires, I suppose this will correspond to the data + and data - of the USB, so I think I could wire that up myself.
So... what is required to relay COM data to an USB port using .NET
and... will my plan for wiring the USB cable work (electrically, I mean)
Do it sound like I'm on the right track? I wonder if a utility like this already exists, it seems like a common need, convert hardware generated com port data to usb.
Any advice welcome!
Upvotes: 1
Views: 1674
Reputation: 1053
It would help to know what model your VHF radio is. Usually VHF radios receive NMEA input through a serial port on the radio, but it's often not labelled as such, with names like "ground" and "nmea in". The USB is sometimes for outputting NMEA (and creates a virtual serial port on your laptop) or for controlling the radio using your laptop with custom software that came with the radio.
If your radio actually has the standard NMEA input lines, and your laptop has a real COM4 port then you need to connect the correct wires from the COM port to your radio - http://en.wikipedia.org/wiki/Com_port tells you which wire is which for your laptop, and you want to connect latop:tx to radio:NMEA in and laptop:rx to radio:NMEA out. And make sure the baud rates are the same for the two devices (4800 used to be default for NMEA, but it can be 9600 or 36400 or even higher these days).
But the COM4 GPS port on your laptop is probably a virtual port. In this case you need to redirect it to a real port if you have one (e.g. COM1), or buy a "USB to serial converter" (search for that phrase on google) and redirect COM4 to that. Then the wiring job is the same. But redirecting is going to be tricky - there is software out there.
And if your radio genuinely expects to receive NMEA over USB, then either it should come with software that asks you which serial port you want it to connect to - so then you select COM4 (this is by far the simplest scenario). Or it might create its own virtual serial port when you plug in the USB cable. You're probably running Windows, so check on the Device Manager in Control Panel under Ports (COM &LPT) when you plug it in to see if a new serial port appears, and what it's COM number is. And then you need some software to connect the two virtual ports together.
As for all the redirect and virtual port software that I mention - theres com0com which is freeware, and eltima.com who sell serial port software. You might be able to find other stuff out there. Or you have to learn about low level serial port driver programming, which is likely to be tricky. Good luck.
Upvotes: 0
Reputation: 4163
With USB you do not have direct access to the tx/rx wires of the physical port like you do with a COM port. Your device would need to actually support USB. It is possible to buy a USB->serial dongle which would present itself as another COM port. Then it would be fairly trivial to copy the data from one COM port to another.
Upvotes: 0