Here is working code for sending an update response to the dnsExit.com server. If others have useful modifications please post, I could use examples of other applications. This is a code fragment.
/*
Web client
based on:
using an Arduino Wiznet Ethernet shield.
Modified to connect to dnsExit.com no-ip service
Provides template for sending http:get and http: requests to a server from Arduino Ethernet
Out of respect to dnsexit.com and their users it is important to limit the frequency of requests.
Once the additional code is included this will check every 8 hours
Modified 9/15/2012
By: Tom Northen
*/
#include <SPI.h>
#include <Ethernet.h>
#include <SD.h>
// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac[] = {
0x90, 0xA2, 0xDA, 0x00, 0xBB, 0xAA };
char dnsexitServer[] = "67.214.161.141";
//char dnsexitServer[] ="http://update.dnsexit.com";
EthernetClient client;
void setup() {
Serial.begin(9600);
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
// no point in carrying on, so do nothing forevermore:
while(true);
}
//Give time to initilize:
delay(2000);
if (client.connect(dnsexitServer, 80)) {
Serial.println("connected");
Serial.println(" Making an HTTP request:");
delay(4000);
client.println("GET /RemoteUpdate.sv?login=yourUserID&password=yourPassword&host=yourDomainName.com&myip= HTTP/1.1"); //ip not required
//login, password, URL, and ip are not in quotes
//their literature showing host.domain.com seems incorrect
client.println("Host: update.dnsexit.com");
client.println("User-Agent: User-Agent: Arduino Sketch/1.0 user@host.com");
client.println("Accept: text/htm"); //other parameters may be included but not necessary
client.println("Accept-Language: en-us,en;q=0.5");
client.println("Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7");
client.println("Connection: close"); // keep-alive not required as noted by following post
client.println("Referer: http://update.dnsexit.com/RemoteUpdate.sv?login=yourUserID&password=yourPassword&host=yourDomainName.com&myip= ");
client.println("Accept-Encoding: gzip, deflate");
delay(1000);
client.println("");
Serial.println("finished sending http://update string");
}
else {
// kf you didn't get a connection to the server:
Serial.println("connection failed");
}
}
void loop()
{
// if there are incoming bytes available
// from the server, read them and print them:
if (client.available()) {
char c = client.read();
Serial.print(c);
}
// if the server's disconnected, stop the client:
if (!client.connected()) {
Serial.println();
Serial.println("disconnecting.");
client.stop();
// do nothing forevermore:
for(;
;
}
}