php-serial not working php-serial not working windows windows

php-serial not working


Check that your COM2 is installed, enabled, and working right in device manager, if you haven't. Also what model of Arduino are you using? I don't think this question can be answered without more information. It might be wise to add that info to your original question. Also, we can't see the source of the php_serial class without registering for an account, which I do not wish to do.I realize this is more of a comment than an answer, but I need a bit more rep to comment (a flaw in S.O.'s reputation system, in my opinion.) But the original question will not get an answer without more information, so I felt it was pertinent to add. Best of luck.


You're not setting a baud rate in the PHP code.

Have you tried using a terminal emulator (like Hyperterm) to confirm that your serial port is wired up correctly?

You might need to use the string \\.\COM2 as the name of the serial port -- that's what I do in a C program I wrote. Note that you will probably need to escape those backslashes: "\\\\.\\COM2".


there are several bugs in the PHP-serial class code.

function DeviceSetdoes not work on linux for ttyUSB0 or ttyACM0 out of the box;

function confstopbits,the if for $this->os===osx needs to be an ELSEIF

And then still, when trying to connect to an Arduino from a PI or BBB, you'll need to stty -F /dev/ttyACM0 ignparto get it to work properly...