The GP3 is perfect if you want to control or sense the real world from a PC. But the RS232 connection (or USB connection) means that you have to be right next to the part of the world you want to sense, right? Wrong! In this article I'll show you how to use open source tools to connect to a remote PC with a GP3 attached and take control of it. You can use this technique with any of the GP3 libraries or the GP3EZ software.
The basic idea is that we will use com0com, an open source project to create a TCP "server" connected to the GP3's com port. Then we'll use com0com to make a pair of fake ports on the remote PC. One of these fake ports will connect to the GP3 software you want to use. The other fake port will connect to a network client that talks to the server. It sounds more complicated than it is. You need to download com0com and com2tcp from Sourceforge. You might as well install both programs on your client and server machines, although you could get by with just com2tcp on the server if you like.
There is a pretty detailed setup document available, so I won't repeat it step by step. However, here's the basic steps you'll follow (remember, the server has the GP3 connected to it; the client is the remote machine where you want to run the software):
The setup for the ports ought to look like this:
Notice the boxes near the top that say COM90 and COM91? That's where you rename the ports. I checked a few of the boxes, but they aren't strictly required. If you let your mouse float over them in the setup program you can read what they do. The com0com software is pretty powerful. You can reroute handshaking signals using this dialog but the defaults are perfect for what we want to do.
That's it! You can now remotely sense temperatures, operate valves, or do anything else you can do with a GP3 over the network.
Site contents © 1997-2012 by AWC, 310 Ivy Glen, League City, TX 77573 (281) 334-4341