Jump to content

Archived

This topic is now archived and is closed to further replies.

Cayenne

PHP CLI & COM port

Recommended Posts

Can php cli access to COM port and listen it for signals ? If yes, what must i use for it ?
OS: UNIX

Share this post


Link to post
Share on other sites
I'm not sure, it can listen to TCP/UDP ports using sockets, as for physical COM ports, I'm not sure.  What did Google say  ???

Regards
Rich

Share this post


Link to post
Share on other sites
I've seen the following on the php.net site in a post about a bug that has since been fixed I believe.  This may be the way to access the COM ports...

[code]
<?php
$serial_port = fopen("COM4", "r+");
echo(fread($serial_port, 8192));
?>
[/code]

Hope this helps,

Dest

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.