Go Down

Topic: Ethernet Shield and external MySQL web server (Read 1 time) previous topic - next topic


Hi Guys/Girls,

I'm trying to get the Ethernet shield to work as a client that can send data to an external web server (and store it using MySQL)  and receive data back  from the web server,  then act on it.

What I've been looking for is Ethernetshield code and HTML/PHP to  achieve the following sudo Code

On Arduino, (pde code)

Measure a value XXX
Upload value XXX to external Web server running MySQL
Retrieve value YYY from MySQL via External web server
Compare  XXX = YYY
If yes light Led

Seems simple but I've not been able to find an example that matches this requirement.

Anyone have example code i can get started with??




Can someone help us? I need the same thing :)



The example in the link below may help you:


I did not work with the ethernet shield yet, but if I were you, I would ask the web server do the comparison, and just let it return the value of this comparison. This would save you one trip to the server.
To recap, your arduino code would:
1. measure a value x;
2. send a request (through the ethernet shield web client) to the web server, passing the value x as parameter;
3. receive a response with the result; the response could be as simple as a one character HTML page (beside all the HTML tags, of course).

Your web server code would:
1. read the parameter x;
2. save or not this value (x) to mysql;
3. read another value from mysql;
4. perform the comparison;
5. return the result.

I hope this helps.

Go Up