Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


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

The circuit: 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:

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

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

and connect

  • pin 12 to the DataIn
  • pin 11 to the CLK
  • pin 10 to LOAD

plus, obviously, +5V and GND :)

the hardware



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

$ssh root@arduino.local

and once you're in, create the settings file

$touch /root/gmail_settings

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.

You can’t perform that action at this time.