Raspberry Pi: Wall Mounted Calendar and Notification Center

558,981

2,852

190

Introduction: Raspberry Pi: Wall Mounted Calendar and Notification Center

Before the “digital age” many families used wall calendars to show a monthly view of upcoming events. This modern version of the wall mounted calendar includes the same basic functions:

  • A monthly agenda
  • Sync of family members activities
  • Easy browse between months

Beyond those basic functions this gadget will also handle:

  • A whether forecast
  • Upcoming events in the surrounding area
  • Live information about the public transport
  • And even more...

What you need:

(Inspired by the instructable by Piney https://www.instructables.com/id/Raspberry-Pi-Wall-...)

Step 1: The Hardware

This is the hardware setup.

  1. Find a LCD laptop screen . Order a controller board on Ebay. Search for LCD Controller Driver Board and the serial number of your laptop screen.
    Read more: https://www.instructables.com/id/Old-laptop-screen-..
  2. Craft a piece of wood. Height should be more than 30mm, so the electronics can fit inside. The width and height depends on the size of your laptop screen, have a margin for an extra 10 mm on all sides. Carve out and make room for the electronics on the back. Drill holes for the buttons and wires.
  3. Fasten the laptop screen. I used the orginal mounting frame from the laptop.
  4. Cut out foamcore with equal thickness as the screen. and glue it on the wooden slab.
  5. Cover all sides with cork. Cut with a “snap-off blade knife” and glue with “glue spray”.
  6. Mount the Push Buttons. Use a large drill, and drill carefully by hand.
  7. Connect the electronics. Connect three of the Push Buttons to GPIO-pins 19/20/21 and to ground. https://ms-iot.github.io/content/images/PinMappin... Find out the pin for On/Off button for the controller board, and connect it with the fourth Push Button. (You will find it by trying to connect ground to each pin, suddenly the LCD will light up). Finaly, connect the HDMI cable between Raspberry and controller board, and connect the screen to the controller board.

Step 2: The Software

The setup is somehow turning the Raspberry Pi into a kiosk. The OS will auto start a website in full screen mode,
and the Push Buttons is used to control the information at the website. The setup is:

  1. Install Raspbain on Raspberry Pi
    (https://www.raspberrypi.org/documentation/installation/noobs.md)
  2. Sign up for a Google Calender. (https://calendar.google.com). Add your upcomming event. Ask for access to your family members calendar, or create a speceific "family calender" and give the rest of the familiy acess to it. Make your calendar more dynamic by adding external calenders. Facebook events, public holidays, and week number has been practical for me. More inspiration here: http://lifehacker.com/the-coolest-things-you-can-a...
  3. Set up a webpage and a webserver
  4. Install a web browser and customize the calendar design
  5. Set up the push buttons

Continue reading for details about 3-5 .

Step 3: Create a Webpage and Webserver

The webpage is the canvas the Raspberry Pi will display. The canvas can be filled with any information. I will show you how i to embed a google callender. The embeed code is generate by googles own aplication. This youtube shows how to get it to work: https://www.youtube.com/watch?v=2tnYwbs-yDk

Google Calendar have built in keyboard shortcuts. Press N and the next month will appear, press P and the previously month is shown. This will only work when the < iframe > is in focus. I have created a JavaScript that ensure that focus is correct.

An example file of html code is attached (change name from index.html.txt to index.html). For privacy, I have replace some of the code with “*___REPLACED___*”. Instead, use the embeed code generated by google.

Either put the index.html file on your own webhost, or turn your Raspberry Pi into a webserver and host it local. If you already have a webhost continue to the next step. Install a webserver by following this guide: https://www.raspberrypi.org/documentation/remote-a... Now save your modifed index.html to /var/www/html/index.html, like this:

sudo cp index.html /var/www/html/index.html

Step 4: Install a Web Browser and Customize the Calendar Design

There a many web browser out there. But I have only find one that can handle these three requirements; 1) can handle the modern version of google calendar, 2) has a full screen mode, 3) can run a local CSS. The local CSS is used to change the appearances of the google calendar. The redesign can’t be done at the webpage, because the CSS are embedded from another server (the google-server).

