cancel
Showing results for 
Search instead for 
Did you mean: 

Arduino Emailer

FIXED
dvorak
Moderator
Moderator
Posts: 26,460
Thanks: 5,093
Fixes: 1,285
Registered: ‎11-01-2008

Re: Arduino Emailer

Was just about to suggest the same, or perhaps telneting / scraping router ?
Customer / Moderator
If it helped click the thumb
If it fixed it click 'This fixed my problem'
7up
Community Veteran
Posts: 15,531
Thanks: 1,309
Fixes: 17
Registered: ‎01-08-2007

Re: Arduino Emailer

Why even do that? - using a http request you can get the ip address in plain text from these sites (these are basic non SSL sites - i have other urls that use SSL):

http://ip.dnsexit.com/

http://www.antedes.com/getip.php (sometimes this one needs a referring url)

http://dynupdate.no-ip.com/ip.php

https://www.packetmail.net/myip.php

http://dynamic.zoneedit.com/checkip.html

http://ifconfig.me/ip

http://icanhazip.com/

http://myip.dnsomatic.com/

http://api.ipify.org/

http://myexternalip.com/raw

http://bot.whatismyipaddress.com/

http://ipinfo.io/ip

I need a new signature... i'm bored of the old one!
MJN
Pro
Posts: 1,283
Thanks: 146
Fixes: 5
Registered: ‎26-08-2010

Re: Arduino Emailer


@7up wrote:

Why even do that? - using a http request you can get the ip address in plain text from these sites (these are basic non SSL sites - i have other urls that use SSL):

Absolutely this. Parsing SMTP dialogue from Plusnet's mail server is just weird, and you deserve every consequence of things going awry in my book... 😉

Tracking IP address changes is a problem that's had perfectly functioning simple solutions for the decades that dynamic IP addresses have been around for. There's no need to invent a new one, particularly such a random one at that.

Oh and don't stop with just the IP address. Get your Arduiono to update a DNS record so you don't have to perform any reconfiguration of your camera app(s). This sort of thing should operate seamlessly without any user input action required.

7up
Community Veteran
Posts: 15,531
Thanks: 1,309
Fixes: 17
Registered: ‎01-08-2007

Re: Arduino Emailer


@MJN wrote:

Parsing SMTP dialogue from Plusnet's mail server is just weird


But you gotta admit, it's clever!

I prefer the http method but there is a shortage of urls that will output your ip as text - i've got about 30 in a database table but that's it. Obviously there will be others out there that google hasn't picked up (or my search terms suck) but as of yet, i've not got lucky in finding them.

I need a new signature... i'm bored of the old one!
MJN
Pro
Posts: 1,283
Thanks: 146
Fixes: 5
Registered: ‎26-08-2010

Re: Arduino Emailer

You only need one, so 30 is still 29 to many... 😉

Besides, every dynamic DNS provider out there provides their own lookup facility (or a method by which you don't even need to parse for your own address - you just hit a URL with your API key and if your address has changed they'll update the mapping without you needing to do anything else).
7up
Community Veteran
Posts: 15,531
Thanks: 1,309
Fixes: 17
Registered: ‎01-08-2007

Re: Arduino Emailer

@MJN I've used a few DDNS providers and none of them are happy for you to keep calling the update URL every 5-10 seconds.
For that reason, it's best to check your own IP first to see if it has changed since the last check, if not do nothing. If it has, then call the update URL.

Obviously to check the IP you need to get it from somewhere like one of those URLs I've provided.. but then it's the same problem - keep calling the same URL every few seconds and it'll become a problem for the operator of the site. So, it's best to use multiple IP URLs in a round robin fashion. This then distributes the load of your IP checks over multiple servers so that they are not seen as excessive by any one particular server.
I need a new signature... i'm bored of the old one!
MJN
Pro
Posts: 1,283
Thanks: 146
Fixes: 5
Registered: ‎26-08-2010

Re: Arduino Emailer

I can't imagine why you'd need a 5-10s response rate to something with a change interval measured in days or weeks. Checking every minute, if that, would be more than enough.

If a near-instant response is desired for whatever reason then just parse the WAN address from your router. That removes the 3rd party dependency too if that's of concern (again though I can't see why it would be - there are numerous other failure points that risk letting you down first). Many routers these days even have built-in DDNS functionality so it can be handled for you automatically without any checking required.
7up
Community Veteran
Posts: 15,531
Thanks: 1,309
Fixes: 17
Registered: ‎01-08-2007

