Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: streaming of serial port data over ethernet

by fmerges (Chaplain)
on Nov 12, 2009 at 13:41 UTC ( [id://806725]=note: print w/replies, xml ) Need Help??


in reply to Re^2: streaming of serial port data over ethernet
in thread streaming of serial port data over ethernet

Hi,

Ok, just read in wikipedia about this NMEA 0183, and it seems to be just one direction communication, from the device to listener(s), so I assume no commands are sent to the device to control it or change settings, right?

This accept and display information in cutecom I would forget it, it even doesn't make sense anymore, as you're not connecting on the remote PC to a serial, instead you going to read on a socket to receive data.

You can write a simple server using either TCP or UDP, and then the remote client connect to it to get pushed the telemetry data.

For reading from the serial (via the module), you have to read data and split it in chunks or messages using the message delimiters of the protocol which are $ and &.

If you want to make something more sophisticated you could think about writing the server using POE, so you would use the TCP server component and create a session that uses the code you write for reading from the serial. Or for example you could use something like spread, have a central server, and then have on each instrument you have a simple script that reads from serial and sends it to the Spread server, whoever wants to listen to that communication connects to the Spread server and reads from the channel(s).

Using a TCP server you can use telnet to test it out, in case of Spread you can use spuser, in any case you can write a simple script that connects and read and dumps the data.

What option fits best for you, is based on your requirements, also taking in mind, how many devices you want to read from, etc etc etc. Anyway apply KISS.

Update: checkout also Net::Daemon it might simplify things for you.

Regards,

fmerges at irc.freenode.net
  • Comment on Re^3: streaming of serial port data over ethernet

Replies are listed 'Best First'.
Re^4: streaming of serial port data over ethernet
by amazon (Initiate) on Nov 13, 2009 at 03:37 UTC
    thanks for the info fmerges. You have been a big help

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://806725]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-19 21:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found