To get fully up to date with the latest version of BrewPi, we need to update all 3 parts of BrewPi:

  1. The BrewPi python script (brewpi-script)
  2. The BrewPi web interterface (brewpi-www)
  3. The BrewPi Spark firmware

There are 2 ways to update the script and web interface: re-creating your docker container or updating an existing container.

Re-creating the docker container

If you installed BrewPi with docker, the easiest way to do this is to just re-create the Docker container. Because your data and settings are stored outside of the container, you will not loose them.

If you made changes in your container outside of the data, settings and log directories, you will loose those.

Ssh into the raspberry pi

First log into the shell of the docker machine using ssh (use putty if you are connecting from a Windows PC):

ssh pirate@192.168.1.100

The default password for HypriotOS is `hypriot`.

Make sure you have the latest docker image

Run the code below to get the latest BrewPi image from DockerHub.

docker pull brewpi/brewpi-raspbian

Re-create the brewpi container

To create a new fresh container, take the following steps:

  1. Show all running containers:
      docker ps
      


    You can refer to a container by name or container ID.

  2. Remove your existing container:
      docker stop brewpi; docker rm brewpi
      
  3. Make sure you have the latest image:
      docker pull brewpi/brewpi-raspbian
      
  4. Create a new fresh container:
      docker run -d --name brewpi -p 80:80 -v ~/brewpi-data:/data -v /etc/timezone:/etc/timezone -v /etc/localtime:/etc/localtime --restart always brewpi/brewpi-raspbian
      
Start a console to run docker commands

On Linux, just open a shell. On Windows or Mac, you will find it in your start menu under the name Docker Quickstart Terminal.

Make sure you have the latest docker image

Run the code below to get the latest BrewPi image from DockerHub.

docker pull brewpi/brewpi-ubuntu

Re-create the brewpi container

To create a new fresh container, take the following steps:

  1. Show all running containers:
      docker ps
      


    You can refer to a container by name or container ID.

  2. Remove your existing container:
      docker stop brewpi; docker rm brewpi
      
  3. Make sure you have the latest image:
      docker pull brewpi/brewpi-ubuntu
      
  4. Create a new fresh container:
      docker run -d --name brewpi -p 80:80 -v ~/brewpi-data:/data -v /etc/timezone:/etc/timezone -v /etc/localtime:/etc/localtime --restart always brewpi/brewpi-ubuntu
      
Make sure you have the latest docker image:
docker pull brewpi/brewpi-ubuntu

To create a new fresh container, take the following steps:

  1. Show all running containers:
      docker ps
      


    You can refer to a container by name or container ID.

  2. Remove your existing container:
      docker stop brewpi; docker rm brewpi
      
  3. Make sure you have the latest image:
      docker pull brewpi/brewpi-ubuntu
      
  4. Create a new fresh container:
      docker run -d --name brewpi -p 80:80 -v ~/brewpi-data:/data -v /etc/timezone:/etc/timezone -v /etc/localtime:/etc/localtime --restart always brewpi/brewpi-ubuntu
      

Updating an existing BrewPi server/container

Most BrewPi installs will also have our brewpi-tools repository installed in ~/brewpi-tools. Our latest docker container includes it too.

Log in on the console of your BrewPi server. If you are running docker with portainer, you can do this by going to <ip address>:9000, then go to your BrewPi container and click 'console'.

Then simply run our update-script:

cd ~/brewpi-tools
python updater.py

Updating the BrewPi Spark firmware with DFU

DFU is a specialized USB protocol. To use DFU mode, the Spark should be connected via USB to your computer or Raspberry Pi. When updating over DFU, you will first put the Spark in DFU mode by rebooting into the bootloader.

This can be done by:

  1. holding the setup button while it boots, until the LED flashes yellow. You can reboot by pressing the reset button (while holding the setup button) or reconnecting power (while holding the setup button), or
  2. triggering it in software (with our script). Our script will do that for you if you use the option –autodfu, which we will get to later.