Re: Arduino Emailer

The reason for short intervals is that i'd prefer the device to be accessible with as little downtime as possible. If it drops offline for 5 minutes that isn't great is it.

As for parsing the wan address, that usually means the application needs to be able to log into the router to gain it in the first place. Now imagine distributing a ddns updater online and it needing to be able to get into hundreds or thousands of routers - any of which could be updated by their ISP to change the html at any moment in time. Thats just one of those failure points you mention.

As for the built in DDNS many routers have, the plusnet hubone for example only offers paid ddns services - not a free one like afraid.org which is far superior in many ways. Even then the feature in the router is undocumented making no mention of how often it updates the external service. Again, it's another failure point.

Using my method means that the program can call any external server address it has in its database, if that fails it can try another in order to get the IP address. If it's changed from the currently known one stored in memory then it can call the update url and the job is done. Despite those many failure points you mention, it hasn't failed once in a rather long time. The simple realitiy is that it won't fail unless there is an internet connection failure - and those are catered for using try/finally or try/except blocks. Once the connection is restored it will regain the new IP and call the update urls (yes it supports multiple).

As for the 3rd party dependency that you don't like, thats why i've got multiple IP urls - I'm not daft enough to put all my eggs in one basket. Like i said the program even supports multiple update urls so that i have multiple ways to find the machine if one ddns address fails.

I've had a lot of failures / errors in my life, i now foresee them with almost everything and try to plan ahead for them.

I need a new signature... i'm bored of the old one!
dvorak
Moderator
Moderator
Posts: 26,460
Thanks: 5,093
Fixes: 1,285
Registered: ‎11-01-2008

Re: Arduino Emailer


Moderators Note


Due to the nature and aim of the discussion this has been moved from email to Tech Help.

Customer / Moderator
If it helped click the thumb
If it fixed it click 'This fixed my problem'
7up
Community Veteran
Posts: 15,531
Thanks: 1,309
Fixes: 17
Registered: ‎01-08-2007

Re: Arduino Emailer

 

What was the point of that? There is already a locked version of this topic in the Tech help forum. This thread was about methods of obtaining ones own IP address automatically. You moved it to email, now you're moving it back to Tech.

Next thing I know, @JonoH will be telling me how overworked you guys are - even though you're creating it for yourselves on a forum that's nearly dead anyway since the switch away from SMF.

 

 

Moderators Note: Full quote of preceding post removed.

I need a new signature... i'm bored of the old one!
dvorak
Moderator
Moderator
Posts: 26,460
Thanks: 5,093
Fixes: 1,285
Registered: ‎11-01-2008

Re: Arduino Emailer

Because it's not related to email and it's not related to an issue with PN service.
So tech help is appropriate.

In serving its purpose as a support function I'd say it's far from dead.

Customer / Moderator
If it helped click the thumb
If it fixed it click 'This fixed my problem'
MJN
Pro
Posts: 1,283
Thanks: 146
Fixes: 5
Registered: ‎26-08-2010

Re: Arduino Emailer

I think moving it makes sense if further discussion is required. Methods of tracking WAN IP address changes has nothing to do with email, whether that be Plusnet's service or anyone else's, and I suspect @deepvalley's got that now!
bobpullen
Community Gaffer
Community Gaffer
Posts: 15,165
Thanks: 2,827
Fixes: 174
Registered: ‎04-04-2007

Re: Arduino Emailer

Fix

@7up wrote:

As for the built in DDNS many routers have, the plusnet hubone for example only offers paid ddns services - not a free one like afraid.org which is far superior in many ways.


Not true, at least one of them offers a free tier (NoIP) as it's what I use and I'm paying nothing for the privilege (just need to confirm activity once every thirty days when prompted by email).

Dynamic DNS is definitely what I would suggest here.

To answer the original question, sending an email every 5 minutes would be fine, but Dynamic DNS is a lot less faffing.

Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵

7up
Community Veteran
Posts: 15,531
Thanks: 1,309
Fixes: 17
Registered: ‎01-08-2007

Re: Arduino Emailer

@bobpullen, would it be possible to add another ddns host to the router firmware? - Afraid.org is actually a very good free ddns service that i've been using for over a decade yet its not supported. No-IP used to be great but then the nagmail started and degraded the service.

Also would it be possible to have a seperate url on the router (eg 192.168.1.254/ip ) to get the external IP address from? - As mentioned above it can be done via other websites but that extra flexibility might be useful to some.

I need a new signature... i'm bored of the old one!