# Weird lp0 problem

## |Quantum|

Hello,

I've recently acquired a rather dated plotter device (Roland DG DXY-1100).

I reconfigured the parallel port in BIOS to standard (TRISTATE,SPP).

Now comes the weird part. The commands are not transferred like they should.

I put the device in copy mode (just echoing the characters as they come in, not interpreting any HPGL code.

in Windows, I can do for example:

```
ECHO ;IN; >LPT1:

```

The result on the device is correct:

 *DXY-1100 wrote:*   

> 
> 
> ;IN;

 

But when I do the equivalent for Linux:

```
echo ";IN;" >/dev/lp0

```

Then the result is like this:

 *DXY-1100 wrote:*   

> 
> 
> I;

 

Longer strings show the same kind of error:

```
echo "ABCDEFGHIJKLMNOP" >/dev/lp0

```

Result:

 *DXY-1100 wrote:*   

> 
> 
> BDFHJLNP

 

Nevertheless,

```
echo "ABCDEFGHIJKLMNOP" | od -x

```

reveiled a correct output.

I'm rather puzzled by this behaviour   :Confused:   Of course it speaks for itself that, under Linux, no single command is interpreted correctly and the device goes immediately in error or produces very strange results (usually plotting text on one single line over and over again).

Under Windows, everything works.

-Q-

----------

## nick_already_taken

Which linux kernel do you use? For example gentoo-sources or vanilla-sources?

----------

## |Quantum|

 *nick_already_taken wrote:*   

> Which linux kernel do you use? For example gentoo-sources or vanilla-sources?

 

Sorry, I forgot.

```
Linux Californium 2.6.31-gentoo-r6 #9 SMP PREEMPT Sat Feb 27 11:37:45 CET 2010 x86_64 AMD Athlon(tm) 64 FX-60 Dual Core Processor AuthenticAMD GNU/Linux

```

Standard Gentoo patched kernel!

[/code]

----------

## |Quantum|

Update: I also tried changing the codepage by setting LC_ALL to "C" or "POSIX", without success.

I use en_US.utf8 as default CP.

----------

## |Quantum|

So I've been tampering around with the modules while following the recommendations for debugging the parallel port in linux/Documentation/parport.txt and found out the following:

0) disabled CONFIG_PARPORT_PC_FIFO and CONFIG_PARPORT_1284

1) I cannot disable IRQ. So I went to the BIOS and set the parallel port to SPP, IRQ=0x378

2) removed all related modules (parport, parport_pc, ppdev, lp)

3) insmod parport.ko ; insmod parport_pc.ko irq=none dma=none

4) dmesg output: parport0: PC-style at 0x378, irq 7 [PCSPP(,...)]

5) rmmod everything again

6) insmod parport.ko ; insmod io=0x378 parport_pc.ko irq=none dma=none

 *dmesg wrote:*   

> parport 0x378 (WARNING): CTR: wrote 0x0c, read 0xff
> 
> parport 0x378 (WARNING): DATA: wrote 0xaa, read 0xff
> 
> parport 0x378: You gave this address, but there is probably no parallel port there!
> ...

 

After modprobe lp and catting anything to /dev/lp0, effectively nothing happens.

How is it possible that the code detects the parallel port at 0x378, but I cannot directly specify this IO port?!?

----------

