Monday, August 17, 2015

Cabin Fever Project Part 2: Sending Email

In the first part of this project, I was able to get the unit reading the temperature.
This second part of the project was be able to send email (so that I could send the temperature).

I spent about 5 or 6 hours total on this part of the project.

The Hardware
As you can see in the photo above, I was able to just plug the ethernet shield into the Arduino Uno board.  They just stacked on top of each other. There seems to be a clearance issue between the ethernet cable socket on the shield and the USB socket on the Uno below it, but I can put an insulator in there later. For now, I just made sure they were not touching; we don't need any electrical shorts now, do we?

Barking up the wrong tree (going down a path that led to nowhere)
The first 2 to 3 hours was spent following a few instructions I had found for using one technique to send emails (located here and here and here). But, after trying to get email working using this technique (an email SMTP server), I was not able to get it to work. It seems that finding an SMTP server that doesn't require encryption (SSL or TLS) isn't possible anymore. And, the Arduino isn't powerful enough to do encryption. Also, it appears that projects that used free services in the past (like twilio and SMTP2GO), no longer appear to be free to use (for some I seem to be able to set up a free account to test, but then have to pay to use it regularly).

Using a Service
So, I found this article about using a service called Temboo. It's free if you make less than a certain number of calls per month. I don't see us going over that number, but I can program it so that we don't.

Within a few hours of playing with this service (I was slowed by some technical issues of being logged out of the Temboo service), I was able to get it to send email from the Arduino.

 I also was able to send a text message (SMS) to a cell phone by sending an email to a specific email address for the phone carrier. Most carriers support this.

(Note: upon writing this, I also found some other means to send email. I may want to check these out:  sendgrid article (which talks about using node.js code instead of C for the Arduino) and this article which talks about using MongoDB for storing data)

So, now I have the email working. The next step is to connect part 1 of the project (Temperature) and Part 2 of the project (sending email) together so that I can send the temperature via email.

Stay tuned!
(see part 3)

No comments: