2

I have a web page which includes a basic content. I can chance its format but it is PHP now. I want to send this data to one of the serial ports of my computer (as a visitor of PHP page).

I need a code for transferring this data from internet to one of the serial-ports. It can be C++, javascript, C# or anything else.

I am using Windows (as a visitor of web page). So, I need to send datas to serial port of visitor's computer not server's. Reading is not necessary.

Which program and process is the best option to do this properly? I need example code parts that they work just fine!

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • Euhm, sounds like you want to write a client for a web backend that retrieves the data from the web and then writes the retrieved data to a serial port, is that right? –  Jan 03 '13 at 21:00
  • 1
    boost asio is the best.... – joy Jan 03 '13 at 21:01
  • @İnsanlardanBirİnsan Then for the first part, have a look at libcurl, for the second part the C stdlib functions `write()` and `tcsetattr()` will help you out. –  Jan 03 '13 at 21:02
  • Please do not duplicate your questions http://stackoverflow.com/questions/14148981/how-can-i-send-datas-from-web-page-to-serial-port-of-visitors-computer – hakre Jan 04 '13 at 00:45

1 Answers1

4

There is a library for PHP that supports writing to serial port.

See here.

More:

http://php.net/manual/en/function.fopen.php#20935

See this question for more discussion: How to Read RS232 Serial Port in PHP like this QBasic Program

Update:

To do this on windows see this tutorial: https://web.archive.org/web/20140704050547/http://blog.950buy.com/article/php-use-rs232-serial-communication-to-send-file/

Also this question: Serial comm with PHP on Windows

Sumit
  • 2,242
  • 1
  • 24
  • 37
pzirkind
  • 2,338
  • 2
  • 20
  • 25