I am trying to communicate with a embedded system using a communication port COM0 which is ttyS0 in linux. I tried another software on Windows and it seems to be able to communicate properly with the port. I tried using this code, but right at the very first line I get an error.
use strict;
use warnings;
use Device::SerialPort;
die "Cannot Open Serial Port\n" unless my $PortObj = new Device::SerialPort ("/dev/ttyS0");
Also is there another easier way to communicate with the serial port.
It looks like you need code that looks like this:
Note, I do not know if
com1is the right serial port for your code, but I think you need something like that. If you have many more platforms you need to deal with a hash may be a better option: