Reputation: 942
I've tried to connect the NV200 smart payout device to my php project using php_serial.class.php, but got this error:
Specified serial port is not valid in D:\xampp-7\htdocs\testsocket\php_serial.class.php on line 145
II'm using windows 7 and checked into device manager, the device is connected to COM3. This is my code:
include "php_serial.class.php";
$serial = new PhpSerial;
$serial->deviceSet("COM3");
$serial->confBaudRate(2400);
$serial->confParity("none");
$serial->confCharacterLength(8);
$serial->confStopBits(1);
$serial->confFlowControl("none");
$serial->deviceOpen();
$serial->sendMessage("Hello !");
What have gone wrong? What is the proper way to connect to serial port? Please help.
Upvotes: 0
Views: 1152
Reputation: 942
Sorry guys. I opened a software that also connect to COM3. It appears that serial port cannot connect to more than one software.
Upvotes: 1