Espressif Systems ESP8266 Beginner's Manual page 49

Hide thumbs Also See for ESP8266:
Table of Contents

Advertisement

Email notifier
Another great use for IoT devices is displaying things like traffic information, weather forecast, social media updates ... This requires
us to send an HTTP GET request to the server of the service we'd like to access. Most popular services have API (Application
Programming Interface) documents that explain that explain how you can retrieve certain information, and what format that
information is in. In the following example, we'll look at Gmail specifically, but the code should be similar for other services.
Showing the number of unread emails
To communicate with Google's Gmail servers, we have to establish a secure connection to the server and send a secure HTTPS request
with our email address and password. Gmail will then respond with an XML document containing all kinds of information, like (parts of)
your most recent messages and the number of unread emails.
To make sure we don't send our Google password to a malicious server, we have to check the server's identity, using the SHA-1
fingerprint of the SSL certificate. This is a unique sequence of hexadecimal characters that identifies the server.
Allowing access to the email feed
The only way (I know of) to get email information from Google on the ESP currently is the Google Atom Feed. This is an older method,
so you have to change your Gmail settings to allow access to the feed.
Go to https://www.google.com/settings/security/lesssecureapps to enable access for "less secure apps":

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP8266 and is the answer not in the manual?

Questions and answers

Table of Contents