Go Down

Topic: Push/Pull commands to Arduino by HTTP (Read 127 times) previous topic - next topic

clisse

I am working on a project, where i will be able to control ouputs of Arduino over HTTP, but thing is that i don´t know the IP adresses of the Arduinos and routers and firewall will prevent me from sending commands directly to Arduino.
So i need the Arduino to initiate the connection to the web server, but i don´t want the Arduino to poll the web server every 1 second and i will reduce delay in the commands to an absolute minimum.

My idear is to initiate the connection from the Arduino to the webserver, but wait to send the respond to the Arduino, until just before the request times out, leaving the timeout settings as window to send commands to Arduino almost zero delay.
I don´t know what the timeout is, but imagine it could reduce poll request to every 30 sec or so.

I would like to do it HTML and PHP.

Anybody that can help me do that?

Best Recards
Claus

PaulS

Quote
but thing is that i don´t know the IP adresses of the Arduinos and routers and firewall will prevent me from sending commands directly to Arduino.
But, the Arduino knows its IP address.

Quote
So i need the Arduino to initiate the connection to the web server, but i don´t want the Arduino to poll the web server every 1 second
The Arduino(s) could send a "Hey, I'm interested request" with an IP address.

Then, the Arduino would switch to being a server, and the "server" would make GET requests to any interested "clients" using the registered IP address(es).

clisse

That´s actualy a good idear.

But that will require portforwarding and firewall rules to let my GET request in to the Arduino. That could be solved in some places, but others will not be possible. Also if connected with GSM shield, it usualy share a public IP address with no forwarding capabilities.

Does anybody know how long the timeout for a respones in the ethernet client command?

zoomkat

Quote
My idear is to initiate the connection from the Arduino to the webserver, but wait to send the respond to the Arduino, until just before the request times out, leaving the timeout settings as window to send commands to Arduino almost zero delay.
Why wait until just before the timeout? I don't see any benefit. I don't think that setup will allow any type of "cold call" from the outside if that is what you want.
Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy