Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

in below script i am able to conect one device but i am trying to connect another device with different USB and its not happening need help

use Device::SerialPort; use Data::Dumper qw(Dumper); my $port = Device::SerialPort->new("/dev/ttyUSB3"); $port->baudrate(115200); # Configure this to match your device $port->databits(8); $port->parity("none"); $port->stopbits(1); $port->lookclear;

Replies are listed 'Best First'.
Re: how to connect two DUT console in script
by hippo (Archbishop) on Jun 28, 2018 at 08:36 UTC
    its not happening

    That's an insufficient description of the problem, I'm afraid. You've shown the code which works, but not the code which doesn't. Nor have you explained in which way it isn't "happening".

    Try the Basic Debugging Checklist, perhaps?

      <> use Device::SerialPort; use Data::Dumper qw(Dumper); my $port = Device::SerialPort->new("/dev/ttyUSB3"); my $port1 = Device::SerialPort->new("/dev/ttyUSB2"); $port->baudrate(115200); # Configure this to match your device $port->databits(8); $port->parity("none"); $port->stopbits(1); $port->lookclear; $port->write("date\n"); $port1->write("date\n"); === not working need help </code>
        use Device::SerialPort; use Data::Dumper qw(Dumper); my $port = Device::SerialPort->new("/dev/ttyUSB3"); my $port1 = Device::SerialPort->new("/dev/ttyUSB2"); $port->baudrate(115200); # Configure this to match your device $port->databits(8); $port->parity("none"); $port->stopbits(1); $port->lookclear; $port->write("date\n"); $port1->write("date\n"); === not working need help