Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: use Perl With usblp Parallel Adapter

by almut (Canon)
on Oct 04, 2009 at 12:31 UTC ( [id://799101]=note: print w/replies, xml ) Need Help??


in reply to Re^2: use Perl With usblp Parallel Adapter
in thread use Perl With usblp Parallel Adapter

I tried to change "lp0" in this->{DATA}{DEVICE} to "/dev/usb/lp0", but nothing changed...

As I said, that value is only ever being used in an error message. The purpose behind setting it was just to silence the warning...

I think that my usb adapter is not so compatible with Linux or maybe it's not a really usb to parallel port adapter...

Either that, or it isn't mapped to the I/O address 0x378 (which is hardcoded in Device::ParallelPort::drv::linux::linux_opendev() ).  The code in question is:

... base = 0x378; if (ioperm(base, LPSIZE, 1) < 0) { fprintf(stderr, "%s: ioperm:%s ", devname, strerror(errno) +); RETVAL = -1; } else { RETVAL = base; }

ioperm(2) can only fail with

EINVAL Invalid address(-range). EPERM The calling process has insufficient privilege. ENOMEM Out of memory. EIO This call is not supported (on PowerPC).

In particular, no checks are being made that the address actually maps to the intended hardware device.

You might want to check your dmesg output — mine, for example, says:

[ 61.718702] parport_pc 00:0b: reported by Plug and Play ACPI [ 61.718797] parport0: PC-style at 0x378, irq 7 [PCSPP,TRISTATE] [ 63.870838] lp0: using parport0 (interrupt-driven).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://799101]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2024-04-23 09:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found