SerialPort error

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

    I have a perl script that complains about not being able to find
Device/ 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/test1.......ok 1/0# Using '/dev/ttyS1' as test
can't getattr: Input/output error at t/test1.t line 121
#   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.
# Looks like your test died just after 21.
        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED test 21
        Failed 1/21 tests, 95.24% okay
t/test2.......ok 1/46can't open file: ttyS1_test.cfg: No such file or
directory at t/test2.t line 90
        Test returned status 1 (wstat 256, 0x100)
DIED. FAILED tests 2-46
        Failed 45/46 tests, 2.17% okay
t/test3.......ok 1/159can't getattr: Input/output error at t/test3.t line
        Test returned status 1 (wstat 256, 0x100)
DIED. FAILED tests 7-159
        Failed 153/159 tests, 3.77% okay
t/test4.......ok 1/341can't open file: ttyS1_test.cfg: No such file or
directory at t/test4.t line 92
        Test returned status 1 (wstat 256, 0x100)
DIED. FAILED tests 2-341
        Failed 340/341 tests, 0.29% okay
Failed Test Stat Wstat Total Fail  Failed  List of Failed
t/test1.t    255 65280    21    1   4.76%  21
t/test2.t      1   256    46   89 193.48%  2-46
t/test3.t      1   256   159  305 191.82%  7-159
t/test4.t      1   256   341  679 199.12%  2-341
Failed 4/5 test scripts, 20.00% okay. 539/574 subtests failed, 6.10% okay.
make: *** [test_dynamic] Error 1
  /usr/bin/make test -- NOT OK
Running make install
  make test had returned bad status, won't install without force

    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.

    Suggestions will be very welcome.

Re: SerialPort error

Quoted text here. Click to load it

See the README file for the module:

  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/". 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

and then, after unpacking, do

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

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

                              Regards, Jens
  \   Jens Thoms Toerring  ___

Site Timeline