Page 1 of 1

query for IP working no more

Posted: Sat Feb 15, 2020 10:18 am
by guy_c
My Arduino used to query bot.whatismyipaddress.com for its public IP every two hours. Starting yesterday, Feb 14th, evening, the server returns: (please ignore the timestamp)

18:55:53.241 HTTP/1.1 301 Moved Permanently
18:55:53.254 Date: Sat, 15 Feb 2020 16:55:44 GMT
18:55:53.274 Connection: close
18:55:53.282 Cache‑Control: max‑age=3600
18:55:53.295 Expires: Sat, 15 Feb 2020 17:55:44 GMT
18:55:53.311 Location: https://bot.whatismyipaddress.com/
18:55:53.331 Alt‑Svc: h3‑25=":443"; ma=86400, h3‑24=":443"; ma=86400, h3‑23=":443"; ma=86400
18:55:53.368 Server: cloudflare
18:55:53.382 CF‑RAY: 5658cfa9cedf176a‑FRA


and poor Arduino is lost... Can someone please help?

Thank you!

Re: query for IP working no more

Posted: Sat Feb 15, 2020 12:11 pm
by Chrispcritters
It looks like with the move of the automated query backend connections are now being forced to be secure rather than allowing both secure and insecure queries. I'll do some digging and see if we can stop forcing this.

In the meantime... if you update the query being done by the Arduino to https:// vs http:// that should resolve the issue.

Re: query for IP working no more

Posted: Sun Feb 16, 2020 11:05 am
by guy_c
Hello,

Thank you very much for your quick reply. I was not informed of it but now I toggled the correct switch :)
I tried to modify
client.println("GET / HTTP/1.0");
to
client.println("GET / HTTPS/1.0");

but than "api.ipify.org" is unhappy. In order to have a low load on the servers I roundrobin three severs:

const char * IPserver[]={"bot.whatismyipaddress.com", "api.ipify.org", "icanhazip.com"};

and make a query every ~2 hours to one of them. I would not love to have different api for each and was happy to see that these three have the same api. Of course with a specific api per server I could find many more but am trying to minimise the effort :)

I think that the only quick and dirty solution for me for the time being is to remove "bot.whatismyipaddress.com" from the list

Thanks again for your help