How can I pull a variable located in Arduino RAM through an Ethernet Shield from my PHP (WAMP) server?

e.g I have variable red_led = 1 in the Arduino, now how can I pull that info to my PHP server?

share|improve this question
1  
This is very similar to your previous question. Are you asking about the general approach or the specifics? If it's the specifics, be more specific. What code have you tried, what problems have you encountered? electronics.stackexchange.com/questions/19854/… – Toby Jaffey Oct 4 '11 at 9:41

1 Answer

If you have a public IP address in your Arduino device, you can repeatedly make requests from your WAMP server. But the Arduino has to listen on some port and respond to your request.

The better solution is, every time the variable changes its state, the Arduino connects to your WAMP server and sends the desired data. For example, it makes an HTTP GET request:

http://example.com/variable-from-arduino.php?red_led=1

And that's it. Every time, when the Arduino sends a GET request, you can process it on your server.

If you just want to print some graphs based on your variable, you can use Pachube.

share|improve this answer
Thanks yes the GET method works, but what about POST method? example 192.168.1.35/test.php/?red_status=5 <<< this works only with GET method. but now i want to send in POST method. – Theodros Oct 8 '11 at 4:47
Well, GET method is more easy than POST. GET contains only HTTP header, it has no body. But if you want to use POST instead, look here — jmarshall.com/easy/http/#postmethod There is example, how POST request looks. – vasco Oct 8 '11 at 10:23

Your Answer

 
or
required, but never shown
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.