Morzilla has asked for the wisdom of the Perl Monks concerning the following question:
I Bought an usb-to-parallel port adapter (lsusb give me Bus 001 Device 002: ID 067b:2305 Prolific Technology, Inc. PL2305 Parallel Port), and Linux recognize it as /dev/usb/lp0
dmesg:now the problem: both the modules Device::ParallelPort::drv::parport and Device::ParallelPort::drv::linux that i tried in perl gave me this error for the first module:[ 35.125223] usblp0: USB Bidirectional printer dev 2 if 0 alt 1 prot +o 2 vid 0x067B pid 0x2305 [ 35.125307] usbcore: registered new interface driver usblp
and this for the second:Device::ParallelPort unabel to create driver parport (see Device::Para +llelPort::drv::auto for further information) - Failed to load partpor +t driver for /dev/usb/lp0 at (eval 1) line 3 at ./parportcontroller line 5
I Tried to hard code in the second module the device character file at line 68Use of uninitialized value in subroutine entry at /usr/local/lib/perl/ +5.10.0/Device/ParallelPort/drv/linux.pm line 68.
but this didn't work, the result is that my script doesn't set or get any bit from the parallel port. Here is my code:$this->{DATA}{BASE} = linux_opendev("/dev/usb/lp0");
and this is the result:#!/usr/bin/perl -w use Device::ParallelPort; my $port = Device::ParallelPort->new('linux'); if($port){ print "Bit 0: ".$port->get_bit(1)."\n"; $port->set_bit(1, 0); print "Bit 0: ".$port->get_bit(1)."\n"; } else { die "Errore sul driver\n"; }
The Device::ParallelPort::drv::parport module give me the error above. Someone can help me? Thanks, and sorry for my bad english XDUse of uninitialized value in subroutine entry at /usr/local/lib/perl/ +5.10.0/Device/ParallelPort/drv/linux.pm line 68. Bit 0: 1 Bit 0: 1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: use Perl With usblp Parallel Adapter
by almut (Canon) on Oct 03, 2009 at 12:05 UTC | |
by Morzilla (Novice) on Oct 03, 2009 at 13:04 UTC | |
|
Re: use Perl With usblp Parallel Adapter
by almut (Canon) on Oct 03, 2009 at 15:47 UTC | |
by Morzilla (Novice) on Oct 04, 2009 at 11:59 UTC | |
by almut (Canon) on Oct 04, 2009 at 12:31 UTC | |
|
Re: use Perl With usblp Parallel Adapter
by kikuchiyo (Hermit) on Oct 03, 2009 at 13:26 UTC | |
by Joost (Canon) on Oct 03, 2009 at 15:21 UTC |