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

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Thu Apr 3 19:45:49 UTC 2008


On Thu, Apr 03, 2008 at 03:41:54PM -0400, jim wrote:
> 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/USB0");

Should that be /dev/ttyUSB0 perhaps?  I have never seen a system name it
/dev/USB0.

> $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 !"); 
> 
>  
> 
> }
> 
> 
> ?>
> 

I see no other issue that would explain the problem.

-- 
Len Sorensen
--
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