dannybackx/dyndns

0.0.3

uploaded 11 months ago
This is a client for dynamic DNS services, aimed at ESP (ESP32, etc) devices. Your node can use such a service to make its IP address known as a public DNS name, so you can find it, and use it from applications.

readme

Dynamic DNS client library for ESP32

Copyright © 2019, 2020, 2021, 2023 by Danny Backx

The supporting functions for DynDNS allow you to have active FQDN, even on more than one name for a single device :
      dyndns = new Dyndns(config->dyndns_provider());
      dyndns->setHostname(config->dyndns_url());
      dyndns->setAuth(config->dyndns_auth());

      dyndns2 = new Dyndns(DD_CLOUDNS);
      dyndns2->setHostname(DYNDNS2_URL);
      dyndns2->setAuth(DYNDNS2_AUTH);

  and then run code like this periodically both on dyndns and dyndns2 :

    if (dyndns && (nowts > 1000000L)) {
      if ((dyndns_timeout == 0) || (nowts > dyndns_timeout)) {
	if (dyndns->update()) {
	  ESP_LOGI(app_tag, "DynDNS update succeeded");
	  // On success, repeat after a day
	  dyndns_timeout = nowts + 86400;
	} else {
	  ESP_LOGE(app_tag, "DynDNS update failed");
	  // On failure, retry after a minute
	  dyndns_timeout = nowts + 65;
	}
      }
    }

Links

Supports all targets

License: MIT

To add this component to your project, run:

idf.py add-dependency "dannybackx/dyndns^0.0.3"

or download archive

Stats

  • Downloaded in total
    Downloaded in total 18 times
  • Downloaded this version
    This version: 16 times

Badge

dannybackx/dyndns version: 0.0.3
|