Saturday, February 4, 2017

Duck DNS ESP8266 mini WiFi client


This is a Duck DNS ESP8266 mini WiFi client.


Duck DNS (https://www.duckdns.org/) is a free Dynamic DNS (DDNS) service.
It as a few client available for many operating system and a few routers.
A friend of mine runs a router that does not support any of the Duck DNS update mode. Instead of loading his operating system with the Duck DNS updater, or installing an openwrt router, I've implemented an ESP8266 client.


It is powered by USB, it can also be powered by the router USB port.
It's built on a pretty old ESP-01 board.
It has two led, one is the ESP-01 WiFi connection status embedded one, the other is connected to the GPIO2 port, and it's used for the DNS update status.


We need just a 3.3 voltage regulator to run this board using any 5V USB power output capable of 200mA.
The code is written using the Arduino IDE + ESP8266 core, to me that's the fastest and simple way to work with ESP8266.

The WiFiManager library (https://github.com/tzapu/WiFiManager) is used to facilitate the WiFi connection of this module.

Also it runs a web server that allow any user to setup the DuckDNS connection parameters.
User can set the DDNS domain name and token, and also the update interval and the module hostname, that way one can just forget the module IP and open the web configuration page by board name. The default board name is espduckdns001, so the web page address is http://espduckdns001


Code

Notes
  • read risk disclaimer
  • excuse my bad english


5 comments:

  1. Dear Good evening I find very interesting the project but faces a small problem with the code when I go to compile my displays any errors with arduino I'm already 1.8.1.

    (Arduino: 1.8.1 (Windows 10), board: "Generic ESP8266 Module, Serial, 80 MHz, 40MHz, DIO, 115200, 1M (512K SPIFFS), ck")


    ESPDuckDNS: 426: error: 'HTTP_CODE_OK' was not declared in this scope

         (If (httpCode == HTTP_CODE_OK) {)

                          ^

    '' Exit status 1
    'HTTP_CODE_OK' was not declared in this purpose

    If you can please help.

    Sorry for the miserable englise

    Thanks.

    George

    ReplyDelete
    Replies
    1. Hello, thank you. I think your issue is that you do not have the ESp8266HttpClient library installed. I've checked right now, on Arduino 1.8.1, it compiles.

      Delete
  2. Using Arduino 1.8.0, under ubuntu, everything work flawlessy.
    Spectacular ideea and professionally done work, thank you for sharing this enormous amount of knowledge, Davide Gironi.

    ReplyDelete
    Replies
    1. Thank you! I really appreciate it.

      Delete
    2. Dear friend thank you for an immediate answer to the problem solved I did uninstall and Resettlement Programmes thank you very much for your time

      Yours sincerely

      George

      Delete