ho inserito il codice così, non sapevo in quale if
ho anche reinstallato linux e apache, ora visualizzo tutto, ma il risultato è questocodice:<?php error_reporting(E_ALL); ini_set("display_errors", 1); define("PORT","dev/ttyACM0"); if (isset($_GET['action'])) { var_dump( $serial ); include "php_serial.class.php"; $serial = new phpSerial(); $serial->deviceSet(PORT); $serial->confBaudRate(9600); $serial->confParity("none"); $serial->confCharacterLength(8); $serial->confStopBits(1); $serial->confFlowControl("none"); $serial->deviceOpen(); if ($_GET['action'] == "on") { $serial->sendMessage("a"); } else if ($_GET['action'] == "off") { $serial->sendMessage("s"); } $read = $serial->readPort(); print $read; $serial->deviceClose(); } ?>
Notice: Undefined variable: serial in /var/www/index.php on line 7
NULL
Warning: Specified serial port is not valid in /var/www/php_serial.class.php on line 111
Warning: Unable to set the baud rate : the device is either not set or opened in /var/www/php_serial.class.php on line 204
Warning: Unable to set parity : the device is either not set or opened in /var/www/php_serial.class.php on line 254
Warning: Unable to set length of a character : the device is either not set or opened in /var/www/php_serial.class.php on line 298
Warning: Unable to set the length of a stop bit : the device is either not set or opened in /var/www/php_serial.class.php on line 335
Warning: Unable to set flow control mode : the device is either not set or opened in /var/www/php_serial.class.php on line 376
Warning: The device must be set before to be open in /var/www/php_serial.class.php on line 137
Warning: Device must be opened in /var/www/php_serial.class.php on line 541
Warning: Device must be opened to read it in /var/www/php_serial.class.php on line 474