|Software apps and online services:|
If you work in the normal office environment, you know the pain of reserving a conference room only to find that the people in the previous meeting won't leave when it's your turn, leaving your entire group milling around outside the door while they need "just one more minute".
This project aims to give those perpetrators a countdown to the end of the meeting using a simple, easy to grasp ring display linked to the room's Google Calendar and updating every minute.
- Mainly Green: The room is currently reserved and all is good in the world.
- Mainly Blue: The room isn't reserved - you're squatting! Feel free to use it, but be ready to leave if someone who knows how to properly use a calendar suddenly reserves it!
- Yellow: The reservation is coming to an end. Just one LED marks this.
- Orange: The reservation is ending soon, but nobody is waiting for the room. Feel free to extend the reservation or run over and squat until someone else reserves it.
- RED: The reservation is coming to an end soon AND someone has it reserved right after you. GET OUT SOON! (It also buzzes a couple of times near the end.)
The system is pretty simple, it uses the Particle Photon with the InternetButton shield as a simple WiFi enabled display that just needs a USB power supply. The code on the Photon waits to be called by an external Python script which causes it to update the display, nothing more.
On the back-end, there's a Python script that talks to Google via the Google Calendar API and then calls the Particle Cloud function the InternetButton uses. Schedule this via Cron to run every minute of the workday, and you're good-to-go.
Once you have your InternetButton from Particle, you also have a Photon.
- Connect it to your WiFi network using the smartphone app. You should then see it on the https://build.particle.io interface. This is your in-the-cloud programming interface to your Particle Photon. The docs are available on the left panel.
- Select your Photon and push the Particle/Arduino code (below) to it. Use the Particle Getting Started Docs to show you how.
- While still in build.particle.io, grab your Access Token to your Particle account - you'll find it by hitting the Settings button on the lower left. Keep that for later. Link
- Now click on Devices on the left panel and select your Photon(s). Grab the Device ID. https://docs.particle.io/guide/getting-started/build/photon
Now you have a way to pull variables directly off your Particle devices and call remote functions. Detailed docs for this are here: Particle Reference
- Install Python3 and the pip package manager on an always-on computer - it doesn't have to be on the same LAN if you're using the Particle Cloud service, but it has to have Internet access. (There are hundreds of excellent tutorials on setting up Python and pip for various different environments. Google is your friend.)
- Install the required Python3 packages:
sudo pip3 install apiclient oauth2client sudo pip3 install pytz pyrfc3339 sudo pip3 install --upgrade google-api-python-client
- Save the meetingminder.py script (below).
- Copy the particles_example.json file to particles.json and update it with your personal Token (from above) and your individual Particle DeviceIDs from the Particle system, matching a DeviceID to a conference room name. The Google Calendar API docs are your friend.
- Enable the Google Calendar API by visiting https://developers.google.com/google-apps/calendar/quickstart/python and follow step #1 only. We'll do the other steps here, the important part is to have the client_secret.json file in place.
- Execute it by hand once to get the authentication codes to connect to your Google Calendar. This will read the client_secret.json file and allow you to get an OAuth2 token to authorize this Python app to view your Google Calendars.
python3 meetingminder.py --noauth_local_webserver
- Wait for it to finish after you paste the token (the first time takes a minute)
- The server is complete, now schedule it to run once per minute. On Linux, you'd add a crontab entry that looks like this to run it every minute from 8am to 7pm. On Windows, you'd use the Task Scheduler.
#Conf Room Monitor * 8-19 * * * python3 ~/scripts/meetingminder.py
- RGRGRGRGRGR: startup mode, waiting for an update
- BGwwwRwwwGB: lost connection to Particle cloud
- The Particle InternetButton has 4 buttons I'm not using... ideas?
- The Particle InternetButton has an accelerometer I'm not using.
- Instead of an annoying buzz that gets a little longer as you near the end of your GET OUT timepoint, we could have it play a tune. (Kinda done)
Did you replicate this project? Share it!I made one
Love this project? Think it could be improved? Tell us what you think!