Just another Perl shrine | |
PerlMonks |
Re^3: streaming of serial port data over ethernetby fmerges (Chaplain) |
on Nov 12, 2009 at 13:41 UTC ( [id://806725]=note: print w/replies, xml ) | Need Help?? |
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
In Section
Seekers of Perl Wisdom
|
|