Skip to content

Render data from Google Sheets / Calendar on Amazon Kindle

Notifications You must be signed in to change notification settings

andgineer/docker-iot-calendar

Repository files navigation

Build Status Coverage Docker Automated build

Docker Hub container that generates image for Amazon Kindle.

calendar

The image contains calendar with events from Google Calendar - supposedly events from your IoT devices (like Smart wifi button (Amazon Dash Button hack)).

You can point your Kindle browser to html-page that updates the image every minute. So you can see the calendar on your Kindle.

Usage

Read description in my blog.

Prepare environment

Detailed manual how to create Google and open weather credentials is in the blog post mentioned above.

Roadmap:

  • Create Google project
  • Create Google service account
  • Enable Google Calendar API
  • Create key -> Add Key -> JSON
  • replace amazon-dash-hack.json in amazon-dash-private folder with downloaded file
  • Create Google calendar wheret your IoT device will publish events (like Amazon Dash Button)
  • Share Google calendar with service account
  • Create OpenWeatherMap API key and place it into amazon-dash-private/openweathermap.key file

Local run

Prepare secrets as described in the blog post mentioned above.

Copy amazon-dash-private folder up one level, so it will be in the same folder as docker-iot-calendar project. Place your secrets to this folder copy.

Run in the docker-iot-calendar folder:

make run

Local address for the calendar page http://localhost:4444

Development

Packages

At first I thought it would be great idea to use svgwrite, and cairosvg, but then decided otherwise and use matplotlib instead.

Development dependencies

To install system dependencies in Mac OSX (if you want to run it outside docker container):

brew update
brew install cairo

Matplotlib fonts

You have to install Humor font, xkcd font or xkcd font and Comic Neue.

If you already had matplotlib installed, after font installation you have to remove ~/.matplotlib/fontList.json.

HTTP server

As HTTP server I use tornado.

Local debug

Create and/or virtual environment (note two dots):

. ./activate.sh

Now you can run debug code or debug the application, for example

python src/iot_calendar.py

Performance

https://andgineer.github.io/docker-iot-calendar/builds/benchmark

Coverage report