controlling parallelport via cgi (perl + apache)

controlling parallelport via cgi (perl + apache)

Post by xochipill » Tue, 24 Dec 2002 04:36:05



Hy to all readers,..
I'm trying to control the parallelport of my Server, running SuSE linux 7.3
professional, with perl cgi scripts running on a apache webserver. To access
the parport device i succsessfully installed the device::parallelport and
the device::parallelport::parport modules from CPAN. i also gave the rights
to the webuser to access the /dev/parport0

with
    use Device::ParallelPort;
    my $port = Device::ParallelPort->new(parport:0);
i got the handle for the first parallel port.

First i set and deleted some bits with
    $port->set_bit($bitnr, $value);     # $bitnr= 0 - 23   $value= 0 or 1
the first byte (8bits 0-7) is the statusbyte (379h), the second byte (bits
8-15) is the controlbyte (37Ah), and the third byte is the data byte (379h).

and read the status of some bits with
    $value=$port->get_bit($bitnr);
this worked fine at the first tries,...
but then i wrote a little perl script which read the status of all bits and
give links to set and unset them, and i recognised, when i set a bit in the
databyte sometimes an other bit (in the data byte) also will get set or
unset,...
i can't find an answer to this,..
What am i doing wrong?
u can take a look at http://xochipilli.getmyip.com/cgi-bin/paralell/index.pl
PLS help me,..

wfr
    xochipilli

 
 
 

1. sigsegv by process started via bourne shell by perl cgi script on apache

Hi Everyone!
Our project runs Apache Server 1.3.12 on a Unixware 7.1.1 server.  I am
trying to add a web-based front end to some legacy code.  

When the user clicks "Activate" on our Web page, a perl cgi script uses
a "system" call to call a shell script.  This shell script in turn launches
several processes (written in C and C++).  The processes are launched but then die
with a segmentation violation.

If I call the perl script directly, there is no problem.  If I call the shell
script directly there is no problem.

The binaries that get launched are not within the directory sub-tree of the Web page.
Could I fix the problem by moving all of the binaries under the Web page directory?

Thanks.
Tom Keeler

2. USB Kensington Cam (SE401)

3. RedBaron and Perl CGI via Apache

4. Multifile data manipulation

5. cgi-post via perl

6. UUCP over PPP / Linux 1.1.93

7. can't access file via Perl CGI script

8. test

9. Apache 1.3.14 / Netware Perl/CGI PROBLEM, Please help!

10. Help with apache, perl, and cgi

11. Apache 0.6.5 problems with perl cgi scripts

12. coherence perl-cgi-script / apache / ressources

13. Redirect cgi (perl) scripts using Apache 0.8.14