Created
September 10, 2013 02:26
-
-
Save rat/6504285 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void UpdateNoIP(){ | |
EthernetClient client; | |
if(client.connect("dynupdate.no-ip.com", 80)){ | |
Serial.println("Conectando com No-IP"); | |
client.println("GET /nic/update?hostname=SUA URL HTTP/1.0"); | |
client.println("Host: dynupdate.no-ip.com"); | |
client.println("Authorization: Basic Senha em Base64"); | |
client.println("User-Agent: Arduino Client/1.0 dr.renatotavares@gmail.com"); | |
client.println(); | |
while(client.connected()){ | |
// stay in this loop until the server closes the connection | |
while(client.available()){ | |
// The server will not close the connection until it has sent the last packet | |
// and this buffer is empty | |
char read_char = client.read(); | |
Serial.write(read_char); | |
} | |
} | |
// close your end after the server closes its end | |
client.stop(); | |
Serial.println("Conexão com No-IP fechada"); | |
} | |
else{ | |
Serial.println("Falha na Conexão"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment