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
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.
ReplyDelete(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
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.
DeleteUsing Arduino 1.8.0, under ubuntu, everything work flawlessy.
ReplyDeleteSpectacular ideea and professionally done work, thank you for sharing this enormous amount of knowledge, Davide Gironi.
Thank you! I really appreciate it.
DeleteDear friend thank you for an immediate answer to the problem solved I did uninstall and Resettlement Programmes thank you very much for your time
DeleteYours sincerely
George
Salem
Deletei have the same problem how do you solve it
Thank you very much for your design and code. Works great!!
ReplyDeleteThank you for this comment!
Deletehello, i cant tray do work, the esp-01 ever freez, the led blue is on and no respose serial comunication.
ReplyDeleteplease could you help me.
Hello, you have to debug it using uart as example. Or you can also double check your wiring, or trying other hardware if you have another esp8266.
DeleteThis comment has been removed by the author.
ReplyDeleteLove it. Thanks for posting.
ReplyDeleteThank you for your feedback!
DeleteNice work, thanks!
ReplyDeleteFor those who don't want to mess with flashing an ESP-001, this should work on any ESP8266-based board such as NodeMCU, Weimos D1 mini, Adafruit Huzzah, etc.
Works great for me on NodeMCU 1.0 with Arduino IDE 1.8.5 and ESP8266 board library 2.3.0. 2.6.3 had some compile errors that I was too lazy to fix.
Thank you!
Deletethis will work with CH340 or CP2102 NodeMcu V3¿
ReplyDeletei wanna buy one of them from here:
www.aliexpress.com/item/32665100123.html?spm=a2g0o.productlist.0.0.57f56d13prDaxp&algo_pvid=acf4cdd0-5683-4600-9bc6-552e9f6c36d7&algo_expid=acf4cdd0-5683-4600-9bc6-552e9f6c36d7-0&btsid=0ab6f83115984213058228520e4d59&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_
Hello shay, yes, it will work on any ESP8266. But i suggest you the CP2102 version, because the driver works with many OS.
Deletei got my order, from where i can start¿
DeleteDear shay, You just have to compile and upload the image to the ESP8266. You can find online many tutorial about this task.
Deletebefore i can start complie and upload, i need a few sketch libraries and board manager's, can you please name thus libraries¿
DeleteHello shay, if I remeber well It was Just WiFiManager, anyway you can find the list in the .ino project file.
Deletethis is working PERFECT,
DeleteBIG THANKS for you,
now i can let go the crappy free no-ip service that annoying me every month to "renew" my free subscription
That's great! Thank you for sharing your experience here.
DeleteThanks you again for you making this awsome project,
DeleteIf you think about the costs, for me its only 10nis (new israeli shekel) and i have a tiny server that will run forever
This comment has been removed by the author.
Deletehello, this can work with ipv6¿
DeleteThis comment has been removed by a blog administrator.
ReplyDeleteIn function 'int ddnsUpdate()':
ReplyDeletesketch_oct26a:416:15: error: call to 'HTTPClient::begin' declared with attribute error: obsolete API, use ::begin(WiFiClient, url)
416 | http.begin(getrequest);
| ~~~~~~~~~~^~~~~~~~~~~~
exit status 1
call to 'HTTPClient::begin' declared with attribute error: obsolete API, use ::begin(WiFiClient, url)
Can't figure out what's the problem. I'm not used to arduino, found this project useful in internet. So, if anyone know how to make this work please help me guys.
This comment has been removed by the author.
Delete//send the request, retry on error
Deleteint updateretries = 0;
do {
HTTPClient http;
http.begin(getrequest);//////////error/////////////
int httpCode = http.GET();
if(httpCode == HTTP_CODE_OK) {
String payload = http.getString();
if(payload == "OK")
updated = 1;
}
Hello, you should check that you have installed all the library needed.
DeleteESP8266WiFi
DeleteDNSServer
ESP8266WebServer
ESP8266mDNS
ESP8266HTTPClient --> I don't know why this particular include statement is not highlighted for me in orange color in code while all other libraries are highlighted.
EEPROM
WiFiManager
Ticker
All these libraries are present in sketch>include library>contributed libraries, even ESP8266HTTPClient is also present.
You are using newer libraries, 'HTTPClient::begin' is obsolete, you should change a litte the code in order to compile it correctly.
Deletewhat should i change? can you help me?
Deleteor can i change the libraries to an older version?
Unluckly I've not much time to code this. Take a look here: https://stackoverflow.com/questions/67702822/error-call-to-httpclientbegin-declared-with-attribute-error-obsolete-api Let me know if it works.
DeleteAs I said I am a beginner to Arduino, I tried but I can't figure it out. But I'm creating a micro version of your project according to my use case. So it would be helpful for me if you could tell how did you manage to find the public ip address in your code. I followed [variable "getrequest" in ddnsUpdate() function] but can't find. HELP ME IF YOU COULD SPARE SOME TIME.
DeleteThis comment has been removed by the author.
DeleteThis comment has been removed by the author.
DeleteThis comment has been removed by the author.
DeleteThis comment has been removed by the author.
DeleteESP8266+CP2102, I saw it have 5v pin.
ReplyDeleteThat's means that I dont have to put the voltage regulator circuit?
Hello Unknown user, it depends on the way the CP2102 is wired up.
DeleteSuccessfully compiled with Arduino IDE 2.3.2.
ReplyDeleteI have made the changes indicated in https://stackoverflow.com/questions/67702822/error-call-to-httpclientbegin-declared-with-attribute-error-obsolete-api To avoid the httpclientbegin-declared-with-attribute-error-obsolete-api error.
Thank you very much for this great project
Once the connection is established, how can I reset it so that the wifi manager interface is presented again to change a parameter?
ReplyDeleteIn the settings windows on the web page you should find the "reset wifi settings" checkbox.
Delete