Lucian Daniliuc | 3 Mar 11:55 2003
Picon

[PARPORT] Problem with aquiring port (ioctl()) ?

It seems that something on my system is sending information to the
parallel port because, although i use ioctl to get access to the port, i
still get (using LED's connected to the h/w port) activity besides the
data that i am sending.

My question is how to make the parallel port 'quiet' (like in DOS/Win' for
example) because i need to connect some user-made device to it and contol
it correctly ???

My kernel is 2.4.18

P.S. I have tried compiling some kernels that:
 - had no support whatsoever except for keyboard and console (and, of
course, no parallel port related support);
 - had everything installed at least as a module (including parport and
ppdev);

and i still didn't get any results... it seems activity on the port
appears before the actual system boot, during the kernel.

Please help if you can as using linux to control the parallel port is very
important to me.

----------------------------
ataraxis <at> disponibil.net
lucian <at> psdtimis.ro
0740.959.300

--  To unsubscribe, send mail to: linux-parport-request <at> torque.net --
--  with the single word "unsubscribe" in the body of the message. --
(Continue reading)

Tim Waugh | 3 Mar 11:34 2003
Picon

Re: [PARPORT] Problem with aquiring port (ioctl()) ?

On Mon, Mar 03, 2003 at 12:55:20PM +0200, Lucian Daniliuc wrote:

> It seems that something on my system is sending information to the
> parallel port because, although i use ioctl to get access to the port, i
> still get (using LED's connected to the h/w port) activity besides the
> data that i am sending.

Which ioctls are you using, and on what device node?

Tim.
*/
Lucian Daniliuc | 3 Mar 13:47 2003
Picon

Re: [PARPORT] Problem with aquiring port ?


>
> Which ioctls are you using, and on what device node?
>
> Tim.
> */

I have been confusing some things... i wasn't using ioctl but instead i
used ioperm() to get permission to 0x378, 0x379, 0x37A.

What could be the problem?

----------------------------
http://ataraxis.home.ro
ataraxis <at> disponibil.net
lucian <at> psdtimis.ro
0740.959.300

--  To unsubscribe, send mail to: linux-parport-request <at> torque.net --
--  with the single word "unsubscribe" in the body of the message. --

Tim Waugh | 3 Mar 14:22 2003
Picon

Re: [PARPORT] Problem with aquiring port ?

On Mon, Mar 03, 2003 at 02:47:10PM +0200, Lucian Daniliuc wrote:

> I have been confusing some things... i wasn't using ioctl but instead i
> used ioperm() to get permission to 0x378, 0x379, 0x37A.
> 
> What could be the problem?

You would be better off using ioctls on /dev/parport0; that way you
get to claim the port to prevent anything else using it.

Even better would be to use libieee1284 if your project license allows
it.  Then you get to run the same code on other platforms too.

Tim.
*/
Ramón Suárez Alvarez | 4 Mar 18:11 2003
Picon

Re: [PARPORT] Bidirectional access to parallel port (JAVA)

It doesn't work.

If I try to set EPP mode, an exception is thrown.

If I try to access to the FileInputStream, an exception is thrown.

Looking in the sun help, only Error and buffer empty events have sent. Like
in Windows platform. I am not be able to read anything from the parallel
port.

I am continuing investigation.

Thank you.

----- Original Message -----
From: "Andreas Fester" <Andreas.Fester <at> eigner.com>
To: "Ramón Suárez Alvarez" <rsuarez <at> dynasty.es>; <linux-parport <at> torque.net>
Sent: Tuesday, February 25, 2003 4:43 PM
Subject: Re: [PARPORT] Bidirectional access to parallel port (JAVA)

> Hi Ramón,
>
> you could use the Java Communications API
> (http://java.sun.com/products/javacomm/), but SUN only provides
> drivers for Solaris and Windows. Maybe this package helps:
> http://mavnet.dynip.com/doc/packages/IBMJava2-JAVACOMM/docs/
>
> I have not tried it though, but it sais that it supports
> IEEE1284 parallel ports.
>
(Continue reading)

Lucian Daniliuc | 5 Mar 18:20 2003
Picon

[PARPORT] Problem with hardware aquiring port

I just cannot get exclusive access to the parport, there still seems to be
some noise getting out the parallel port pins.

I used ioctl(), in the following piece of code:

/*
 * User-space parport hogger (for stress-testing parport).
 *
 * Copyright (c) 1998 Tim Waugh <tim <at> cyberelk.demon.co.uk>
 */

#include <time.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/ppdev.h>

int main (int argc, char * argv [])
{
	int p;
	/* Check we've been told which device to open */
	if (argc < 2) {
		fprintf (stderr, "Hog which parport???\n");
		return 1;
	}
	/* Open the device */
	p = open (argv[1], O_EXCL);
	if (p < 0) {
		fprintf (stderr, "Couldn't open %s\n", argv[1]);
(Continue reading)

Tim Waugh | 5 Mar 17:18 2003
Picon

Re: [PARPORT] Problem with hardware aquiring port

On Wed, Mar 05, 2003 at 07:20:23PM +0200, Lucian Daniliuc wrote:

> I don't get any error, everything works fine, but even after aquiring the
> port in EXCLUSIVE mode, i still get signal noise or something out of the
> parallel port.

Even if you never release the port?

Tim.
*/
Nate Jenkins | 5 Mar 18:20 2003

Re: [PARPORT] Problem with hardware aquiring port


Maybe I do not understand what you are trying to do...

Why do you need to call open this way?
p = open (argv[1], O_EXCL);
Doesn't the later call give you exclusive access to the port?
ioctl (p, PPCLAIM, 0);

If you are trying to read and write to the port, then wouldn't you need to
call open differently?  Or does that flag mean all privileges?

Why are you doing opens and claims inside of loop?  Should you not do the
exclusive claiming prior to loop and then if success, do the work inside the
loop?

Nate

----- Original Message -----
From: "Lucian Daniliuc" <lucian <at> psdtimis.ro>
To: <linux-parport <at> torque.net>
Sent: Wednesday, March 05, 2003 9:20 AM
Subject: [PARPORT] Problem with hardware aquiring port

> I just cannot get exclusive access to the parport, there still seems to be
> some noise getting out the parallel port pins.
>
> I used ioctl(), in the following piece of code:
>
> /*
>  * User-space parport hogger (for stress-testing parport).
(Continue reading)

Lucian Daniliuc | 6 Mar 10:23 2003
Picon

Re: [PARPORT] Problem with hardware aquiring port

no success even if i never release the port.

if i write data to the port, it seems it gets there but just for a very
short period of time.

maby some speed settings are set (some bus clock) somewhere in the kernel
that does that?

>
> Even if you never release the port?
>
> Tim.
> */

----------------------------
ataraxis <at> disponibil.net
lucian <at> psdtimis.ro
0740.959.300

--  To unsubscribe, send mail to: linux-parport-request <at> torque.net --
--  with the single word "unsubscribe" in the body of the message. --

Lucian Daniliuc | 6 Mar 10:18 2003
Picon

[PARPORT] Problem with hardware aquiring port

>
> Why do you need to call open this way?
> p = open (argv[1], O_EXCL);

i used open that way after NOT succeeding with the normal way:
open(argv[1], O_RDWR);

> Doesn't the later call give you exclusive access to the port?
> ioctl (p, PPCLAIM, 0);
>

well, in software, it does, but there still is some piece of code (VERY
likely the kernel) that writes  pieces of information to the hardware
parallel port, according to some uses of my computer (keyboard typing,
harddrive access etc - i don't know exactly which actions trigger this).

I checked this using LED's connected to every pin (or some pins) of the
parallel port.

> If you are trying to read and write to the port, then wouldn't you need
> to call open differently?  Or does that flag mean all privileges?

i tried O_RDWR.

>
> Why are you doing opens and claims inside of loop?  Should you not do
> the exclusive claiming prior to loop and then if success, do the work
> inside the loop?

i didn't tried that yet (and i will as soon as i get home), but that nice
(Continue reading)


Gmane