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

jim cinetron-uEvt2TsIf2EsA/PxXw9srA at public.gmane.org
Thu Apr 3 19:41:54 UTC 2008


> > > Thanks for the help. Below is the output of the command.
> > > ~$ stty -F /dev/ttyUSB0
> > > speed 9600 baud; line = 0;
> > > min = 1; time = 0;
> > > ignbrk -brkint -icrnl -imaxbel
> > > -opost -onlcr
> > > -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke
> > > 
> > > Does this help shed light on things?
> > 
> > Sorry forgot to add error code is 0 .
> 
> Could you attach the php_serial.class.php file you are using?
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");
$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 !"); 

 

}


?>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: php_serial.class.php
Type: application/x-php
Size: 12677 bytes
Desc: not available
URL: <http://gtalug.org/pipermail/legacy/attachments/20080403/547cf389/attachment.bin>


More information about the Legacy mailing list