Translate

Monday, January 18, 2021

Raspi calendar - HW-SW

 OK, this is my set up for a calendar display using a Raspberry Pi.

Is quite a while that I wanted to have somewhere a calendar display and was considering different solutions, then one weekend I decided to do something about.

The goal is to have somewhere (kitchen maybe) a monitor showing the Google calendars of the family.
Here some notes.
I'm assuming who is reading this article knows how to set up a Linux system, I'll not describe in details many operations.

First of all there are TONS of projects like this one.
Literally nothing new. I just want to document what I did.

Shopping list

Let start with the shopping list :

  • a Raspberry Pi (I used a Raspberry Pi 3 Model B)
  • a SD card (at least 8 Gbyte - I did use a 16 Gbyte Sandisk card I had around)
  • a monitor, in my case one of the many old VGA monitor I have around, a Dell  (see below)
  • a HDMI -> VGA converter
and only for setup time :
  • wireless mouse/keyboard (with dongle)

Putting together

The Raspberry Pi used already has WiFi and Bluetooth on board so I didn't need for additional dongles, at least for WiFI (Bluetooth is not used).
Connected the dongle for the keyboard and the HDMI -> VGA converter and then connected the monitor.

SD card preparation

I did download one of the latest Raspbian images and then I did copy it on a 16 Gbyte SD card.

I did try to use a smaller card (4 Gbyte) but doing so updates will likely fails since latest Raspbian releases do quite big updates.
So, since the cost is anyway ridiculous, stick with at least 1 16 Gbyte SD card

Note !
I strongly suggest to avoid PNY SD cards !!
I did buy a bunch time ago and NO ONE is still working !!!
They broke very very easily after few writings. 

Anyway, what I did was just to copy the downloaded image "as is" on the SD card using the dd command.
Remember to unmount the drive (not close it !! Just unmount it) before to start the dd command.

In my case the SD card was seen as /dev/sde, the card I used had two partitions on it thus I did  :
  • open a session on terminal
  • use df -h to identify the card and partitions
    Found two partitions under /dev/sde
  • unmount the two partitions found :
    • umount /dev/sde1
    • umount /dev/sde2
  • go in the directory where the downloaded image was :
    • cd <whereever_the_image_is>
  • copy the downloaded image on the SD card
    • sudo dd bs=4M if=2020-02-13-raspbian-buster.img of=/dev/sde status=progress
SD card ready

Configuration

The ultimate goal is to have a system :
  • connected wirelessly
  • showing a constant update of the Google calendar in kiosk mode
  • turning off the monitor at 10 pm until 7 am of the next day
After inserting the SD card in the Raspberry, turned on everything and see the first boot going ok.
With the attached  keyboard and mouse I started to update the system.

Raspberry configuration

The latest image (Buster) has a GUI entry for the Raspberry configuration but it can be done also using the raspi-config via CLI.

First enabling the SSH server and WiFi in order to be able to remotely log in.
If not done before, also :
  • expand the filesystem to use all the SD card space
  • change the main user password (main user : pi)
  • enable boot to desktop (should be already set)
  • set language/regione and time zone
  • set an hostname to recognize the board on your network
  • reboot the system

Raspbian configuration

As soon as the WiFi connection was up, updated the system (it can take quite a while !!).
  • sudo apt-get update
  • sudo apt-get upgrade
  • sudo apt autoremove

Iceweasel

Then installed Iceweasel, is a version of Firefox (actually installing Iceweasel it installs also Firefox-esr.
Iceweasel will be executed in kiosk mode, so before to set up that all the configurations need to be done.
Once installed, log in to the google account, save it, go on the calendar page.

Removing cursor and avoiding sleep

Install unclutter to remove the cursor when the mouse is not used (sudo apt-get install unclutter) and edit the lightdm.conf to prevent powersave/sleep mode :

  • open the file with an editor :
    sudo nano /etc/lightdm/lightdm.conf
  • add/modify the section [Seat*] adding the line :
    xserver-command=X -s 0 –dpms
  • save 

Turning monitor on/off

To turn the monitor on and off I use cron and the command vcgencmd .
Note that the command vcgencmd could not work on some monitor, it did work on my setting though.

Turning LED off

Both for power savings and reduce light in the environment, is better to turn the Raspberry Pi LED off.
To do so, on Buster and for the board I used, is enough to edit the file /etc/rc.local and add these lines :

sudo sh -c 'echo none > /sys/class/leds/led0/trigger'
sudo sh -c 'echo none > /sys/class/leds/led1/trigger'
sudo sh -c 'echo 0 > /sys/class/leds/led0/brightness'
sudo sh -c 'echo 0 > /sys/class/leds/led1/brightness'

Set autostart

This is the last part.
Set up the system in order to start the Iceweasel in kiosk mode on the google calendar page.

Update

The system did work nicely, however the boss objected to hang on the contraption somewhere in the kitchen or elsewhere.
The monitor, a Dell Old VGA LCD, is a little bit bulky and the cables used to connect the Raspberry Pi are visible and thus ugly.

So I'm exploring some other options.
In my stash of junk I did find a 7" HDMI monitor (Z-0051), not in a case, thus it could be suitable to embed it in some kind of frame or even a mirror.

Test assembly

In another article I'll discuss eventually how to create the mechanical support for it.

Here just a note about how properly configure the Raspberry Pi for it.

"As is" connected to the Raspberry it works nicely, however the resolution is set a 640 x 480, so everything is ut of scale and quite unusable.

In order to set up the resolution is necessary to edit the file /boot/config.txt

Edit this file and somewhere add these lines :

# Force 1024x600
hdmi_force_hotplug=1
hdmi_cvt=1024 600 60 3 0 0 0
hdmi_group=2
hdmi_mode=88

Save and reboot, everything should be displayed fine now.

No comments:

Post a Comment