Click here to get back home

SerialPort error

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
SerialPort error H.K. Kingston-Smith 07-07-2007
`--> Re: SerialPort error Jens Thoms Toer...07-13-2007
Posted by H.K. Kingston-Smith on July 7, 2007, 10:58 pm
Please log in for more thread options


        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.
# Looks like your test died just after 21.
t/
test1.......dubious
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
t/
test2.......dubious
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
150
t/
test3.......dubious
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
t/
test4.......dubious
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.


Posted by Jens Thoms Toerring on July 13, 2007, 1:15 pm
Please log in for more thread options


> 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@toerring.de
\__________________________ http://toerring.de

Similar ThreadsPosted
hiding Win32::SerialPort->start( ... ) error messages April 19, 2005, 2:27 am
Need help with Win32::SerialPort August 13, 2004, 5:43 am
need help with "SerialPort" module April 25, 2006, 11:34 pm
help on win32::serialport June 4, 2007, 5:12 pm
Please help on win32::serialport July 13, 2007, 12:41 pm
SerialPort write question October 28, 2004, 11:52 am
Serialport Read question October 28, 2004, 11:59 am
Loopback with Device::SerialPort? March 18, 2005, 1:24 pm
problem with Device::SerialPort November 30, 2005, 4:19 pm
lookfor failure in SerialPort November 30, 2005, 4:56 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap