Go Down

Topic: Alarm System Sending SMTP and Text Messages (using ESP8266) (Read 3762 times) previous topic - next topic

deki

That did it, it compiles just fine. Tried all example files and the ones in this forum post and they all take now. I even tried my Nano and it compiles also. Now to get on with the rest of the project. I see there are 6 downloads already so maybe you helped others out as well.
Thanks for your patience.

DonEduardo

Glad the mystery is solved!

I'd still recommend at some point you use my version (ESP8266UNO) that allows you to connect the ESP8266 with a softwareserial port so you don't have to keep plugging and unplugging everything when going from programming to live to debug. You can find the most updated version in connection with my ESP8266 Sprinkler Project

It's my first attempt at modifying/creating a library so I've probably not done some things right but it's been working well for my needs.

Also lookout for the gotchas that I mentioned earlier when using the Itead library.


jagojon3

Thanks for this! I have some parts ordered and will be trying this out on my older alarm system as well. A few questions:

1. I'll be using an Arduino Pro Mini clone. Should I set it as an Uno or Mega in the program?
2. I see that I have to set my SSID name and password in both the program and the ESP8266 uartwifi.h library, but also have to set the "erncryption" parameter in the uartwifi.h library, where do I find that?
3. I want to use this with my Gmail account. What IP address do I use? I see you are using your smtp address from Comcast
4. Are there any other changes I have missed that I need to make to customize the program or uartwifi.h library for my setup?

DonEduardo

Hey, good questions. I'll try to answer:

1) For this library the Pro Mini is the same as an UNO, so that's how you'd configure the .h file. But if you use any of my versions that's already configured for you.

2) I did not have to change anything for SSID or Password outside of the main sketch. I wouldn't suspect you need to either unless you have some unusual router setup.

3)  To get the IP address you can ping smtp.gmail.com and see what comes back.

I'm glad you asked about gmail because they changed something recently. Google now requires that you enable "Less Secure" apps if you want to use smtp in this way (this link may provide more info: Google Less Secure Apps

I suggest you get smtp working with your gmail account using some other method first and then work on getting it to work with this setup. The error you get back if things are not configured right is "Unable to Authenticate", or something like that. You end up thinking you entered the password wrong, and it threw me off for a while. Also, I think Google notifies you that somebody tried to access your account. You tell Google at that time you know who that is and let that IP Address through from now on. If I find a link providing more detailed instructions on how to set this up with gmail I'll let you know but that's all I can recall at the moment.

Maybe someone else can chime in with more info on setting up gmail for SMTP these days.

swilson

The problem is not "Gmail" per say but "SSL" that is not working.  I am a newbie at arduino and esp8266 so I may be wrong but, arduino has no support for SSL and has no libraries that will enable it.  It would take too much proc and memory to make it work.  That is what I have found out on the web just researching.  I am not saying it is not possible but I haven't found a way to do it yet without extra components (RFXduino, PC, etc).  The solution to make email/text work with this project is not use gmail but setup a non-ssl email account somewhere and have that email account forward to gmail.

There is a possibility that LUA firmware "might" work on the esp8266 but I haven't researched it in depth.  Of course the code would have to change.

I really wish someone would code a minimal library to allow ssl on the arduino if possible.  If I knew what I was doing I would try but I don't have a clue where to start.  If LUA firmware does let you establish a SSL connection possibly it could be referenced for a ssl library for the arduino.  Just speculating of course.

DonEduardo

It's been several months since I worked with SMTP and gmail, but I'm pretty sure even from a Linux computer with SSL I still had to permit "less secure apps" to get it to work. Here's an article about setting up gmail for Wordpress that may be of help to others trying to get gmail/SMTP to work:

Gmail/SMTP/Wordpress Setup

jmkpost

I used your update in #14 above since I was having similar problems in my UNO based project. After this mod I attempted to compile my sketch and I get the following errors:

/home/pi/sketchbook/libraries/ESP8266/uartWIFI.cpp: In member function 'int WIFI::ReceiveMessage(char*)':
/home/pi/sketchbook/libraries/ESP8266/uartWIFI.cpp:204:27: error: 'class String' has no member named 'c_str'
/home/pi/sketchbook/libraries/ESP8266/uartWIFI.cpp:235:20: error: 'class String' has no member named 'c_str'
/home/pi/sketchbook/libraries/ESP8266/uartWIFI.cpp:245:20: error: 'class String' has no member named 'c_str'

This is my first effort to use ESP8266 and I am basing it off of your Alarm System hack project. Thanks in advance for any ideas you have for the fix. btw, I get the same error when I attempt to compile the example "wifiTest" sketch:

/home/pi/sketchbook/libraries/ESP8266/uartWIFI.cpp: In member function 'int WIFI::ReceiveMessage(char*)':
/home/pi/sketchbook/libraries/ESP8266/uartWIFI.cpp:204:27: error: 'class String' has no member named 'c_str'
/home/pi/sketchbook/libraries/ESP8266/uartWIFI.cpp:235:20: error: 'class String' has no member named 'c_str'
/home/pi/sketchbook/libraries/ESP8266/uartWIFI.cpp:245:20: error: 'class String' has no member named 'c_str'

DonEduardo

I think its your version of the Arduino IDE. I'm using 1.0.5.

pRoFiT

Hmm. looking at your code i can cut the alarm and bypass it during the LED blink. i will have half a second to do it. or i guess pull the pin high and it will never trigger.

A better option might be to set the pin to an interrupt. Use attachInterrupt function.

See helpful video i found on YouTube. https://youtu.be/bmPKQzpnCeU?t=5m10s the example code starts at 5 minutes in :)

or old school just have a loop timer and a single smaller delay of 10ms and invert LED every 50 loops.

Also, i wanted to mention a cheaper solution. With arduino IDE 1.6.4 you can add third party boards to the IDE. You can add ESP8266 as an arduino type board and program it directly. No need for the UNO board. A nice solution is the HUZZAH ESP8266 from adafruit. Or if you want to have a usb connection you can get the nodeMCU ESP8266 which gives you break outs to all the i/o on the ESP.

check this page out https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout/using-arduino-ide

DonEduardo


Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy