[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Sheflug] Connect to remote serial port via TCP - help anyone?
On Mon, 2009-06-29 at 12:47 +0100, Stephen.Tozer-Loft@xxxxxxxxxx wrote:
> Dear All,
>
> This can't be that difficult, in fact I feel it must be very easy, but
> it's a part of linux I'm a total novice in (one of many).
>
> I have a device (barometer VAISALA Barcop PTB330) which is attached via
> a serial port to a 'RS232 single port device server' (Patton Model 2232)
> to make it available via LAN.
>
> All configured and working - I can connect to it and get readings from a
> Windoze computer by setting the device server up as a COM port using
> serial redirection software. But I'm struggling to connect to it from
> our linux server.
>
> (Ideally from perl) I'd like to be able to make a connection to the
> remote IP address and port at which the barometer is communicating, to
> make linux think it's a real local serial port, then use perl to
> collect, graph, and webserve the data.
>
> Any ideas how I set this up? Linux is Centos 5.
Hi Steve,
Why not collect, graph and webserve the data directly from the
perl-initiated TCP connection? I'm pretty sure that'd be easier than
trying to figure out how to open a tcp connection then create a pseudo
serial port to "pretent to be the one on the barometer". I'm assuming
here that the single port device server offers the data up raw on an
IP/port and that you can simply read the data as it comes down the line
and send your commands in raw text or similar.
I've not initiated raw tcp connections with perl, though I'm sure you
should be able to find tutorials. IO::Socket would be a good start.
I've not really answered your question, I'm afraid but I hope that's
helpful.
best regards,
Seb James
--
William Matthew Limited
Direct Line: +44 (0)845 4580277
_______________________________________________
Sheffield Linux User's Group
http://sheflug.org.uk/mailman/listinfo/sheflug_sheflug.org.uk
FAQ at: http://www.sheflug.org.uk/mailfaq.html
GNU - The Choice of a Complete Generation