Go Down

Topic: Controlling Arduino via Web (Read 6129 times) previous topic - next topic


Aug 23, 2011, 01:16 am Last Edit: Aug 23, 2011, 01:25 am by Rainier9 Reason: 1
Sorry for double posting.
Almost everything is always working perfectly, except one thing:
After some minutes online with the server, it stops working, like after 5 minutes or so.
Here's the code, it's pretty simple, its a variant from a Example Sketch of the book: Arduino Cookbook.

Code: [Select]
* WebServerPost sketch
#if ARDUINO > 18
#include <SPI.h> // needed for Arduino versions later than 0018
#include <Ethernet.h>
#include <TextFinder.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192,168,100,110 };
byte gateway[] ={ 192, 168, 100, 1 }; // add this if needed by your router or gateway
char buffer[8]; // buffer holding the requested page name
Server server(8000);
void setup()
Ethernet.begin(mac, ip, gateway);
void loop()
Client client = server.available();
if (client) {
TextFinder finder(client );
int type = 0;
while (client.connected()) {
if (client.available()) {
if(finder.getString("","/", buffer,sizeof(buffer))){
if(strcmp(buffer,"POST ") == 0){
finder.find("\n\r"); // skip to the body
// find string starting with "pin", stop on first blank line
// the POST parameters expected in the form pinDx=Y
// where x is the pin number and Y is 0 for LOW and 1 for HIGH
while(finder.findUntil("pinD", "\n\r")){
int pin = finder.getValue(); // the pin number
pinMode(pin, OUTPUT);
digitalWrite(pin, HIGH);
digitalWrite(pin, LOW);
sendHeader(client,"Post example");
//create HTML button to turn on pin 8
client.print("<form action='/' method='POST'><p><input type='hidden' name='pinD8'");
client.print(" value='1'><input type='submit' value='On'/></form>");
//create HTML button to turn on pin 9
client.print("<form action='/' method='POST'><p><input type='hidden' name='pinD9'");
client.print(" value='1'><input type='submit' value='On'/></form>");
// give the web browser time to receive the data
void sendHeader(Client client, char *title)
// send a standard http response header
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");

The Ethernet Shield IC also gets incredibly hot. Any ideas?
Keep it simple.


Even some DHCP IP address will remain static.

Comcast is an example of this, the only time an IP will change is if YOU change your hardware or they do a major system change.  The last IP I had was static for 3 years.


What do you mean? My public IP is actually static, I paid for one. Also, the problem is not the address, the server just doesnt host the page after a few minutes. In order for it to work again I have to reset the Shield.
Keep it simple.


I was just mentioning it since Comcast does not offer static IP's for non business accounts.

My Arduino also gets very hot, the Ethernet shield is hot but not intolerable.  What hardware are you using?
I have not noticed mine resetting or turning off, but it may.


In order for it to work again I have to reset the Shield.

How are you powering the Arduino/Ethernet shield?

The Ethernet Shield IC also gets incredibly hot.

My thermometer does not have "incredibly" on it. Can you identify on a scale of say 32 to 212 where incredibly falls?

Perhaps the W5100 chip (if that's the one you have) is getting too hot. You may need a fan, or a different power supply.
The art of getting good answers lies in asking good questions.

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!

via Egeo 16
Torino, 10131