2) is it possible to create plugin for espeasy to use DDNS service so it can be accessed from wan network without using static IP ? example below:
https://github.com/ayushsharma82/EasyDDNS
Thanks.
I would leave that to a router.
Yes router has to be part of it to forward ports but to identify and access particular ESP unit from many deployed on same LAN we need some software on these units. My router does not work with DuckDNS service which I use for DDNS service. I can imagine lot of routers have limited setup you can do to work with different DDNS services out there. DuckDNS is very simple and free service.the software just have to report it's ip to duckdns once a day or once a week because dynamic ip from ISP does not change frequently in most cases. This will be not very safe in production environment but it will be helpful for experimenting and coordinating with outside parties in real time.This will also require unique port number for each unit to separate them from each other in ESPEasy-Globals.h file.This unique port numbers could be same as last 2 or 3 digits of your chosen fixed IP address in sketch to make it easy to remember if you have too many units.
ESP8266WebServer WebServer(80); // Enter your WebServer port value in ESPEasy-Globals.h file.
Thanks
When you're considering this, you may want to have a look at Apache. For example to run it on a Raspberry Pi.
Then you could use either hostnames (bedroom.DDNS-name.bla.org), or subdirectories (DDNS-name.bla.org/bedroom) and let Apache do the mapping to the several hosts in your network.
This allows for some proper access filtering, built into Apache or the Linux running on the Pi and may make the administration a lot easier.
Yes that's a solution but require an extra hardware and some knowledge of linux. I thought my proposed solution was simple enough to do this. It will require only 1 small library and few lines of code in ESPEasy-Globals.h file. Following is the original code example added to that file after removing unnecessary or duplicate code . This code can be loaded on only 1 ESP unit to update dynamic IP address because all other ESP units are on same LAN and all will be accessible with same domain name but unique WiFiServer server port.
/*
This Example Explains the Use of EasyDDNS Library with DuckDNS Service
and Checks for New IP Every 10 Seconds.
Author: Ayush Sharma
*/
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();
EasyDDNS.service("duckdns"); // Enter your DDNS Service Name - "duckdns" / "noip"
EasyDDNS.client("domain","token"); // Enter ddns Domain & Token | Example - "esp.duckdns.org","1234567"
}
void loop() {
EasyDDNS.update(10000); // Check for New Ip Every 10 Seconds.
}``
It does allow for more than one DDNS service, see https://github.com/ayushsharma82/EasyDDNS
If other also want it, please add thumbs-up, because we don't have a better rating system.
Yes by activating/deactivating just 1 line of code you have 4 different DDNS service providers option.
Not sure why on an IoT device this is needed, if you search "DuckDns Updater" there are options..
DuckDNS Client for example.
Well, I would also leave the DDNS to router but it would be really nice to have a possibility to use any custom HTTP port for ESP Easy devices ( already discussed here: https://github.com/letscontrolit/ESPEasy/issues/573 ).
It could be used as a Plugin/task I guess.
I am also waiting for this option. Services such as afraid.org or duckdns.org are very easy to use and the possibility of using them would be great.
it would be wonderful to have that plugin available !
I will close this, open if its still a valid issue.
Most helpful comment
I would leave that to a router.