Anyone using php_serial.class.php with USB serial port?

jim cinetron-uEvt2TsIf2EsA/PxXw9srA at public.gmane.org
Fri Apr 4 03:19:38 UTC 2008


> > > Below is the file I'm using to try to get it to work. Attached is the
> > > class file. 
> > > 
> > > <?php
> > > include "php_serial.class.php"; 
> > > 
> > > 
> > > {
> > > // Let's start the class
> > > $serial = new phpSerial;
> > > 
> > > // First we must specify the device. This works on both linux and
> > > windows (if
> > > // your linux serial device is /dev/ttyS0 for COM1, etc)
> > > $serial->deviceSet("/dev/ttyUSB0"); 
> > > $serial->confBaudRate(9600); //Baud rate: 9600
> > > $serial->confParity("none");  //Parity (this is the "N" in "8-N-1")
> > > $serial->confCharacterLength(8); //Character length (this is the "8" in
> > > "8-N-1")
> > > $serial->confStopBits(1);  //Stop bits (this is the "1" in "8-N-1")
> > > 
> > > // Then we need to open it
> > > $serial->deviceOpen();
> > > 
> > > // To write into
> > > $serial->sendMessage("Hello !"); 
> > > 
> > >  
> > > 
> > > }
> > > 
> > > 
> > > ?>
Strange I discovered that if I run this from the command line as root it
works. If I start Firefox even as root and run the program from the
browser I get the error ..

Warning: Specified serial port is not valid
in /usr/share/php/php_serial.class.php on line 111

I tried changing permissions on the file to give permissions to anyone
to execute and you still have to be root in the command line to make it
run properly and it still won't run via the browser. Any idea whats
going on here?
jim

--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list