[nycphp-talk] Serial communication in Mac OS X
Corey Fogarty
corey at bmfenterprises.com
Wed Apr 16 22:23:35 EDT 2008
Hi All,
I am trying to connect to /dev/tty.USA28Xb2P1.1 which is a Keyspan USB to
Serial adapter. I have had success using the screen utility, #screen
/dev/tty.USA28Xb2P1.1 but I would like to use PHP to create a web interface
to a microcontroller.
I have attempted fopen with no luck:
> $port = "/dev/tty.USA28Xb2P1.1";
>
> $p = fopen($port, 'r+');
> $read = fread($p, filesize($port));
> fclose($p);
>
> echo $read;
>
> $p = fopen($port, 'r+');
> fwrite($p, "A");
> fclose($p);
I have tried SerProxy but cannot get a connection through telnet. I have
also tried LibSerial but could only find version 0.5.2 which does not yet
support PHP apparently... I have read about IOKit but I am not sure it will
get me where I want to be.
Any help would be greatly appreciated.
Thank you!
Corey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20080416/04b0f744/attachment.html>
More information about the talk
mailing list