Go Down

Topic: Webserver with dyn DNS (Read 1 time) previous topic - next topic

karlok

Hello,

to reach my Arduino webserver in the www without knowing my IP address, I used a dyndns service (no-ip in my case) and I know that my ISP will assign my a new IP regularly when I switch off and then on my router again (reset) because then I reconnect.
My question is: Does my ISP also assign me a new IP  if I always let my router on?
Then I would not need to update my IP with the so called DUC (dynamic update client) tool.

Thank you
using Arduino Uno Rev 3

PaulS

Quote
Does my ISP also assign me a new IP  if I always let my router on?

Wouldn't this be better answered by your ISP?

Generally, though, the answer is yes. I never turn my router off, and it gets a new IP address about once a week.


karlok

#2
Feb 02, 2013, 04:51 pm Last Edit: Feb 02, 2013, 05:01 pm by karlok Reason: 1
Ok, thank you.
I will monitor the behaviour as from now.
Maybe I have some chanches making the arduino ethernet (as a client ) doing the request to update the new ip.
If someone is interested in this, too, there is an API http://www.noip.com/integrate/request

Can the Ethernet be Client and Server on the same time?
Will I first have to stop the server then start the client then do the update, then stop the client and restart the server (?)
using Arduino Uno Rev 3

PaulS

Quote
Can the Ethernet be Client and Server on the same time?

Yes.

Quote
Will I first have to stop the server then start the client then do the update, then stop the client and restart the server (?)

No.

karlok

Ok, thanks.

Now I am trying to use the API described here http://www.noip.com/integrate/request

Code: [Select]
// NO-IP, Dynamic Update Client, 02.FEB.13

#include <SPI.h>
#include <Ethernet.h>

byte mac[] = {
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
char server[] = "dynupdate.no-ip.com";

EthernetClient client;

void setup()
{
  Serial.begin(9600);

  Serial.println("[NOIP-DUC]\n");
  Serial.println("Getting IP address from DHCP ...");

  if (Ethernet.begin(mac) == 0)
  {
    Serial.println("Failed to configure Ethernet using DHCP !");
    while (1)
      ;
  }

  Serial.print("My IP address: ");
  Serial.println(Ethernet.localIP());
  Serial.println();

  Serial.print("Connecting to ");
  Serial.print(server);
  Serial.println(" ...");
  client.connect(server, 80);
 
  // checking for answer?
 
  Serial.println("OK. Sending request...\n");
  client.println("GET /nic/update?hostname=mytest.testdomain.com&myip=1.2.3.4 HTTP/1.0");
  client.println("Host: dynupdate.no-ip.com");
  client.println("Authorization: Basic base64-encoded-auth-string");
  client.println("User-Agent: Bobs Update Client WindowsXP/1.2 bob@somedomain.com");
 
  Serial.println("ready?!");
 
}



void loop()
{
  if (client.available())
  {
    char c = client.read();
    Serial.print(c);
  }

  if (Serial.available())
  {
    char c = Serial.read();
    client.print(c);
  }

  if (!client.connected())
  {
    Serial.println();
    Serial.println("Disconnecting.");
    client.stop();
    while (1);
  }
}



Why don't I get any answer? It just disconnects after ~5 seconds.
using Arduino Uno Rev 3

Go Up