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:
Beyond those basic functions this gadget will also handle:
What you need:
(Inspired by the instructable by Piney https://www.instructables.com/id/Raspberry-Pi-Wall-...)
This is the hardware setup.
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:
Continue reading for details about 3-5 .
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
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
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)
Install this extension for Iceweasel:
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
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 /
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.