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).
|
|---|