Secondary Menu

Intel IoT Edison Google Calendar Reminder

Introduction: Intel IoT Edison Google Calendar Reminder

Did you ever fail to notice that Google Calendar utterly important event? Not anymore with the Intel IoT Edison Google Calendar reminder!In this instructable we'll configure step by step an Intel® Edison Arduino Board, so that it notifies you about upcoming events from your Google Calendar, by displaying the event summary and location on the Grove RGB LCD screen and even buzzing you a bit with the Grove Buzzer!

Actually, you could use the code presented here to schedule your Edison to do stuff based on your Google calendar. Eg turn the lights on/off, water the plants etc And you can change its schedule from everywhere, anytime, through Google Calendar!

I am thankful to Instructables and Intel for providing me the hardware used in this project (I was one of the 250 lucky ones!)

The Grove RGB LCD should be connected to one of the I2C ports of the Grove shield. The Grove Buzzer should be connected to port D6 of the Grove shield (the photos shown here were made before I connected the buzzer!)

Step 2: Google Calendar API

In order to access our google calendar data, we will make use of the Google Calendar API, in its current, third, iteration (v3). A prerequisite for using the API is having a Google Account (elementary, Watson), having created a project in the Google Developers Consoled and enabled the API.

With the new project created, you create a new client ID (by pressing the respective blue button). On the window that appears, you select the last option, namely "installed application" (or something similar, google insisted on not showing me the menus in english) You then proceed to fill-in a form with your new project name etc (don't put much effort in this, it's not important for our purposes) After that, in "installed application type" select "other" and create the client ID

You should now see the client-id, the client-key and some URIs. Ignore those, and press the button underneath: "Download JSON". Store the downloaded JSON file as client_secrets.json Remember where you put it, because later we will copy that to our Edison!

Step 3: Installing the Google API Python Client

This is a bit complicated: Our backend, that communicates with Google is written in Python. So, we have to install the Google API python client. And to do that, we first have to install the Python setuptools, that allow us to (quoting setuptools homepage) "easily download, build, install, upgrade, and uninstall Python packages".

After that, and provided that everything went well and you didn't get any error messages, Google API python client should be installed in your Edison.

It's time to put our code to use!

Step 4: The Python Part

Create a directory inside your /home/root directory, where you'll store the python code and your json API credentials. Copy the provided edison_google_calendar.py script to this directory (I named mine google_calendar, so I placed the files to /home/root/google_calendar) and also copy the client_secrets.json to the same directory.

If you don't know how to copy files, I suggest to install FileZilla ( https://filezilla-project.org/ ) and copy the files by establishing an SFTP connection to your Edison.

The first time you run the script, google will ask for your authorization, by providing you a link. Copy this link to a browser in your PC, approve the access and copy the provided code to your terminal. The python script will continue accessing Google Calendar happily ever after!

Attachments

Step 5: The Arduino Part

It's now time to upload our Arduino Edison part.

Create a folder in your sketchbook named edison_google_calendar and copy the two attached files to that folder:text_reader.c contains the function readFile(), which reads the file /tmp/arduino.txt and returns its contents. If no file has been created yet, it returns null.

edison_google_calendar.ino is the main arduino sketch, responsible for showing the event on the Grove RGB LCD screen and buzzing the buzzer everytime a new event comes up. If you have no current appointment, it shuts down completely the RGB LCD screen to save energy:)

After copying the files to the edison_google_calendar folder, open the Arduino Edison IDE and open the edison_google_calendar.ino sketch. Check that it compiles and upload it to your Edison.

A green screen with the message "Hello Google Calendar!!!" will greet you. The Intel Edison Google Calendar reminder is up and running! Have fun by creating and deleting events at the your Google Calendar page. Your Edison will buzz with joy every time a new event becomes active!