The process to update is for:

  • Docker or no docker
  • Whether you run docker on a Raspberry Pi, Linux, Windows or Mac. The process is described separately in each tab.

Without docker

If you installed BrewPi without docker, you will only need to run this command on your system:

python utils/flashDfu.py --tag=0.5.3-rc.3 --noreset --autodfu

Modify –tag=0.5.3-rc.3 to pick the tag you would like to use from our releases.


With docker

To update over DFU, we will use a new temporary privileged container that is destroyed after use.

The following commands are performed from the console on pi. See above to log into the pi using SSH.

We can start a docker container for single use that is destroyed afterwards (–rm) and run the flashDfu.py script directly inside the container:

docker run -it --name brewpi-dfu --privileged -v ~/brewpi-data:/data --rm brewpi/brewpi-raspbian sudo python utils/flashDfu.py --tag=0.5.3-rc.3 --noreset --autodfu

Modify –tag=0.5.3-rc.3 to pick the tag you would like to use from our releases.

Docker containers can only use devices that are present on the host when they start. Which is why the first time you run this command, it will only put the device in DFU mode. It will not be able to use the new DFU device, because it was not present when the container started. Stop the script with CTRL-C. Your Spark is now in DFU mode. Run the command again to update.

Install drivers
  • Make sure all necessary drivers are installed by installing Partile CLI

Give docker-machine access to USB devices

Docker runs in as a Virtualbox virtual machine if you installed with Docker toolbox. By default, this machine does not have access to USB devices. To give it access, take the following steps:

  1. Stop the running docker machine by typing this in your docker console:
    docker-machine stop
  2. Start Oracle VM Virtualbox from your Start Menu
  3. Find the virtual machine called default, right click it and open Settings.
  4. Go to the USB tab and enable the USB controller
  5. Click Add device filter and chose the Particle P1/Photon device
  6. Put the BrewPi Spark in DFU mode
  7. Click Add device filter and chose the Particle P1/Photon DFU mode device
  8. Save your settings by clicking OK
  9. Go back to the docker console and restart the docker machine:\\
    docker-machine start

Check that DFU is working inside the brewpi-ubuntu container now

Make sure your BrewPi Spark is in DFU mode (blinking yellow) and run:

docker run -it --name brewpi-dfu --privileged -v ~/brewpi-data:/data --rm brewpi/brewpi-ubuntu dfu-util -l

The output should look like this:

Finally, run the command to update the controller using DFU:

docker run -it --name brewpi-dfu --privileged -v ~/brewpi-data:/data --rm brewpi/brewpi-ubuntu sudo python utils/flashDfu.py --tag=0.5.3-rc.3 --noreset --autodfu

Modify –tag=0.5.3-rc.3 to pick the tag you would like to use from our releases.

Make sure you have the latest docker image:
docker pull brewpi/brewpi-ubuntu

We can start a docker container for single use that is destroyed afterwards (–rm) and run the flashDfu.py script directly inside the container:

docker run -it --name brewpi-dfu --privileged -v ~/brewpi-data:/data --rm brewpi/brewpi-ubuntu sudo python utils/flashDfu.py --tag=0.5.3-rc.3 --noreset --autodfu

Modify –tag=0.5.3-rc.3 to pick the tag you would like to use from our releases.

Docker containers can only use devices that are present on the host when they start. Which is why the first time you run this command, it will only put the device in DFU mode. It will not be able to use the new DFU device, because it was not present when the container started. Stop the script with CTRL-C. Your Spark is now in DFU mode. Run the command again to update.

I do not have a Mac to test the procedure, so unfortunately I cannot write this piece of documentation myself. Because Docker is installed on OSX with docker-machine, just like in Windows, most of the instructions for Windows will probably apply.

If you have installed BrewPi on OSX with Docker, please help us update these instructions.


If you are upgrading from an old version, it is possible that your BrewPi Spark is displaying a white screen and the LED is blinking green rapidly. You can get past this by setting up WiFi.