I recently bought myself a Arduino Ethernet Shield and I want to know if there is any way I could detect what webpage a user goes to and do something with it. For Example.

User visits 192.168.1.10/turnon (Arduino's IP) Pin Changes State.

Any ideas? Even just to detect the url's paramaters.

有帮助吗?

解决方案

Have a look at the WifiWebServer example:

To know which webpage was requested you need to analyze the HTTP request header.

For example: GET /webpage.html?param=5 HTTP/1.1 would ask for webpage.html and the param is inside the url.

Parameter of the request could be read out similar if it was a POST request by the client from the HTTP body, in the same way (the http body is simply seperated from the header by an empty line).

Then you can set the arduino pins accordingly.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top