Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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

Replies are listed 'Best First'.
Re: Connecting to remote tty
by Loops (Curate) 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1044872]
Front-paged by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (1)
As of 2018-05-22 21:56 GMT
Find Nodes?
    Voting Booth?