Skip to content
This repository was archived by the owner on Jan 29, 2023. It is now read-only.

Commit

Permalink
v1.6.0 replaces whatismyipaddress with ifconfig.me
Browse files Browse the repository at this point in the history
### Releases v1.6.0

1. Replace deprecated `ipv4bot.whatismyipaddress.com` with `ifconfig.me`
  • Loading branch information
khoih-prog authored Nov 16, 2021
1 parent d5a90c8 commit cefd668
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 71 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Arduino IDE version: 1.8.16
`ArduinoCore-mbed` mbed_portenta core v2.5.2
Portenta_H7 Rev2 ABX00042
OS: Ubuntu 20.04 LTS
Linux xy-Inspiron-3593 5.4.0-86-generic #97-Ubuntu SMP Fri Sep 17 19:19:40 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Linux xy-Inspiron-3593 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Context:
I encountered a crash while trying to use the Timer Interrupt.
Expand Down
99 changes: 51 additions & 48 deletions README.md

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
## Table of Contents

* [Changelog](#changelog)
* [Releases v1.6.0](#releases-v160)
* [Releases v1.5.1](#releases-v151)
* [Releases v1.5.0](#releases-v150)
* [Releases v1.4.0](#releases-v140)
Expand All @@ -26,6 +27,10 @@

## Changelog

### Releases v1.6.0

1. Replace deprecated `ipv4bot.whatismyipaddress.com` with `ifconfig.me`

### Releases v1.5.1

1. Update `platform.ini` and `library.json` to use original `khoih-prog` instead of `khoih.prog` after PIO fix
Expand Down
4 changes: 2 additions & 2 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "DDNS_Generic",
"version": "1.5.1",
"description": "DDNS Update Client for Arduino boards, ported to run on SAM DUE, nRF52, SAMD21/SAMD51, STM32F/L/H/G/WB/MP1, AVR Mega, megaAVR, Teensy, RP2040-based RASPBERRY_PI_PICO, WT32_ETH01, Portenta_H7, etc. besides ESP8266/ESP32, using WiFi, WiFiNINA, Ethernet W5x00, ENC28J60, LAN8742A or Teensy NativeEthernet. It is designed to be light-weight and currently supports DuckDNS, No-ip, DynDNS, Dynu, enom, all-inkl, selfhost.de, dyndns.it, strato, freemyip, afraid.org, OVH.com",
"version": "1.6.0",
"description": "DDNS Update Client for Arduino boards, ported to run on SAM DUE, nRF52, SAMD21/SAMD51, STM32F/L/H/G/WB/MP1, AVR Mega, megaAVR, Teensy, RP2040-based RASPBERRY_PI_PICO, WT32_ETH01, Portenta_H7, etc. besides ESP8266/ESP32, using WiFi, WiFiNINA, Ethernet W5x00, ENC28J60, LAN8742A or Teensy NativeEthernet. It is designed to be light-weight and currently supports DuckDNS, No-ip, DynDNS, Dynu, enom, all-inkl, selfhost.de, dyndns.it, strato, freemyip, afraid.org, OVH.com. Deprecated ipv4bot.whatismyipaddress.com has been replaced with ifconfig.me",
"keywords": "ddns, wifi, ethernet, native-ethernet, noip, duckdns, dyndns, communication, dynamic-dns, esp32, esp8266, rp2040, teensy, samd, sam-due, nrf52, Portenta-H7, stm32, w5x00, enc28j60, wt32-eth01, rpi-pico, esp32-at, esp8266-at, avr-mega, mega-avr",
"authors":
{
Expand Down
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name=DDNS_Generic
version=1.5.1
version=1.6.0
author=Ayush Sharma, Khoi Hoang
license=MIT
maintainer=Khoi Hoang <khoih.prog@gmail.com>
sentence=DDNS Update Client Library for SAM DUE, nRF52, SAMD21/SAMD51, STM32F/L/H/G/WB/MP1, AVR Mega, megaAVR, Teensy, RP2040-based RASPBERRY_PI_PICO, WT32_ETH01, Portenta_H7, etc. besides ESP8266/ESP32, using ESP8266-AT/ESP32-AT WiFi, WiFiNINA, Ethernet W5x00, ENC28J60, LAN8742A or Teensy NativeEthernet
paragraph=A simple library that implements an automatic DDNS Update Client for SAM DUE, nRF52, SAMD21/SAMD51, STM32F/L/H/G/WB/MP1, AVR Mega, megaAVR, Teensy, RP2040-based RASPBERRY_PI_PICO, WT32_ETH01, Portenta_H7, etc. besides ESP8266/ESP32, using ESP8266-AT/ESP32-AT WiFi, WiFiNINA, Ethernet W5x00, ENC28J60, LAN8742A or Teensy NativeEthernet. It is designed to be light-weight and currently supports DuckDNS, No-ip, DynDNS, Dynu, enom, all-inkl, selfhost.de, dyndns.it, strato, freemyip, afraid.org, OVH.com.
paragraph=A simple library that implements an automatic DDNS Update Client for SAM DUE, nRF52, SAMD21/SAMD51, STM32F/L/H/G/WB/MP1, AVR Mega, megaAVR, Teensy, RP2040-based RASPBERRY_PI_PICO, WT32_ETH01, Portenta_H7, etc. besides ESP8266/ESP32, using ESP8266-AT/ESP32-AT WiFi, WiFiNINA, Ethernet W5x00, ENC28J60, LAN8742A or Teensy NativeEthernet. It is designed to be light-weight and currently supports DuckDNS, No-ip, DynDNS, Dynu, enom, all-inkl, selfhost.de, dyndns.it, strato, freemyip, afraid.org, OVH.com. Deprecated ipv4bot.whatismyipaddress.com has been replaced with ifconfig.me
category=Communication
url=https://github.com/khoih-prog/DDNS_Generic
architectures=*
Expand Down
9 changes: 5 additions & 4 deletions src/DDNS_Generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
Built by Khoi Hoang https://github.com/khoih-prog/DDNS_Generic
Licensed under MIT license
Version: 1.5.1
Version: 1.6.0
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -25,7 +25,8 @@
1.3.0 K Hoang 15/05/2021 Add support to RP2040 using Ethernet or ESP-AT
1.4.0 K Hoang 16/07/2021 Add support to WT32_ETH01 (ESP32 + LAN8720)
1.5.0 K Hoang 16/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
1.5.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
1.5.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
1.6.0 K Hoang 16/11/2021 Replace deprecated `ipv4bot.whatismyipaddress.com` with `ifconfig.me`
*****************************************************************************************************************************/

#ifndef DDNS_Generic_H
Expand All @@ -35,7 +36,7 @@
#include "DDNS_Generic_Debug.h"

#ifndef DDNS_GENERIC_VERSION
#define DDNS_GENERIC_VERSION "DDNS_Generic v1.5.1"
#define DDNS_GENERIC_VERSION "DDNS_Generic v1.6.0"
#endif

#if ( !defined(DDNS_USING_WIFI) || DDNS_USING_WIFI || !DDNS_USING_ETHERNET)
Expand Down Expand Up @@ -105,7 +106,7 @@ class DDNSGenericClass
private:
String publicIPRequest(Client& client);

String server = "ipv4bot.whatismyipaddress.com";
String server = "ifconfig.me/ip";

DDNSUpdateHandler _ddnsUpdateFunc = nullptr;

Expand Down
5 changes: 3 additions & 2 deletions src/DDNS_Generic_Debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
Built by Khoi Hoang https://github.com/khoih-prog/DDNS_Generic
Licensed under MIT license
Version: 1.5.1
Version: 1.6.0
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -25,7 +25,8 @@
1.3.0 K Hoang 15/05/2021 Add support to RP2040 using Ethernet or ESP-AT
1.4.0 K Hoang 16/07/2021 Add support to WT32_ETH01 (ESP32 + LAN8720)
1.5.0 K Hoang 16/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
1.5.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
1.5.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
1.6.0 K Hoang 16/11/2021 Replace deprecated `ipv4bot.whatismyipaddress.com` with `ifconfig.me`
*****************************************************************************************************************************/

#ifndef DDNS_Generic_Debug_H
Expand Down
25 changes: 17 additions & 8 deletions src/DDNS_Generic_Impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
Built by Khoi Hoang https://github.com/khoih-prog/DDNS_Generic
Licensed under MIT license
Version: 1.5.1
Version: 1.6.0
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -25,7 +25,8 @@
1.3.0 K Hoang 15/05/2021 Add support to RP2040 using Ethernet or ESP-AT
1.4.0 K Hoang 16/07/2021 Add support to WT32_ETH01 (ESP32 + LAN8720)
1.5.0 K Hoang 16/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
1.5.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
1.5.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
1.6.0 K Hoang 16/11/2021 Replace deprecated `ipv4bot.whatismyipaddress.com` with `ifconfig.me`
*****************************************************************************************************************************/

#ifndef DDNS_Generic_Impl_H
Expand Down Expand Up @@ -82,6 +83,8 @@ String DDNSGenericClass::publicIPRequest(Client& client)
response += c;
}

DDNS_LOGDEBUG1(F("response = "), response);

if (response.length() > 0)
{
HTTP_ResponseParser http = HTTP_ResponseParser();
Expand Down Expand Up @@ -152,13 +155,18 @@ void DDNSGenericClass::update(unsigned long ddns_update_interval, bool use_local
else
{
// ######## GET PUBLIC IP ######## //

HTTPClient http;
http.begin(client, "http://ipv4bot.whatismyipaddress.com/");

http.begin(client, "http://ifconfig.me/ip");

DDNS_LOGDEBUG(F("Calling http.begin"));

// @return -1 if no info or > 0 when Content-Length is set by server
int httpCode = http.GET();

DDNS_LOGDEBUG1(F("httpCode ="), httpCode);

if (httpCode > 0)
{
if (httpCode == HTTP_CODE_OK)
Expand All @@ -177,6 +185,7 @@ void DDNSGenericClass::update(unsigned long ddns_update_interval, bool use_local

http.end();
}

#else

else
Expand All @@ -193,12 +202,12 @@ void DDNSGenericClass::update(unsigned long ddns_update_interval, bool use_local
#else

// ######## GET PUBLIC IP ######## //
HttpClient http(client, "ipv4bot.whatismyipaddress.com");
DDNS_LOGERROR("Access whatismyipaddress");
HttpClient http(client, "ifconfig.me");

DDNS_LOGERROR("Access ifconfig.me");

// @return HTTP_CODE_OK (200) if OK and when responseBody is responded by server
http.get("/");
http.get("/ip");

int httpCode = http.responseStatusCode();

Expand Down
5 changes: 3 additions & 2 deletions src/HTTP_ResponseParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
Built by Khoi Hoang https://github.com/khoih-prog/DDNS_Generic
Licensed under MIT license
Version: 1.5.1
Version: 1.6.0
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -25,7 +25,8 @@
1.3.0 K Hoang 15/05/2021 Add support to RP2040 using Ethernet or ESP-AT
1.4.0 K Hoang 16/07/2021 Add support to WT32_ETH01 (ESP32 + LAN8720)
1.5.0 K Hoang 16/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
1.5.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
1.5.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
1.6.0 K Hoang 16/11/2021 Replace deprecated `ipv4bot.whatismyipaddress.com` with `ifconfig.me`
*****************************************************************************************************************************/

#ifndef HTTP_ResponseParser_h
Expand Down
5 changes: 3 additions & 2 deletions src/HTTP_ResponseParser_Impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
Built by Khoi Hoang https://github.com/khoih-prog/DDNS_Generic
Licensed under MIT license
Version: 1.5.1
Version: 1.6.0
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -25,7 +25,8 @@
1.3.0 K Hoang 15/05/2021 Add support to RP2040 using Ethernet or ESP-AT
1.4.0 K Hoang 16/07/2021 Add support to WT32_ETH01 (ESP32 + LAN8720)
1.5.0 K Hoang 16/09/2021 Add support to Portenta_H7, using either WiFi or Vision-shield Ethernet
1.5.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
1.5.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
1.6.0 K Hoang 16/11/2021 Replace deprecated `ipv4bot.whatismyipaddress.com` with `ifconfig.me`
*****************************************************************************************************************************/

#ifndef HTTP_ResponseParser_Impl_h
Expand Down

0 comments on commit cefd668

Please sign in to comment.