ok, I finally got a few minutes to do a quick test.
This code works (you need to replace the hostname and the encoded username:password with your values of course)
/*
Web client
This sketch connects to a website (http://www.google.com)
using an Arduino Wiznet Ethernet shield.
Circuit:
* Ethernet shield attached to pins 10, 11, 12, 13
created 18 Dec 2009
by David A. Mellis
modified for no-ip client example
by Jerry Sy aka doughboy
*/
#include <SPI.h>
#include <Ethernet.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[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
EthernetClient client;
void setup() {
// start the serial library:
Serial.begin(9600);
// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
// no point in carrying on, so do nothing forevermore:
for(;;)
;
}
// give the Ethernet shield a second to initialize:
delay(1000);
Serial.println("connecting...");
// if you get a connection, report back via serial:
if (client.connect("dynupdate.no-ip.com", 80)) {
Serial.println("connected");
// Make a HTTP request:
//replace yourhost.no-ip.org with your no-ip hostname
client.println("GET /nic/update?hostname=yourhhost.no-ip.org HTTP/1.0");
client.println("Host: dynupdate.no-ip.com");
//encode your username:password (make sure colon is between username and password)
//to base64 at http://www.opinionatedgeek.com/dotnet/tools/base64encode/
//and replace the string below after Basic with your encoded string
//clear text username:password is not accepted
client.println("Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=");
client.println("User-Agent: Arduino Sketch/1.0 user@host.com");
client.println();
}
else {
// if 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(;;)
;
}
}
this is my serial monitor output (not my real ip address), result is nochg, meaning my ip address did not change
connecting...
connected
HTTP/1.1 200 OK
Date: Sat, 10 Mar 2012 01:37:40 GMT
Server: Apache/2
Content-Location: update.php
Vary: negotiate
TCN: choice
Content-Length: 20
Connection: close
Content-Type: text/plain; charset=UTF-8
nochg 50.131.456.123
disconnecting.
FWIW, un-encoded clear text password does not work.
Hope this helps.
Jerry