|
|
| |
1. local machine Serial COM Port |
|
Reply |
|
|
 gilbertlow | 2011-09-18 10:29:55 |
Hi everyone,
Can i use php serial to read/write to local machine (PC) serial com port instead of web server serial com port ?
If it can be achieve, please help and provide some sample coding.
Thanks
Regards
Gilbert
gilbertlow@hotmail.com
|
| |
2. Re: local machine Serial COM Port |
|
Reply |
|
|
 atanas markov | 2011-10-09 19:56:55 - In reply to message 1 from gilbertlow |
You can't write to local port with php on server. If you need to do it install a local server on client machine(wamp for example) and call a script at http://localhost/... that does serial comunication. For example you can call sth. like:
$('#somediv').load('http://localhost/serialwrite.php?data=dfkkdfk');
and in the local serialwrite.php you can use phpSerial as you would on server(I use this scenario in a web based ERP application for printing cash receipts, reading scales, printing labels and so on on client machines, but in a more complicated way.). But remember that PHP just can't normally read com ports on Windows systems, so you may need a pecl extension if clients don't run on Linux/OSX. |
|