Skip to content

shaunhall/O365CalendarPi

Repository files navigation

O365 Calendar on a Raspberry Pi and e-Ink Display

A picture of the setup

Motivation

I found myself frequently checking my calendar throughout the day and sometimes reserving a monitor for it. This low-cost, low-power setup saves me a tab and a couple of clicks per day!

The small screen (2.13") presents a few challenges in displaying the data. I decided to show the start time of each meeting with the duration indicated by blocks on the right hand side (1 block = 30 mins). A solid line demarcates between today and tomorrow's meetings.

Hardware

Total cost is around £35

O365 Tokens

You need to register a new app against your O365 account with permission to read from your calendar. To do this:

  • Go to App Registrations
  • Create a new registration
  • The supported account type should be "Accounts in this organizational directory only". No redirect URI is required.
  • Open your registration, and under "Client credentials", click "Add a certificate or secret"
  • Add a new client secret with an expiry date of your choice
  • Make a note of your application id and value of your client secret for the deployment step (the secret ID isn't needed)

Deploying to the pi

  • Clone this repo into your desired location (e.g. /home/pi/O365CalendarPi)
  • Using your favourite text editor, populate a new file called creds.py with credentials = ('application id', 'client secret value') from the previous step
  • Create a virtual environment in this directory:
    python3 -m venv venv
  • Activate the virtual environment and install dependencies:
    source venv/bin/activate && pip install -r requirements.txt
  • Initialise your O365 token by running python init_auth_token.py. You only need to run this once.
  • Run this to check it works /home/pi/O365CalendarPi/run.sh
  • To update every 15 minutes, add the following line to /etc/crontab:
    */15 * * * * pi	/home/pi/O365CalendarPi/run.sh > /home/pi/log.txt
  • Note that it will only redraw on the screen when the data on the screen changes (this increases the lifetime of the screen).

run.sh arguments

The rotate flag determines whether to rotate the display by 180 degrees or not (default is not). e.g. ./run.sh --rotate=True

Further Work

I would like to generalise to support other calendars and support different size displays. Contributions are very welcome.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages