Giter Site home page Giter Site logo

easyddns's Introduction

EasyDDNS

     


An easy to use DDNS Update Client library for ESP8266 & ESP32.

EasyDDNS Library can be implemented in your major projects as a sidekick. It is independent and does not interfare with rest of your code.

Supported DDNS Providers:

  • DuckDNS
  • No-ip
  • DynDNS
  • Dynu
  • ENom
  • all-inkl
  • selfhost.de
  • strato
  • freemyip
  • afraid.org
  • OVH.com

If you don't know what's DDNS, then you can find more info about DDNS here: WiKipedia


How to Install

(Best Method) Directly Through Arduino IDE

Go to Sketch > Include Library > Library Manager > Search for "EasyDDNS" > Install

Manual Install

For Windows: Download the Repository and extract the .zip in Documents>Arduino>Libraries>{Place "EasyDDNS" folder Here}

For Linux: Download the Repository and extract the .zip in Sketchbook>Libraries>{Place "EasyDDNS" folder Here}

Manually through IDE

Download the Repository, Go to Sketch>Include Library>Add .zip Library> Select the Downloaded .zip File.


Dependencies

For ESP8266:

For ESP32:


Example

#if defined(ESP8266)
  #include "ESP8266WiFi.h"
  #include "ESP8266HTTPClient.h"
#elif defined(ESP32)
  #include "WiFi.h"
  #include "HTTPClient.h"
#endif

#include <EasyDDNS.h>

const char * ssid = "your-ssid";
const char * password = "your-password";

WiFiServer server(80);

void setup() {
  Serial.begin(115200);
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println(WiFi.localIP()); // Print the IP address
  server.begin();

  /*
    List of supported DDNS providers:
    - "duckdns"
    - "noip"
    - "dyndns"
    - "dynu"
    - "enom"
    - "all-inkl"
    - "selfhost.de"
    - "dyndns.it"
    - "strato"
    - "freemyip"
    - "afraid.org"
  */
  EasyDDNS.service("duckdns");

  /*
    For DDNS Providers where you get a token:
      Use this: EasyDDNS.client("domain", "token");
    
    For DDNS Providers where you get username and password: ( Leave the password field empty "" if not required )
      Use this: EasyDDNS.client("domain", "username", "password");
  */
  EasyDDNS.client("12345.duckdns.org", "token"); // Enter your DDNS Domain & Token

  // Get Notified when your IP changes
  EasyDDNS.onUpdate([&](const char* oldIP, const char* newIP){
    Serial.print("EasyDDNS - IP Change Detected: ");
    Serial.println(newIP);
  });
}

void loop() {
  // Check for new public IP every 10 seconds
  EasyDDNS.update(10000);
}

Support Me

You can always buy me a coffee :) , It supports my work and in return you get to keep up-to-date version of my libraries.


easyddns's People

Contributors

ayushsharma82 avatar cjmccjmccjmc avatar comertial avatar gspin96 avatar hacsko-adam avatar khoih-prog avatar kolod avatar leobel96 avatar patteb avatar per1234 avatar servuc avatar vivian-ng avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.