Re: SerialPort error



H.K. Kingston-Smith <HKK-S@xxxxxxxxx> wrote:
I have a perl script that complains about not being able to find
Device/SerialPort.pm. I therefore tried to get it from the CPAN
repository; at the perl -MCPAN shell command line I typed

install Device::SerialPort

The code is downloaded and apparently built successfully, but on running
the tests I get the following:

running make test
PERL_DL_NONLAZY=1 /usr/bin/perl5.8.8 "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/01timing....ok
t/test1.......ok 1/0# Using '/dev/ttyS1' as test
port.
can't getattr: Input/output error at t/test1.t line 121
t/test1.......NOK
21
# Failed test in t/test1.t at line 121.

7: could not open port '/dev/ttyS1'. Are permissions correct?
# Looks like you failed 1 test of 21.

How do I get around this? I was attempting to install this module
as superuser; I don't think that permissions are an issue. Also, why is
it attempting to mess with /dev/ttyS1? I have just one serial port, which
is likely to be /dev/ttyS0.

See the README file for the module:

http://search.cpan.org/src/COOK/Device-SerialPort-1.002001/README

Run 'perl Makefile.PL' followed by 'make'. This will create install
files and directories. Run 'make test' with nothing connected to
"/dev/ttyS1". This will run the tests and create a configuration
file. You can specify a different port to test via
'perl Makefile.PL TESTPORT=<DEVICE>'. Makefile.PL creates
"t/DefaultPort.pm". You can also specify an alternate port with the
Shell Variable "Makefile_Test_Port".

I don't know if it was a wise decision by the author to use
/dev/ttyS1 for testing, but that's the way it is. I don't know
if it's possible to set a different test port for the CPAN
install, the simplest approach may be to download the module
from

http://search.cpan.org/src/COOK/Device-SerialPort-1.002001/SerialPort.pm

and then, after unpacking, do

perl Makefile.PL TESTPORT=/dev/ttyS0
make
make test
make install

Of course, do the last step only if the tests don't fail;-)

Regards, Jens
--
\ Jens Thoms Toerring ___ jt@xxxxxxxxxxx
\__________________________ http://toerring.de
.



Relevant Pages

  • Re: Installing DBD::File via CPAN
    ... Do you use 'UNINST=1' in the build options for CPAN? ... >> Did you build Perl from source, or install via a RPM or binary distro? ... >>> sender of the delivery error by replying to this message, or notify us ...
    (perl.dbi.users)
  • RE: Installing DBD::File via CPAN
    ... Subject: Installing DBD::File via CPAN ... This is Perl 5.8.7 ... ReadLine support available (try 'install Bundle::CPAN') ...
    (perl.dbi.users)
  • Installing DBD::File via CPAN
    ... This is Perl 5.8.7 ... cpan shell -- CPAN exploration and modules installation ... ReadLine support available (try 'install Bundle::CPAN') ...
    (perl.dbi.users)
  • RE: Installing DBD::File via CPAN
    ... I built this directly from source. ... > Did you build Perl from source, or install via a RPM or binary distro? ... > CPAN module so I wasn't expecting to get myself confused with multiple ...
    (perl.dbi.users)
  • installation of dbi for solaris 9 fails
    ... # perl -MCPAN -e shell ... cpan shell -- CPAN exploration and modules installation ... cc: Perl.c: linker input file unused because linking not done ... install seems impossible ...
    (perl.dbi.users)