Web kiosk application with Raspberry-pi

Raspberry PI – Photo by Jeff Loucks on Unsplash

tl;dr – install basic raspberry-pi + optimize rw + full web app on launch + maintenance (shutdown – reboot).

Note: I did everything from within a linux computer with the user: sbw

This note is to keep track of all the step I went through to make a kiosk application on the raspberry-pi.

Headless raspberry pi setup with ssh & wifi and every IO intensive in memory to prevent SDCard multiple read write

Of course the first step is to install the raspbian OS and this is well documented everywhere, however as this could serve as a step by step guide, I’ll keep track of all the steps anyway.

If you have played a lot with the raspberry pi, one issue people often come through is the SD card lifetime that could go wrong, sometimes after only a few days. The main issue there is the log files that are written on the SD card. While this can be necessary for this case I’ll choose not to have them on the SD card to improve it’s lifetime.

Finally I’ll focus on the kiosk web application in a recent and decent browser.

But let start with the installation.

Install the raspbian OS on an SD card

In Terminal

sbw@sbw-pc:~/temp/$ wget https://downloads.raspberrypi.org/raspbian_latest
sbw@sbw-pc:~/temp/$ unzip -p raspbian_latest | sudo dd of=/dev/mmcblk0 bs=4M conv=fsync
sbw@sbw-pc:~/temp/$ rm raspbian_latest
sbw@sbw-pc:~/temp/$ sync

Don’t unmount we will have to add some stuff to win some time later on.

Source: https://www.raspberrypi.org/documentation/installation/installing-images/linux.md

On the boot partition activate the ssh + wifi directly.

To enable ssh it’s quite easy, simply add an empty ssh file on the boot partition

sbw@sbw-pc:~/temp/$ touch /media/sbw/boot/ssh

Note that here my user is sbw, you may have a different user on your personal computer.

The next step is to configure the wifi

First of all you need your wifi SSID + Passphrase, for the purpose of the document I’ll have the following SSID & Passphrase: MY_HOME_WIFI – letmeinplease2019

