Firmware version 0.5.8 (Stable WiFi and sensor calibration)

Hi Guys,

Please upgrade your firmware to 0.5.7 to ensure stability and proper beer control.

We had just released 0.5.6 with the WiFi stability fixes, but it seems that a bug had crept in causing the sensor calibration offset to not be initialized correctly. This caused sensors to read as -100C.
I didn’t encounter this in testing, because I initialized the sensors in a different way, which did send the calibration offset each time. Only when omitted, it would have this issue.

I have had a tough week and wasn’t able to test as much as I normally do.

Cheers,

Elco

update :slight_smile:

2 additional bugs were reported from the community and have been fixed in0.5.8.

1 Like

What is the correct way to upgrade a Spark 3 firmware? I’ve tried searching for a method, but best I can find is:

docker stop brewpi
docker pull brewpi/brewpi-raspbian
docker run -it --name brewpi-update --privileged -v ~/brewpi-data:/data --rm brewpi/brewpi-raspbian python utils/updateFirmware.py
docker start brewpi

But I keep having problems updating. it will error while sending packets, or will give me error 21.

Is the script still active somewhere else? Try stopping it before you run the updater. And 0.5.9 is the latest now.

From which version are you updating?

I currently have 0.5.5 firmware. The web page says the script has stopped so I assume it is stopped. I have tried updating to 0.5.9 and 0.5.8 but both fail.

Did I read somewhere that updateFirmware.py can work over wifi?

My Raspberry Pi is not located near by 2 BrewPi Sparks so every time I need to do a firmware update it’s a bit of a pain to unplug them and connect them via USB to my raspberry pi.

This is what I get when trying to update the firmware from 0.5.5 to 0.5.7 or 0.5.8 or 0.5.9

HypriotOS/armv7: pirate@black-pearl in ~
$ docker stop brewpi
brewpi
HypriotOS/armv7: pirate@black-pearl in ~
$ docker pull brewpi/brewpi-raspbian
Using default tag: latest
latest: Pulling from brewpi/brewpi-raspbian
Digest: sha256:5b655fc6937eeee1d2ace8bf9ce7ad04ed2976fe5bbbd2c5a499d4527c46813e
Status: Image is up to date for brewpi/brewpi-raspbian:latest
HypriotOS/armv7: pirate@black-pearl in ~
$ docker run -it --name brewpi-update --privileged -v ~/brewpi-data:/data --rm brewpi/brewpi-raspbian python utils/updateFirmware.py
Persistent files already present
[ ok ] Starting nginx: nginx.
Stopping any running instances of BrewPi to check/update controller…

Checking current firmware version…
Jul 30 2018 00:44:13 Background thread for serial started
Jul 30 2018 00:44:13 Serial (re)connected over WiFi at socket://192.168.1.99:6666
Jul 30 2018 00:44:15 Background thread for serial stopped
Current firmware version on controller: 0.5.5

Checking GitHub for available release…

Available releases:

[0] 0.5.9
[1] 0.5.8
[2] 0.5.7
[3] 0.5.5
[4] 0.5.2
[5] 0.5.1
[6] 0.5.0
[7] Cancel firmware update
Enter the number [0-7] of the version you want to program [default = 0 (0.5.9)]:
Would you like me to try to restore you settings after programming? [Y/n]:

Would you like me to try to restore your configured devices after programming? [Y/n]:

Downloading firmware…
downloading https://github.com/BrewPi/firmware/releases/download/0.5.9/brewpi-p1-0.5.9.bin
Latest firmware downloaded to:
/home/brewpi/utils/downloads/0.5.9/brewpi-p1-0.5.9.bin

Updating firmware…

