I need to get data from a serial device (a weather station) over our network where it'll be processed by a Unix host (using custom software). I was able to compile remserial which makes the remote serial device act like a tty. Remserial was designed for Linux but should work on OS X (which I'm using) and FreeBSD.
What is not clear to me, though, is if a serial-to-ethernet adapter or serial server uses some sort of standard protocol for how it communicates via a network socket, or if every brand is different. More to the point, can I buy any serial-to-ethernet adapter and expect remserial to work with it, and if not, are there any you'd recommend (or other pieces of software glue I should consider)?
-
No. One device from some vendor will not be compatible with another vendor. Who knows what their low-level protocols are like, but there's nothing like a standard that I am aware of.
I'm not sure if I understand the scenario though... in what case is a long serial cable not long enough (assuming 9600 baud) but a ethernet cable that can be what, 100 meters, is long enough?
Clinton Blackmore : The idea is to use our existing network. Then all I have to do is find a network drop anywhere in the (school) building and a connection can be established. [I need not worry about wire lengths or putting in new wiring as the network is known to work.] Mind you, I didn't realize that a serial cable could go 100 feet. With a cable like that, some help from the maintenance department, and a USB-to-Serial adapter, I should be good to go.John O : Well, first confirm that 9600 baud is acceptable. If so, I think the maximum is generally around 50ft. If you buy high quality specialty cables, 150ft might be reachable. These will not be cheap, and will be in the $100 range, I think. Many of the weird devices I've hooked into here lately all seem to default to 56700 or even 115200. Many aren't configurable for lower speeds. As it happens, I actually work for a company that sells weather stations... so that was a bit strange to read you mention such.Clinton Blackmore : @John Interesting. Most of the console dataloggers from the company I have in mind are designed for a USB connection, but I want to go with the serial datalogger as the group who recommended it has developed custom software for it (most notably, they are aggregating information from multiple sites). I suppose for extra money we could get a wireless console, a wireless datalogger, and repeaters, but the roof of the building is full of metal are will probably act like a Fermi cage.From John O -
There aren't standards for remote serial port forwarding control protocols that I know of, but most serial terminal server devices offer a bare-bones "raw" mode that simply moves data in and out of the serial port w/o any control mechanism.
The remserial documentation says:
The network connection passes data as-is, there is no control protocol over the network socket.
There is no protocol, then, on the remserial side. On that basis, you should be able to locate a serial terminal server / "Ethernet to serial" device that offers such a "raw" capability and you'll be fine.
I used to use the IOLAN serial terminal servers years ago. It looks like they're still available, and the IOLAN DS1 model will probably do what you want. Reading thru the manual, it looks like the "Serial Tunneling Profile" would probably do waht you need.
Clinton Blackmore : That's heartening to hear, and fascinating, too, as I have asked for a quote on one model before asking this question here, and that was the one. I gather that it comes with 60-days of free support and that I can return it if it doesn't work in my environment. (All that said, I didn't want to go through multiple iterations to get something that would work.) Thank you.Clinton Blackmore : I went with the Perle IOLAN DS1. It has a ton of options -- their TruePort socket protocol, raw sockets over TCP, raw sockets over UDP, a tunneling protocol, and several other options I would never have dreamed of. After setting the IP address (and do that initially on a /24 subnet; my /23 made life needlessly difficult), I set it to use the raw TCP sockets. Then I can run `/remserial -r 192.168.1.249 -p 10001 -l weatherstation_device /dev/ptmx` and `./vproweather -x weatherstation_device` -- the first creates a symlink to a pseudo-tty and the second talks to it.Evan Anderson : @Clinton Blackmore: Glad to hear that worked out well for you. I always really liked the IOLAN products back when they were "Chase IOLAN" devices. They seem to make a reliable, flexible, and very functional product.From Evan Anderson
0 comments:
Post a Comment