Jump to content


Photo

PHP CLI & COM port


  • Please log in to reply
2 replies to this topic

#1 Cayenne

Cayenne
  • New Members
  • Pip
  • Newbie
  • 1 posts
  • LocationUkraine Kyiv

Posted 13 September 2006 - 10:48 PM

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

#2 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 13 September 2006 - 11:05 PM

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
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#3 Destruction

Destruction
  • Members
  • PipPipPip
  • Advanced Member
  • 108 posts

Posted 13 September 2006 - 11:34 PM

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...

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

Hope this helps,

Dest




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users