sbw@sbw-pc:~/temp/$ wpa_passphrase MY_HOME_WIFI
> reading passphrase from stdin
> network={

You’ll want to remove the non hashed passphrase (#psk=”letme…) line from the config before storing it on the raspberry pi.

Let’s create the file that will store the network connection information.

sbw@sbw-pc:~/temp/$ vim /media/sbw/boot/wpa_supplicant.conf

And fill it with all we need for the first boot.

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

Don’t forget to write and quit (with vim ESC :wq + enter). We will end up with a raspberry pi with ssh and wifi ready.

Sources: https://hackernoon.com/raspberry-pi-headless-install-462ccabd75d0; https://desertbot.io/blog/headless-raspberry-pi-3-bplus-ssh-wifi-setup; https://raspberrypi.stackexchange.com/questions/10251/prepare-sd-card-for-wifi-on-headless-pi

It’s time to unmount and to test.

sbw@sbw-pc:~/temp/$ umount /dev/mmcblk0p1

You’ll need your raspberry-pi ip address ( for this fake case), the easiest way for me was to get it from the router.

sbw@sbw-pc:~/temp/$ ssh pi@
> pi@'s password: 
pi@raspberrypi:~ $ 

raspberry is the default password for the raspberry user.

Let change it asap with something much more complex.

pi@raspberrypi:~ $ passwd
Changing password for pi.
Current password: 
New password: 
Retype new password: 
passwd: password updated successfully

Ideally put your public ssh key in the ~/.ssh/allowed file.

pi@raspberrypi:~ $ mkdir .ssh
pi@raspberrypi:~ $ vim .ssh/authorized_keys

And copy paste your public key.

Now let’s try it: logoff and logon, it should use your ssh keys from now on.

Ok, so we have SSH + Wifi … great!

Now the real business start, first of all remove the logs from the SD card.

Remove the swap and log to ram instead of SD

We need to think about the SD lifetime. Get rid of all the SD access to ensure that the SD will live long and prosper.

To remove the swap (and avoir SD card issue) simply deactivate then remove the swap service.

sudo dphys-swapfile swapoff
sudo dphys-swapfile uninstall
sudo update-rc.d dphys-swapfile remove

Then we will create a temporary in memory /var/log.

To do this, simply add the following line in /etc/fstab

none        /var/log        tmpfs   size=1M,noatime         00

And after the reboot you should see something like:

pi@raspberrypi:/var/log $ mount
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
none on /var/log type tmpfs (rw,noatime,size=1024k)

Note that the /run and /run/lock are already in tmpfs volatile RAM file system

Sources: https://github.com/azlux/log2ram; https://raspberrypi.stackexchange.com/questions/62533/how-can-i-reduce-the-writing-to-log-files; https://mcuoneclipse.com/2019/04/01/log2ram-extending-sd-card-lifetime-for-raspberry-pi-lorawan-gateway/; http://ideaheap.com/2013/07/stopping-sd-card-corruption-on-a-raspberry-pi/

Now it’s time to boot in full screen

First of all install the very lastpackage.

sudo apt-get install -y ttf-mscorefonts-installer unclutter x11-xserver-utils

Setting locales

While we are at it, we can directly change the locale to reflect the country & language issues.

sudo vim /etc/locale.gen

Uncomment the one that match your need and then run

sudo locale-gen

Update: ssh and wifi could be done inside raspbian_latest.img

check where the boot partition start with parted

parted raspbian_latest.img
WARNING: You are not superuser.  Watch out for permissions.
GNU Parted 3.3
Using /home/sbw/Downloads/raspbian_latest.img
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) u
Unit?  [compact]? B                                                       
(parted) print                                                             
Model:  (file)
Disk /home/sbw/Downloads/raspbian_latest.img: 1866465280B
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start       End          Size         Type     File system  Flags
 1      4194304B    272629759B   268435456B   primary  fat32        lba
 2      272629760B  1866465279B  1593835520B  primary  ext4

(parted) q 

Note the Start of the fat32 boot partition:


And use it to create a temporary local mount of the image before copying it to the SDCard

sudo mount -o loop,offset=4194304 raspbian_latest.img /media/sbw/kano/

now putting the file ssh & wpa_supplicant.conf is even easier

touch /media/sbw/kano/ssh
vim /media/sbw/kano/wpa_supplicant.conf

Then the copy to the SDCard

sudo dd if=/home/sbw/Downloads/raspbian_latest.img of=/dev/mmcblk0 bs=4M conv=fsync

Inspiration: https://blog.gordonturner.com/2017/12/10/raspberry-pi-full-screen-browser-raspbian-december-2017/


A few days ago I was talking about Scrum & the way people tend to use it to avoid doing stuff and spend time arguing about roles & responsibilities while not doing things that just work.

2 hours after my twitter notification blinked for this…

Ok, I feel now comfortable to just cut any discussion going too far about “it’s up to you to do this, it’s up to me to do this…”. At the end, whatever helps the projects getting online is good… whatever waste your time is… waste.


I think it’s time to go back to the lean principle and the common sens underlying somewhere, where we left them years ago.

Permaculture dans les Jardins de Jette

Grâce à une communauté de motivé et avec l’aide de la Commune de Jette nous avons put aménager un espace composte et jardin.

Avec un passionné de permaculture travaillant aux plantations nous mettons petit à petit en place un jardin.

Toute l’équipe au travail

On travaille sur le principe de rotation en 6 zones.

  1. Zone Choux
  2. Zone Légumes Feuilles
  3. Zone Légumes Fruits
  4. Zone Légumes Racines
  5. Zone Pomme de terre
  6. Zone Légumineuses

Chaque année on transforme une zone en une zone + 1 (Exemple: La zone choux devient une zone Légumes feuilles).

Ainsi la rotation régénère la terre épuisée par les cultures successives.

Steven en train de prendre des photos

Les plantations de Mars

  • Zone 1
    • Haricots (sur les bords 4 rangées) 1 grain tous les 5 cm sur une ligne
    • Radis (une rangée au milieu) 1 grain tous les 3 cm sur une ligne
  • Zone 2
    • Pomme de terres (précoces = 90 jours)


Dans tous les cas pour semer la graine on garde la terre légère (mixte compost 1x – terre 2x – sable du Rhin 1x) sans tasser.

On creuse un trou avec le doigt et on plante la graine, on recouvre avec 3x la hauteur de la graine.

Les semis doivent rester à environ 15-17 °C pour que les plants soient fort. A 15-17 °C ils poussent plus lentement mais sont plus fort, à contrario, à 20 °C ils poussent vite mais sont plus faibles à long terme.

En pots

  1. Épinards
  2. Persil
  3. Ciboulette
  4. Sauge
  5. Origan
  6. Fenouil
  7. Tagètes: on ne les mange pas, c’est pour les limaces

Les pots sont rapporté chez chacun pour être déposé dans une pièce pas trop chaude (garage, entre-sol…) mais lumineuse.

Pour les personnes en appartement, c’est plus difficile, il faut une pièce à moins de 20 °C avec de la lumière.