PHP Classes

php serial linux read problem

Recommend this page to a friend!

      PHP Serial  >  All threads  >  php serial linux read problem  >  (Un) Subscribe thread alerts  
Subject:php serial linux read problem
Summary:php serial read problem
Date:2012-11-03 15:40:37

  1. php serial linux read problem   Reply   Report abuse  
patelv98 - 2012-11-03 15:40:37
hello i have tried the below code

but i am getting nothing neither error nor output please help me get out of this...
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)

// Then we need to open it
// If you want to change the configuration, the device must be closed

// We can change the baud rate


// To write into
//$serial->sendMessage("Hello !");

// Or to read from
$read = $serial->readPort();

for ($i=0;$i<=10;$i++){
//echo "hello";
echo $read;
// etc...