HOWTO - Serial to IP Conversion

There's often a need to get a serial microcontroller or sensor device (GPS, range sensor, etc) that have serial connections onto an IP network. In order to do that though you have to convert serial to an IP data stream. Fortunately, there's a lot of highly integrated, functional modules that can help.

I built a simple and cheap serial to TCP/IP converter using a LANtronix XPort Direct module. Parts cost of this is about $40. Here's a picture of the prototype:

Pasted Graphic 2

For testing purposes, I put a header on a RS232 level converter so I had an easy way to drive it. The Lantronix device has a 2 X 12 2mm header on it, so I cut some slots in a perf board to use as a platform, wire wrapped an adapter cable to attach to a normal 0.1" header and just temporarily attached the module's perfboard to a second base perf. I added a 3.3V regulator (Microchips MCP1827S, low drop-out) for running standalone (vs running off a microctroller's p.s., though the latter is an option, obviously.)
 
I jacked it all in....it comes up using DHCP to start with so I figured out the address from my firewall/dhcp server, then telnet'd to its setup port:
 
telnet 192.168.5.165 9999
 
Through some config menus, I setup the baud rate for 115200,8N1 and connected to that port with Zterm on my Mac (via a keyspan usb to serial adapter).
 
I telnet'd to the data port of the device:
 
telnet 192.168.5.165 10001
 
After I connected to 10001 I could pass keystroke data back and forth between the serial terminal and the telnet session. On the telnet side, by default it sent data only after a CR, but I noticed there were some flush buffering options in the config menu which I'll play with to hopefully set it to send on a per-byte basis so binary serial protocols could be used.

To attach a GPS, I can just pull the level converter off the header and wire in the GPS on the same board.

There's not much soldering - mostly connections to wire headers together and run power:
Pasted Graphic 3

The Lantronix Xport direct module above can be setup to create outgoing socket connections, so it's not necessary to initiate a connection to it to get data out of it. You can set up default gateways, static IPs, connection lists, and other TCP type things with its config menu, so it seems like a pretty functional TCP device. Theoretically it can support up to a 230kbs serial connection.

Pasted Graphic 4

You can see the Lantronix module has a green link light on the right side of the socket. There's a yellow activity light on the left side, so it has very standard and expected status indicators on it out of the box. The module does have a status pin you can pull from if you want to feed it to a micro or use it for some other reason.
 
The module was about $37 from Mouser, so it makes for an incredibly cheap embedded serial to ip converter.
 
I have the LANtronix Matchport is which is similar type of device for serial to wifi connections. Though larger, most of the specs are similar. Of course it's more complicated in that it has all the WPA/WEP encryption layers and SSIDs to associate with, etc. With that device you can give it a list of SSIDs to associate with or let it attach to any. It's WPA isn't quite as capable as what I would like in that it uses a shared key vs what I did for the 360VL-M4 with full certs.
 
I'm going to wire up a prototype serial to Wifi converter with the Matchport next. I wanted to start with the simpler device first.
 
I thought I would also try an XBee Pro as the serial device - could easily make an XBee to ethernet bridge or an XBee to Wifi bridge this way.
 
One of these days I'm going to try my first PCB with something simple like this and start working on those skills and process.
asdfasdf