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!


  • sunsetting https://api.cattlepi.com

    We have an important announcement: we are sunsetting https://api.cattlepi.com - the CattlePi managed API.

    The timeline is as follows:

    • starting today Oct 6 2019 we will no longer provide new API keys
    • starting on Nov 1st 2019 the API will go into readonly mode - if you have an API key you will still be able to read/use the configuration for your devices but not upload new configurations
    • starting on Dec 1st 2019 the API will go away completely. You may still be able to hit the endpoint for a while but the API key will stop working.
    Read more

  • Updating device config - easier path

    Up until this point we have shown you how to update various parts of the device configuration manually (e.g. Autoupdate Configuration)
    This works and it’s important in understanding details about which configuration keys map to which feature but it can be a little tedious, expecially if you’re updating a lot of configs or if you have special configuration. Up until now you would probably be force to have a few small shell scripts that retrieve, parse and update the cofiguration in order not have to remember all the details (or keep referencing the documentation). Now we have added a tool directy in the cattlepi repository to make the job of updating device configurations trivial. See: https://github.com/cattlepi/cattlepi/tree/master/tools/api

    Read more

  • Wireless functionality

    One of the great things about the Raspberry Pi 3 is its ability to use a wireless network connection, removing the need for extra cables. Up until now, Raspberry Pis provisioned with CattlePi have required a hardwired network connection. You may have even tried to hack around this by including a wpa_supplicant in your rootfs or other methods.

    Wireless functionality is now a fully supported CattlePi feature! Once the proper key is setup in the config, and your CattlePi is fully provisioned, it will connect to the wireless network to do its business.

    Read more

  • Offline mode; or 'booting without the network'

    Historically, the CattlePi project has been very dependent on network connectivity. We require the network to contact the API in order to pull down config, images, etc.

    However, what if you need to configure a Pi with custom software setup and config, but it needs to run without network connectivity? You’re in luck! This is now supported by CattlePi! Just because your Pi needs to run off the network doesn’t mean that you should have to manually configure it. “Pet projects into cattle projects”, remember?

    Read more

  • Autobuilding images

    If you’ve been following the CattlePi project for a while now you should be familiar with the process of building images and updating boot configurations associated with specific devices.

    We now want to take this a step further with a process/script of automatically building images. We will leverage the raspbian_stock image and already existing tooling in the cattlepi code repository.

    Read more

  • 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