Hi,
just got some code over the internet and re arranged to echo back my IP address every 30 min if has changed, via Telegram in my case, but could be any other messagging solution.
This is an alternative to no-ip and other DDNS that request 30-day confirmation for free accounts.
My ip address doesn't change until I reboot my router, so this works for me as generally it never change. But if it will, I will get a notification via Telegram to change my SoulissApp settings.
Here a piece of code,
SLOW_30m() { // Process the timer twice per hour
// Open a connection to Ipify to get the public IP address
WiFiClient client;
{
}
// Retrieve the response string
String new_ip;
while(client.available()) new_ip = client.readStringUntil('\n');
// If the IP address has changed, notify via Telegram
if (new_ip!=ip) {
ip=new_ip;
String ipmessage="Indirizzo IP cambiato: "+ip;
bot.sendMessage(group_id, ipmessage, "");
}
}
}
Dario.