HowTo

Documentation can be great, but an example is sometimes worth its weight in gold.
In this section we’re going to walk through examples and use cases.
This will showcase how we can unleash the full power of the herd of CattlePis!


  • Setting up a Raspbian stock image

    The basic principle of the CattlePi project is that “we want to turn your pet projects into cattle projects”. This means that, ideally, you would keep zero state on the Raspberry Pi devices in your fleet and you would dynamically figure out what the Pi should be running either at boot time or periodically at runtime.
    That’s how we envision you will be using CattlePi.

    That being said there are times when you do want a stock Raspbian install and you do want to leverage Raspbian in exactly the same way you would if you were to write it to the SD card yourself.

    Read more

  • Setting up Pi-Hole via the prebuilt image

    In a previous tutorial we learned how to setup our Raspberry Pi to run PiHole by injecting the setup code into the usercode that runs automatically on setup. While this is useful (and you should leverage the usercode when needed) it also has a few downsides:

    • it’s slow. the whole pihole process can take quite a long time.
    • it’s error prone. A network connectivity issue or any other transient issue (that may not be under your control) means that the pihole setup might fail .
    Read more

  • Modifying the SD Card layout

    CattlePi does not really care about the way the SD card is partition and formatted. As long as your Pis boot and there is enough space on the boot partition to cache the CattlePi images you should be good (usually the first partition, needs to be FAT and it’s recommended that it has 1G+ of space so that there is enough room to cache the images).

    That being said, in a particular setup you may care about how the card is partitioned. We’ve made it easy by adding a configuration option that (if present) will alter the SD card layout to whatever is specified in there.

    Read more

  • Autoupdating (Images/Configuration)

    The device boot configuration supports specifying a boolean autoupdate flag. When set to true, a cronjob injected into the image will monitor the api for configuration changes and will reboot the device whenever a change is detected. Upon reboot the device will pick up and use the new configuration.

    Read more

  • Injecting Code via the BootCode

    This post will help you understand how the bootcode field in the device boot configuration works. It’s similarly to the usercode field we’ve played with in the previous tutorial

    Read more

  • Setting up Pi-Hole via usercode

    This post will help you understand how the usercode field in the device boot configuration works. In the process of demonstrating how this works, we will also show you how you could setup Pi-Hole by using this feature.

    Read more

  • Connecting through SSH

    This post will show you how to connect to a cattlepi managed device using SSH. We assume that you’ve already gone through the Hello CattlePi Tutorial and have your account and default boot target config.

    Read more

  • Hello CattlePi - getting started with api.cattlepi.com

    This post will show you how to get started with cattlepi. We assume you already have a supported Raspberry Pi and an empty SD card you can use.

    Read more