in reply to can't open ttyS0 with Device::SerialPort

I would first check to see if you can just open /dev/ttyS0:
open(T, "</dev/ttyS0") or die "unable to open for reading: $!\n"; open(T, ">/dev/ttyS0") or die "unable to open for writing: $!\n"; open(T, "+</dev/ttyS0") or die "unable to open for read-write: $!\n";

I just did a cpan Device::SerialPort on my Ubuntu system, and your code worked just fine. It seems that the owner and group for /dev/ttyS0 are set up to user=root, group=dialout. If these are restored when the box is power-cycled, just make sure that the process running the script has 'dialout' in its set of groups (you can use the 'groups' command to help you determine this.)

HTH!

Update: corrected read-write open call.

Replies are listed 'Best First'.
Re^2: can't open ttyS0 with Device::SerialPort
by Bruce32903 (Scribe) on Apr 03, 2008 at 22:42 UTC
    In only and out only do not post any error messages. The ">+" attempt produces a "no such file or directory" error.

    Thanks,
    Bruce
      Sorry, the read-write open call should be open(T, "+</dev/ttyS0").