The way forward for Pi-Kitchen

Posted: August 15, 2017 in General

So the Pi-Kitchen has been running for sometime now, and although I managed to solve many of the issues with configuring the Raspberry Pi out of the box, it has always remained an experimental project.

PiKitchen

The purpose of the Pi-Kitchen was to explore the ways in which we could provide a flexible method for configuring the Raspberry Pi.  It did that very well and I have used it successfully ever since…however…I suspect I was one of the few that actually managed to set it up and make use of it (I don’t mind too much since I was the one who wanted it…and it worked great for me).

There were even quite a range of recipes supported and development with around 25 supporting various settings and hardware out of the box, plus several automatically running demos which were great for setting up for events etc.

The Pi-Kitchen had two main issues:

  1. Difficult to setup – a user friendly GUI for install and config was in the works but time wasn’t available to complete it.  So it was quite a challenge to get running for others.
  2. Recipes become out-dated – having a smaller user-base (i.e. 1) and rather complex recipes meant that I only updated them when I next used them.  This was further compounded because Raspbian changed quite significantly during this time.

The experimental work has proven the pre-configuration and setup can work, and I’ve tried out some interesting ideas along the way, but a different approach is required to meet the full objective.

The dream remains…

The overall concept and idea still remains:

Turn the Raspberry Pi into a plug and play appliance

Essentially, I want to enable the Raspberry Pi to be configured completely up-front, via a GUI or from a supplied configuration.  Ideally, people would be able to provide a setup file and then it can be used with the latest Raspbian image to recreate their project.  After that, they need only insert the SD-Card and add power…no screen, no keyboard, no mouse (if suitable).

Potentially, the Pi-Kitchen was close to this but required specific recipe files carefully crafted to achieve this, and the non-trivial initial setup.

Raspberry Pi Appliances

Many projects are distributed as apt-get packages, or as git-hub repos, which require a operating system already setup and manually configured before you start.

Otherwise they are distributed as pre-built IMG files which have everything pre-installed.  This had several big problems:

  1. Typically the image ends up being out of date, since the base image often gets updated and the pre-built image does not.
  2. The user must configure the Raspberry Pi afterwards (i.e. to add their network settings or setup specific options) – so a screen and keyboard is often needed (Plug and Play fail) and a new install means you have to do it again (and again, and again)!
  3. All the details on how and what is installed within the IMG is hidden, so not only do you not know for sure what someone has put into the operating system but you don’t learn much about the project either.

The GoogleAIY is a great example of this (an awesome kit!), if it was setup using a supplied configuration which also allowed the required customisation to be done up-front then it would be possible to have made it an out-of-the-box appliance.  You’d configure and generate your SD-Card on a computer, insert it into the GoogleAIY kit and add power!

Boom-You have your google assistant ready and waiting for that first question “what does the fox say?” right off the bat.

aiy-projects

Image from RaspberryPi.Org

For those who haven’t used the GoogleAIY kit, it requires a number of steps to setup correctly on the Raspberry Pi after you have imaged the pre-built IMG file supplied, requiring a screen, keyboard, mouse and some careful config (not truly pure out of the box IoT experience).

By providing everything as a configuration script (even if it is tied to a specific release of OS) it allows the community to be able to understand (and perhaps update) the setup which is packaged into these pre-built IMG files.  This would also ensure updates and fixes are pulled in and enabling these projects to develop further within the Raspberry Pi ecosystem over time.

Enter PiBakery stage right…

blocks-on-workspace

Image from PiBakery,Org

The PiBakery has been developed by David Ferguson and provides another solution for configuring Raspberry Pi SD-Cards.  It provides an excellent solution for setting up the SD-Card out of the box and provides a very neat interface for customising the configuration quickly and easily.

In fact, the whole thing works very nicely and is a lot better than what I was planning for the Pi-Kitchen (without requiring time I don’t have to develop it!).  If used correctly, and developed with a few additional blocks, this could easily be a platform by which people could create and share projects that enable the Raspberry Pi to be a proper plug and play solution.

So… hopefully we can help with it and build up the recipes available so that it is possible to create that complete Raspberry Pi setup from a configuration file and allow users to customise it before they install and power up.  To get that plug and play dream!

NOOBS / PINN Image support

The PiBakery functions by using a customised IMG file (based on Raspbian) which has a few scripted inserted to support the execution of the PiBakery configuration when the Raspberry Pi boots up.

This does mean that every time the official Raspbian image is updated, David has to update his image file (and that has to get pushed to your local PiBakery installation).  It also means that in order to support other variants (such as Raspbian-Lite, OpenElec or possibly Arch Linux and Ubuntu), each one would need the custom PiBakery files inserted manually and downloaded.

Using the methods used by Pi-Kitchen, we can use Procount’s NOOBSCONFIG (with NOOBS) or PINN (Procount’s advanced version of NOOBS), which will allow the required custom files to be added to the installed operating system post install.

The advantage of using PINN over NOOBS is that not only does PINN support the file injection methods without any changes, but Procount has enabled support for a much larger range of source images (in .IMG and .tar.xz formats) and allows source images to be served from a local server or even from a connected USB drive.

1

Image from matthuisman.nz

I’ve successfully used PiBakery in combination with PINN and a clean Raspbian image, to install a PiBakery configuration automatically.  This required 5 basic steps:

  1. Copy PINN/PINN-Lite to a clean SD-Card.
  2. In order to support a standard NOOBS type installation, the resulting SD-Card structure is slightly different to a clean IMG file type install.  NOOBS creates a FAT formatted recovery partition, this changes which partition will be visible by PiBakery from the host operating system.  Therefore, a few mods to these PiBakery files are needed to support different locations for the PiBakery configurations.  This requires removeFirst.py, removeNext.py and runScript.py to check for the PiBakery configurations in the Recovery partition as well as the boot partition.  I’ve prototyped these changes already and shown this to work with a clean Raspbian image.
  3. Create the configuration to copy the PiBakery configuration files to the correct place in the operating system and setup PINN to perform an automated install.  Currently, I’ve added a Pi-Kitchen recipe to do this, but practically we’d only need this single configuration so these can be created as a standalone configuration to be copied to the SD-Card (along-side the configurations generated by PiBakery).
  4.  Fool PiBakery to think it has already installed the OS so that it is ready to “update” the configuration (otherwise it’ll try to format and install the custom PiBakery image).  This is achieved by creating a folder called PiBakery and adding an empty blocks.xml file onto the SD-Card.
  5. Create your custom PiBakery configuration using the super nice block interface to build your custom setup, enter your settings, and update the SD-Card.

The SD-Card will be ready to power on and PINN will install the OS and then PiBakery will perform all the customisations.

In theory, this can be integrated into a single option within PiBakery (or in PINN) so the whole thing is as seamless as possible.

Extra Blocks

I’ll talk about some useful extra blocks next time, which will allow some of the customisations I’ve come to enjoy with using Pi-Kitchen, and also some which will streamline deploying your own projects via PiBakery.

Thoughts??

Hopefully David Ferguson will appreciate the concept and will be happy to integrate some of these ideas into his excellent project.

PiBakery and Procount’s PINN could make a rather nice combination, and perhaps a new era as the Plug and Play Raspberry Pi appliance.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.