Skip to content

Operation

John M. Wargo edited this page May 11, 2020 · 4 revisions

Copy your personal Google Calendar project's client_secret.json file (downloaded when you created your Google account) to the pi-remind-hd folder you just created. With everything in place, execute the reminder app using the following command:

python ./remind.py

Before the app can access the calendar, you'll need to authorize the app to use the Google Calendar API for your calendar account. When you launch the app for the first time (using the command shown above) the browser will launch and walk you through the process. With that complete, PI Remind should start watching your calendar for events.

Note: It often takes the browser a while to open up during the Google Calendar authorization. If the process times-out because of this, simply open the Chromium browser before executing remind.py.

Starting The Project Application Automatically

There are a few steps you must complete to configure the Raspberry Pi so it executes the the reminder app on startup. You can read more about this here: Autostart Python App on Raspberry Pi in a Terminal Window.

Note: Don't forget to authorize the Google Calendar API to access your Google Calendar by running the manual startup process described in the previous session before enabling autostart.

If you don't already have a terminal window open, open one, then navigate to the folder where you extracted the project files (if you followed my earlier instructions, you should have the files in /home/pi/pi-remind-hd/). Make the project's bash script file executable by executing the following command:

chmod +x ./start-remind.sh

Next, you'll need to open the pi's autostart file using the following command:

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart

Add the following lines to the end (bottom) of the file:

@lxterminal -e /home/pi/pi-remind-hd-notify/start-remind.sh

To save your changes, press Ctrl-o then press the Enter key. Next, press Ctrl-x to exit the nano application.

Reboot the Raspberry Pi; when it restarts, the python remind process should launch and execute in its own terminal window.

Note: Because of the way we're starting this terminal process on startup, every time a user logs into the Pi, it will launch a terminal window for that user and run the remind.py script. This shouldn't matter when you're running the pi headless (with no monitor and keyboard), but when you remote into the Pi (using something like Windows Remote Desktop), your remote session will get its own version of the Remind application. In the initial version of this project, I included instructions to edit the user's autostart file: sudo nano ~/.config/lxsession/LXDE-pi/autostart but that file no longer exists on current versions of the Raspbian OS.

Changing the Google Profile

If you need to change the Google profile used by the Remind app, complete the following steps:

  1. Login to your Raspberry Pi device
  2. In the terminal window running remind.py, press CTRL-C to stop the process
  3. Open the Pi's File Manager and navigate to the pi-remind-hd folder shown in the following figure
  4. Delete the project's token.pickle file
  5. Run the remind.py application using the instructions above to configure the new profile.