Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8026

Beginners • Re: Old coding on new hardware

$
0
0
Ok. Is something else opening the serial port? For example, you can't run minicom while you're trying to get PHP to communicate with the Arduino.

Another suggestion I have found is to print out the state of the serial port variable to see if the port was opened successfully with var_dump($serial);

Probably put it before

Code:

$serial->confBaudRate(57600);
in your PHP code, then look in the logs for the result.
Thanks, here's the response:

object(phpSerial)#1 (7) {
["_device"]=>
NULL
["_windevice"]=>
NULL
["_dHandle"]=>
NULL
["_dState"]=>
int(0)
["_buffer"]=>
string(0) ""
["_os"]=>
string(0) ""
["autoflush"]=>
bool(true)
}

Statistics: Posted by Ajbriggs — Mon Oct 21, 2024 9:14 am



Viewing all articles
Browse latest Browse all 8026

Trending Articles