Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Connecting to remote tty

by laozi (Novice)
on Jul 17, 2013 at 18:28 UTC ( #1044872=perlquestion: print w/ replies, xml ) Need Help??
laozi has asked for the wisdom of the Perl Monks concerning the following question:

i am developing a test automation host which is currently connected to 10 embedded controllers via serial ports (/dev/ttyS*) to speed up the testing i wish to add more host and enable them to also talk to the controllers. However the controller must remain connected to the first host. the entire test automation software is written in perl so i am looking for a perl based solution. i am currently using Device::SerialPort to talk to the controllers. until now it did the work just fine is there a way using Device::SerialPort to connect to tty devices on a remote machine if not is there a similar perl module which can do that Thanks in advance

Comment on Connecting to remote tty
Re: Connecting to remote tty
by Loops (Hermit) on Jul 17, 2013 at 19:31 UTC

    Some quick searching doesn't reveal any direct CPAN support for connecting to remote tty devices. You could cobble together your own solution any number of ways. One Linux utility that should do the trick easily is 'socat'. Check out the brief instructions here. This would allow Device::SerialPort to talk to a local pty device without knowing everything was being redirected to the remote tty device.

    If this works for you, wrapping it all up in a Perl module so that you can easily initiate a connection and even start the remote daemon (via ssh say) would be relatively straightforward.

      Thanks !

      looks like it will do the job

      BTW - i noticed the following init option in Decive::SerialPort
      $PortObj->hostname('localhost'); # for socket-based implementations
      $PortObj->hostaddr(0); # false unless specified

      does it mean some support is allready present in Decive::SerialPort ?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1044872]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (15)
As of 2014-07-31 20:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (252 votes), past polls