Home‎ > ‎Sergey's Projects‎ > ‎

Internet Connected Calendar using Intel Galileo

Introduction

You have a calendar application on your computer or a smartphone, but sometimes it might be useful to make it easily viewable to others (or even to yourself). This project describes how to make an Internet connected calendar. Particularly it uses Google Calendar service. The project is not complicated to make, but it assumes you're familiar with Galileo (if not, read this excellent Getting Started Guide).
You're going to need the following supplies:
  • Intel Galileo board, with power supply and USB cable (either Gen 1 or Gen 2 will do)
  • An LCD or VFD display with parallel (Hitachi HD44780 compatible) interface. The code assumes using two rows display (some modifications will be needed for 4 row displays). For LCD you're also going to need a 10 kohm potentiometer for contrast adjustment.
  • Some wires to connect LCD to Galileo. Possibly a breadboard.
  • Console cable (RS232 type for Galileo Gen1, or USB to serial converter for Galileo Gen2). It will be useful for installing and configuring software on the Linux side.
  • Micro SD card, big enough to fit Galileo SD image.
  • Ethernet cable - for wired connection.
  • Mini PCI-e wireless card and antenna for wireless connection (see my blog for parts).
  • Battery for RTC and a battery holder with header (3V, a CR2032 or similar lithium battery, or a pair of AAA batteries). This to keep RTC running while board is powered off.
  • A Google account with a calendar.

The Hardware

For wireless connection - install PCI-e card, and connect antenna as described in my blog.

Next connect LCD display to Galileo as described in Arduino LCD tutorial.

Connect the serial console. I posted instructions for Galileo Gen 1. For Galileo Gen 2 a cable with built-in serial to USB converter can be used.

Connect the RTC battery to the header on the Galileo. Make sure to observe the polarity.


The Software

The project two software components: GoogleCL for querying Google Calendar, and a sketch to parse and display information on the LCD display.

Installing Arduino IDE and Linux SD image

Download and install Arduino IDE for Galileo. Also download Linux Image for SD card. Both downloads are available from Intel Download Center. Plug Micro SD card to your computer, and unpack Linux image to that card. Make sure to preserve directory structure - all files except of grub.conf should be in root directory of SD card, the grub.conf should be in boot/grub/grub.conf.

Configuring Network

Wired network using DHCP

Galileo SD image comes with wired Ethernet enabled, and configured for DHCP operation. So just plug your Galileo to your switch or router and you're done!

Wired network using a static IP address

Connect to your Galileo with serial console and as 'root' user. Edit /etc/network/interfaces file, change iface eth0 inet dhcp to iface eth0 inet static and add the configuration for your Еthernet interface. For example:

auto eth0
iface eth0 inet static
    address 192.168.1.10
    netmask 255.255.255.0
    gateway 192.168.1.1
    dns-nameservers 8.8.8.8 8.8.4.4

Wireless network

Please refer to Configuring Wireless In Linux / Intel Supplied SD Card Image on my blog page.

Installing and Configuring GoogleCL

Download gdata-python-client and GoogleCL. You can either download these files from your computer and copy them to the Micro SD card, or connect your Galileo to the network and download these files using wget command:

cd /media/mmcblk0p1/
wget http://gdata-python-client.googlecode.com/files/gdata-2.0.18.tar.gz

wget http://googlecl.googlecode.com/files/googlecl-0.9.14.tar.gz
cd ~

Connect to your Galileo with serial console and login as 'root' user.

Unpack and install gdata:

tar zxvf /media/mmcblk0p1/gdata-2.0.18.tar.gz
cd gdata-2.0.18
python setup.py install --record=files.txt
cd ..

Unpack and install GoogleCL

tar zxvf /media/mmcblk0p1/googlecl-0.9.14.tar.gz
cd googlecl-0.9.14
python setup.py install --record=files.txt
cd ..

Set the current date in Galileo Linux and write it RTC. The format of the date is MMDDhhmmCCYY, where MM - month (01 to 12), DD - day of month (1 to 31), hh - hours (24 hours format, so from 00 to 23), mm - minutes, CCYY - 4 digit year (e.g. 2014)

date 100917002014
hwclock -w

Finally run google calendar list command. First time it will ask for Google account email address, and will provide a URL to register the application.

Installing the sketch program

Download the sketch code from the Files section at the bottom of this page. Launch Arduino IDE, open the sketch, and upload it to the Galileo.

Customizing the sketch

Number of display columns

If your screen has a number of columns is different from 24, update the following line accordingly:

# define LCD_COLUMNS 24

Display connection

Modify the pin numbers in the following line according to the pin numbers your LCD/VFD display is connected to.

LiquidCrystal lcd(8, 13, 2, 3, 4, 5);
  • The first number (8) - the pin number LCD RS signal is connected to
  • The second number (13) - the pin number LCD Enable signal is connected to
  • The last four numbers (2, 3, 4, 5are the pin numbers LCD D4-D7 signals are connected to

Calendar query

The sketch uses the following command command to run googlecl:

system("HOME=/home/root TZ=PST8PDT google calendar list -d today,tomorrow --cal=.* > /media/realroot/calendar.txt");

This will query all the calendars you're subscribed to (and have access to), for the current day (today), and the next day (tomorrow).

Here are some possible modifications:

  • Change -d argument to specify the desired day or date, or a range of them. See Google CL Manual for examples.
  • Change --cal argument to specify what calendars you want to query. The argument is a regular expression.
  • The command line includes setting TZ variable. Change it to your time zone, so that event times are displayed correctly in your local time.
ą
Sergey Kiselev,
Jun 8, 2015, 9:08 AM
ą
Sergey Kiselev,
Oct 10, 2014, 4:33 PM
ċ
ShowGoogleCalendar.ino
(3k)
Sergey Kiselev,
Oct 10, 2014, 4:39 PM
Comments