Raspberry Pi Wall Calendar

March 29, 2017 @ 19:48 - Michael

Categories: GeekLifeTech

I recently decided to take it upon myself to build a wall-mounted simple calendar using a RaspberryPi I had laying around, trying to make it as lightweight as possible and without depending on other services (except for Google Calendar where the calendar actually lives). Here I'm going to put together as much information surrounding this build as I can.

Hardware (including the prices I paid when I ordered):

Product Price Notes
Raspberry Pi B2 $35 (Had this on-hand, bought years ago when it first came out.
Wifi Adapter $5 I used an adapter I had laying around from an original Pi project I wasn't using anymore, pretty much anything should work.
Acer V226HQL 22" Monitor (Amazon) $89.99
AmazonBasics HDMI-DVI 3' adapter (Amazon) $5.49
AUKEY USB Wall charger (Amazon) $9.99
Anker 1' microUSB Cable (Amazon) $14.99 I only used 1 of the 6 cables included in this set, but the cables have always held up well and work great for other things.
Generic 8' extension cord (Amazon) $7.24
3M Command Strips #17201-ES (Amazon) $2-4 I bought these from the local Home Depot as it was easier to determine what exactly I had for options and what I wanted to use.
3M Command Strips #17206-ES (Amazon) $2-4 I bought these from the local Home Depot as it was easier to determine what exactly I had for options and what I wanted to use.
Total ~$170

For the software, I simply used the default Raspbian distro. I installed Firefox to use for the browser and installed the mFull extension to allow for full-screen setup and set Firefox to autolaunch.

I wound up using 3M command strips for all of the mounting as I didn't want to try and drill into the walls in the apartment (and subsequently need to patch them when I moved out). It also worked great to mount the plugs to the open space behind the display panel.

The code that I used for the simple html file I'm using is below, obfuscated for obvious reasons.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<html><br />
    <head><br />
        <!-- This is the line that refreshes the calendar every 300 seconds. --><br />
        <meta http-equiv="refresh" content="300" ><br />
        <title>Home Calendar</title><br />
    </head><br />
    <body style="background-color:#CCCCCC;"> <!-- I didn't want a completely white background, but not very dark either. --><br />
        <center><br />
            <!-- This is a widget from timeanddate.com: https://www.timeanddate.com/clocks/free.html --><br />
            <iframe src="REDACTED" frameborder="0" width="322" height="74"></iframe><br />
            <br/><br />
            <!-- This is one of Weather Underground's free "stickers" that you can get (they're the best I could find but I'm still not completely happy with them): https://www.wunderground.com/stickers/ --><br />
            <span style='display:block !important; width: 488px; text-align: center; font-family: sans-serif; font-size: 12px;'><a href='REDACTED' title='LOCATION Weather Forecast'><img src='REDACTED' alt='Find more about Weather in LOCATION' /></a></span><br />
            <br/><br />
            <!-- Here I just used the embed code from Google Calendar, did two separate embeds, one for the month view and one for the agenda view --><br />
            <iframe src="REDACTED" style="border-width:0" width="900" height="800" frameborder="0" scrolling="no"></iframe><br />
            <iframe src="REDACTED" style="border-width:0" width="900" height="800" frameborder="0" scrolling="no"></iframe><br />
        </center><br />
    </body><br />
</html>

I used 2 simple bash scripts in a cron to turn the monitor off at night and on in the morning.

crontab:
# m h  dom mon dow   command
0 7 * * * /home/pi/screenon.sh
0 23 * * * /home/pi/screenoff.sh
screenon.sh:
/usr/bin/tvservice -p
chvt 1
chvt 7
screenoff.sh:
/usr/bin/tvservice -p
/usr/bin/tvservice -o

The obligatory pictures of the finished product.

Raspberry Pi Wall calendar

So far I've had no issues with this setup. I've also enabled VNC and SSH on the pi for management without needing to disturb the setup.

Hopefully this information helps someone else!

-Michael



Comments