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 1 and 2: 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 directory, you will loose those.

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
      

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 system firmware with DFU

The firmware on the BrewPi Spark with a Photon or P1 consists of 2 layers:

  • The BrewPi application
  • The Particle system framework

If you want to update to a version of BrewPi that requires a new system framework, you need to update over USB in DFU mode. This can be done with our flashDfu.py python script.

If you have installed BrewPi using docker, you probably did not start the container with USB forwarding. That's okay, we don't need to use your existing container to update the firmware, we can just create another one for the update and destroy it afterwards.

For a raspberry pi, ssh into your docker host (use putty if you are on windows):

ssh pirate@192.168.1.100

Make sure you have the latest docker image:

docker pull brewpi/brewpi-raspbian

Connect the Spark with USB and put it in DFU mode. This can be done by holding the setup button and doing a reset. Keep holding the button until the LED flashes yellow. If you put the Spark in DFU mode after starting the container, the container will fail to access the DFU device. Kill it with CTRL-C and start it again.

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

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

Resetting to factory defaults doesn't work yet, which is why we specify –noreset. This is because the serial port is not available in the container. If a reset is required, you can use the 'Reset to factory defaults' button in advanced settings.