**** P1 Program script started ****
Settings will be restored if possible
Devices will be restored if possible
Checking old version before programming.
Jul 30 2018 00:44:19 Background thread for serial started
Jul 30 2018 00:44:19 Serial (re)connected over WiFi at socket://192.168.1.99:6666
Requesting old settings from P1…
Saved old settings to file settings-Jul-30-2018-00-44-23.json
Jul 30 2018 00:44:23 Background thread for serial stopped
Jul 30 2018 00:44:23 Opening serial port
Triggering a firmware update with the ymodem protocol on the controller
Flashing file /home/brewpi/utils/downloads/0.5.9/brewpi-p1-0.5.9.bin
Problem flashing file: 21
Please try again.
BrewPi script will restart automatically.

You can always fall back on dfu (over USB):

docker run -it --name brewpi-update --privileged -v ~/brewpi-data:/data --rm brewpi/brewpi-raspbian python utils/flashDfu.py --trigger
docker run -it --name brewpi-update --privileged -v ~/brewpi-data:/data --rm brewpi/brewpi-raspbian python utils/flashDfu.py --noreset

I am not sure what is causing the issue for you. I do see that you are still running on hypriot. It is recommended to switch to normal Raspbian. Hypriot is not really maintained anymore, because docker support in normal Rapsbian works well now.

@Dan Yes, you should be able to update over WiFi.

Can I specify the IP address of the one I want to update if I have more than one attached to my network or do I need to switch one off? Or will it try and update both with the same script?

Yes, it uses the same IP that it uses for the script.

Great! In that case I’m assuming that when running the update script according to your instructions:

docker run -it --name brewpi-update --privileged -v ~/brewpi-data:/data --rm brewpi/brewpi-raspbian python utils/updateFirmware.py

For each of my BrewPi Sparks, the location for data should be the same location being used by each relevant script so it can find the IP address?

Because I have two im using:
~/brewpi/ferm
~/brewpi/mash

Otherwise how does it know the IP address to update?

Sorry for all of the questions!

That seemed to work (using dfu). I even tried the original method I mentioned, after the dfu update. This worked fine, the new firmware was sent much faster. Although there is one problem, the settings were not restored. I found backups of the settings in ~/brewpi-data/settings/controller-backup/ Is there a way to restore them?

yes, that mapped volume (-v) is where the settings are stored, including port/ip.

I need to restore the settings to the spark I think. Everything is back to default values, temperature at Celsius, mode is set to test mode, etc

Yes, I was replying to Dan.
Reading the settings back from that file was never implemented, I’m sorry!
I don’t have time to make that work before my holiday. And afterwards, let’s just get the new version ready asap.

I have a slightly more complicated solution though!

go to http://raspberrypi.local/sockettest.php
Or instead of raspberrypi.local use the IP address.

As messageType, enter setParameters
As message, copy content from the file between brackets, for example:

{"cooler_ti": 1800, "heater2_kp": 10.0, "cooler_td": 200, "heater2PwmPeriod": 4, "beer2fridge_dfilt": 4, "heater1_infilt": 1, "heater1_kp": 10.0, "beer2fridge_ti": 7200, "heater2_infilt": 1, "cooler_kp": 10.0, "heater1PwmPeriod": 4, "beer2fridge_td": 1200, "minCoolIdleTime": 180, "beer2fridge_infilt": 1, "heater2_dfilt": 4, "beer2fridge_pidMax": 10.0, "beer2fridge_kp": 2.0, "heater1_dfilt": 4, "cooler_dfilt": 4, "heater1_ti": 600, "minCoolTime": 120, "heater1_td": 60, "tempFormat": "C", "heater2_td": 60, "deadTime": 1800, "cooler_infilt": 1, "heater2_ti": 600, "coolerPwmPeriod": 1200}

That works for control settings and variables.
For your devices, do them one by one:
messageType: applyDevice
message (example):

{"a": "289E6CFF08000042", "c": 1, "b": 0, "d": 0, "f": 5, "i": 0, "h": 2, "j": 0.0, "p": 0, "t": 1}`

Check the log (in web interface) to see the result.

That worked! Thanks for your help.