Install Iceweasel (Firefox for Linux)
https://www.youtube.com/watch?v=69fwZ8yMnz0

Install this extension for Iceweasel:
https://addons.mozilla.org/en-US/firefox/addon/stylish/

Open the “Stylish” extension tab in Iceweasel and customize the CSS to make the google callander look better. Se attached file i for an example.

Now, lets make Iceweasel to autostart and open your webpage at login. Type this in the Linux terminal:

cd /home/pi//.config/autostart
nano cal.desktop 

Write the following to the file. Change "localhost" to adress where your canvas-webpage are stored. Save and exit.

[Desktop Entry]
Type=Application
Name=hemsida
Exec=iceweasel localhost
StartupNotify=false

Step 5: Set Up the Push Buttons

The Push Buttons is used to browse forward and backwards in the calendar month view. By default this is done by pressing “p” and “n” at a keyboard. Therefore the buttons will emulate those two keyboards commands.

First, create a python script to make the push buttons work: http://razzpisampler.oreilly.com/ch07.html

Download and install python-uinput, a python API to create virtual keyboards: http://tjjr.fi/sw/python-uinput/ Raspbian comes with both Python 2 and Python 3. Make sure you install uinput with the version you are using.

Put the uinput-API and the button script together. The final python scipt is attached.

Auto-start the python script on startup: https://www.instructables.com/id/Raspberry-Pi-Laun... Our launcher.sh will look like bellow. Replace “/home/pi/py_switch” to the path where you have stored the python script.

cd /
cd /home/pi/py_switch
sudo modprobe uinput
sudo python switch.py
cd /

That's all!

UPDATE:

The number of possible commands can be extended with some if-else-statements in the python code. I have attached an upgraded switch.py-file in this step. The new is script has the following commands.

  • Press button 1 -> Key press “P” -> Browse previously month
  • Press button 2 -> Key press “N” -> Browse next month
  • Press button 3 -> Key press either "M" or "A" -> alternate between month-view or agenda-view
  • Long-press button 3. -> Key press "F5" -> Reload the webpage
  • Simultaneous press button 1, 2, 3 -> executes the shell command “sudo reboot” -> Restart of raspberry pi.

22 People Made This Project!

Recommendations

  • Water Contest

    Water Contest
  • Metalworking Contest

    Metalworking Contest
  • Fix It! Contest

    Fix It! Contest

190 Discussions

Hi,

Do any of those that have made this project know if it would run on a Pi Zero?

Cheers

2 replies

Having tried very hard to make this work reliably on a Pi B+, I wouldn't advise using a Pi Zero. From personal experience I'd recommend a Pi 2 or 3 for this.

I have this running on my pi zero w, and it seems to run well. I'm using Firefox ESR instead of Chrome, and serving index.html with Apache.

Also using mfull extension to force full screen on startup.

The CPU usage is high, but since this is it's only job, I'm not concerned about it

I was unable to get the Darksky weather to display, apparently a problem finding a link or file, so I changed to WeatherWidget.io, which works very well, and is also free.

I am about to tackle the button set-up.

?Hello,
Thanks for the scripts, may I suggest to add an extra time.sleep(0.1) at the very beginning of the loop ? otherwise your processor ( top ) will be almost 100% dedicated to run the python script ...


cheers !

1 reply

So, you're exactly right about the CPU being over taxed by the python script. In fact, I have one core almost fully dedicated to chrome and one for the python script. I am looking for suggestions on how to fix this. With your time.sleep(0.1) suggestion, where exactly would that be placed in the script? I read your suggestion to put it at the beginning of the loop. Does that mean in the loop or before it? If you can, would you define that a little more? Thank you.

Has any one figured out a solution for reducing the CPU usage for the Button Script? I just ran the script on my RPi 3 and it tops out and hold near 90%. I would like to use the script just to refresh the screen.

Hey guys, so i just found this project and am looking to build it.

i was reading through and decided to check the pinout stuff.
according to :http://www.raspberry-pi-geek.com/howto/GPIO-Pinout... the pinout for 19,20,21 would mean that GPIO 10, Ground & GPIO 09 are being used, is this correct.

