Rigpi to Send Email (Text) on IP Change, Email Questions...


Michael Foerster
 

I've been working on a Python script that could be used on the RigPi to occasionally query your public IP address, and if it changes, then send an email (or possibly a Text, via email) to notify you, that the IP changed.
  For instance, to send a text to a Verizon customer, you send it to [phonenumber]@vtext.com.
     The idea would be, if you are away from home, and you want to access your RigPi, check your text message, or Email for the latest IP Address.

Essentially, the script loads the last IP address from a file, checks the current external IP address off a web call, and if different, sends out the email and updates the file for the last IP.
   I have it mostly working, but this is using some fairly simple code that sends email out through Gmail.  The Gmail solution is much easier than trying to install an SMTP server.
       The script would run off a Cron job, and run every hour, or every day... 

The problem that I've run into, is that Gmail considers this form of access to be less secure, and requires that the user turn ON the "Less Secure Apps" access.  
    Sort of makes me nervous to turn this on if I use my existing Gmail account. 

A solution could be to create another Gmail account, just for sending the emails, and turning the "Less Secure Apps" access ON.
  However, considering that this script could possibly be quite a number of hams that might want to do this, rather then everyone generating another account, it would be nice if we could generate one account that could be used by all that run this script for sending the email.    However, I would think that Google might frown on this type of multi-user activity.  I suppose it could be abused.

There may be some other solutions, such as MailJet, but that appears to require installing some other code which complicates things.  The code for the Gmail access seems to be built into Python.

Is there someone out there that is more familiar with Email/Gmail that might lend some ideas?

73,

Mike, W0IH

Join RigPi@groups.io to automatically receive all group messages.