Checking Gmail Inbox with the Process class and the Curl command
This code checks for unread messages under a specific label in the Gmail Inbox The label can be specified via REST webservies, thanks to the Bridge Class (included in the process Class) and then saved on a configuration file in the local file system so it will be available after the reboot A LED on Pin 13 will inform about the presence of unread messages The number of unread messages for the specified label will be displayed on the 7 segments LED display
Arduino Yun with LED connected to pin 13 and a MAX7219 based 7 segments LED display
on pins 10, 11, 12
I used this one: http://dx.com/p/8-segment-led-display-board-module-for-arduino-147814
Code by Stefano Guglielmetti and Massimo Ronca 2013
Based on the ShellCommands Example by Cristian Maglie and Tom Igoe and on the LedControl library examples from http://playground.arduino.cc/Main/LedControl
This example code is in the public domain.
const String username = "USERNAME"; const String password = "PASSWORD";
with your actual Gmail username and password.
Then upload it on Arduino Yun Arduino Yun must be connected to the internet
Put a led on Arduino's digital pin 13
If you want to add the 7 Segments LED Display, use a MAX7129 display (I used http://dx.com/p/8-segment-led-display-board-module-for-arduino-147814)
- pin 12 to the DataIn
- pin 11 to the CLK
- pin 10 to LOAD
plus, obviously, +5V and GND :)
Before uploading the sketch, you have to manually create the /root/gmail_settings file, to do that you have to open an SSH session to the Yún
and once you're in, create the settings file
Configure a label on Gmail, apply some filters, then point your browser to http://arduino.local/data/put/label/LABELNAME and replace LABELNAME with your label. Arduino will turn the led ON if there are unread messages under that label, and the LED display will show the number of unread messages.