deviceSet('/dev/ttyUSB0'); $myPort->confBaudRate(9600); $myPort->confParity("none"); $myPort->confCharacterLength(8); $myPort->confStopBits(1); $myPort->confFlowControl("none"); print_r( $myPort ); // Then we need to open it if( $myPort->deviceOpen() ){ $read = ''; $start = microtime_float(); while ( ($read == '') && (microtime_float() <= $start + 2.5) ) { $read = trim( $myPort->readPort() ); if ($read != '') { echo '['.trim($read) . "]\n"; $theResult .= $read; $read = ''; }; }; // If you want to change the configuration, the device must be closed $myPort->deviceClose(); } else echo "Error oppening device \n"; ?>