Hooking up the buttons is the one thing im slightly confused on.

Looks like in the picture 1 button is also connected to another with one of the wires. Im am not familiar with these types of buttons so that may also be part of the confusion.

Is someone able to put together a wiring diagram for the button and pinout please.

Thankyou.

1 reply

Also id be looking at using a pi3, does anyone know the pins for the pi3
looks like the pinout doesnt change but just want someone with way more knowledge than me to confirm.

I hope someone can help. I got this up and running with a RPI3, old laptop monitor + controller board with HDMI input. Everything worked perfectly until I assembled it in a frame. Now sometimes (almost every time) that I use the button to turn the monitor off, when I turn it back on, the calendar goes into constant 'next month' mode and won't stop until I pull the wire off the GPIO pins. If I put the wire back on, it continues cycling through the months.

I can't see how this is happening. If I totally unplug everything, starting up the unit again seems fine, but as soon as I turn off the monitor and turn it on again, boom: next month forever.

The monitor power button is not connected at all to the RPI, it's connected directly to the controller board wires for the monitor. The only thing that connects the two pieces together is the HDMI cable. Is there any way that info is being relayed from the controller board back to the RPI that would affect the python script waiting on button presses?

Also, I used Chromium and for the life of me I cannot find the right setting or command line parameter to prevent it from trying to restore previous sessions when I crash or have to reboot from SSH. It always prompts with the 'some tabs did not close, want to revert' message. Any help there?

1 reply

(EDIT) I closed the browser, opened up a text editor and then tried turning the monitor off and on, and somehow it is actually returning a keystroke. In that case, it returned a P in the text editor. Same result after several attempts. How can the monitor being turned off and on be interpreted as a keystroke? Has to be related to the python script constantly waiting on a keypress, but I don't know how or why.

I was able to make the calender web sever however it in another language. Dose any one know how i can change it to English

Hi

I'm not very bright when it comes to electronics... Would somebody be willing to show me how to cable up the four horn buttons? I have exactly the same ones as in the photos above but I can't quite make out how they are attached. Or if anybody has another way of doing so, could you show me with some really clear pictures? Thank you so much :)

Anyone else having problems with the hotkeys not working anymore? I had the project 90% completed a few months ago and then when I went back to it the hotkeys (buttons I used or the keyboard) no longer change the months back and forth. When I go to the address on my pc I am able to use the hotkeys but not on Iceweasel or Chromium. Any ideas? They did work a few months ago I don't know if something changed with an update or an upgrade

Thanks for any tips

2 replies

I'm having the same issue with hotkeys not working on an embedded calendar.

I guess thats good news. Its not just me. I put a ton of work into the display. My button box is made from marble and I have a 7" screen. It looks real nice but there is no point in having the buttons if I can't go back and forward. I sent a message to the author but have not heard back yet. I will let you know if I do. Its frustrating because I know they did work at some point.

Does anyone have a github of their code? I'd love to take a look at how other people are setting their webpage/webserver up

Fantastic project, I am going to dive into this myself as my first RP project!
Can anyone tell me an approximate timeframe for the build?

0
None
StM7

1 year ago

I have only one question - with a touchscreen I am not able to
modify anything. Yes, I can click on events that had been created in the
Calendar before but if I want to create a new event without going to
the button Create in Google calendar, I cannot do it. If I click on,
let's say, today's date, nothing happens. Going through Create button in
Google Calendar will. On Android it works either way. Do you know how
to resolve this problem? Maybe certain settings in the Calendar, even
though I have a touch screen at work and it works in Windows without
problem but in Iceweasel on Raspbian it is not. Thank you

2 replies

It looked like it had USB ports. How about a small USB Bluetooth dongle and a blue tooth keyboard. I have a Bluetooth keyboard for my Android tablet and it is wonderful, but I can cut it off and stick it on a shelf. If you only need to make changes occasionally, this may be the way to do it.

Bonus: the Pi 3 has built-in Wifi and Bluetooth.