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.