Firmware 0.4.4 has been released (You MUST update!)

Hi Guys,

We released firmware 0.4.4 today.
This release mainly increases the reliability by fixing bugs in the USB stack and by adding a watchdog timer that triggers a hardware reset if the controller stops responding for 60 seconds.

This firmware fixes a very important bug that could cause a complete freeze of the controller. Please update your controller as soon as possible!

You can view the full release notes here:

You can update by running our update script:

sudo python ~/brewpi-tools/updater.py

If you encounter problems during or after the update, please report them in this topic.
Updating your controller mid-brew is not recommended.

Cheers!

2 Likes

That seemed to work…apart from the /home/…

pi@raspberrypi ~ $ sudo python /home/brewpi-tools/updater.py
python: can't open file '/home/brewpi-tools/updater.py': [Errno 2] No such file or directory
pi@raspberrypi ~ $ ls
brewpi-tools  dfu-util   Downloads  Pictures  python_games  Videos
Desktop       Documents  Music      Public    Templates
pi@raspberrypi ~ $ sudo python /brewpi-tools/updater.py
python: can't open file '/brewpi-tools/updater.py': [Errno 2] No such file or directory
pi@raspberrypi ~ $ sudo python brewpi-tools/updater.py
######################################################
####                                              ####
####        Welcome to the BrewPi Updater!        ####
####                                              ####
######################################################

Checking whether the update script is up to date
remote: Counting objects: 4, done.
remote: Total 4 (delta 3), reused 3 (delta 3), pack-reused 1
Unpacking objects: 100% (4/4), done.
From https://github.com/BrewPi/brewpi-tools
   67aec20..6c69505  master     -> origin/master
   67aec20..6c69505  develop    -> origin/develop
/home/pi/brewpi-tools is not up-to-date, updating...
Updating 67aec20..6c69505
Fast-forward
 .gitignore | 1 +
 updater.py | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)
This script was not up-to-date and has been automatically updated. Please re-run updater.py.
pi@raspberrypi ~ $ sudo python brewpi-tools/updater.py
######################################################
####                                              ####
####        Welcome to the BrewPi Updater!        ####
####                                              ####
######################################################

Checking whether the update script is up to date
/home/pi/brewpi-tools is up-to-date.



*** Updating BrewPi script repository ***

Stopping running instances of BrewPi
Quit message sent to BrewPi instance with pid 994!
You are on branch master
The latest commit in /home/brewpi  is 67efcb0e40f0be4b40ad1e7cd207eedcf0dd032c on Wed, 27 Apr 2016 18:25:10
The latest commit on origin/master is 08a8a5a202d06f514d9778b00ccef69d83635741 on Wed, 23 Nov 2016 13:18:04
*** Updates are available! ****
Would you like to update /home/brewpi from origin/master [Y/n]: Y
Updating 67efcb0..08a8a5a
Fast-forward
 backgroundserial.py   | 13 ++++++++-----
 brewpi.py             | 48 ++++++++++++++++++++++++------------------------
 brewpiVersion.py      |  4 ++--
 programController.py  | 12 ++++++------
 utils/flashDfu.py     | 39 ++++++++++++++++++++++++---------------
 utils/testTerminal.py |  2 +-
 6 files changed, 65 insertions(+), 53 deletions(-)
master updated!


*** Updating BrewPi web interface repository ***
You are on branch master
The latest commit in /var/www/html is 1e0778703edbbd3ef33072ba0b260c491fba90cc on Mon, 11 Jan 2016 13:04:54
The latest commit on origin/master is 1e0778703edbbd3ef33072ba0b260c491fba90cc on Mon, 11 Jan 2016 13:04:54
Your local version of /var/www/html is up to date!

One our more repositories were updated, running runAfterUpdate.sh from /home/brewpi/utils...
Installing dependencies, updating CRON and fixing file permissions...
Cleaning up BrewPi script directory...
Deleted 14 old .pyc files

***** Installing/updating required packages... *****

last apt-get update was over a week ago. Running apt-get update before updating dependencies
Get:1 http://archive.raspberrypi.org jessie InRelease [13.2 kB]
Get:2 http://mirrordirector.raspbian.org jessie InRelease [14.9 kB]
Get:3 http://mirrordirector.raspbian.org jessie/main armhf Packages [8,982 kB]
Get:4 http://archive.raspberrypi.org jessie/main Sources [48.6 kB]
Get:5 http://archive.raspberrypi.org jessie/ui Sources [15.2 kB]             
Get:6 http://archive.raspberrypi.org jessie/main armhf Packages [117 kB]       
Get:7 http://archive.raspberrypi.org jessie/ui armhf Packages [53.6 kB]        
Get:8 http://mirrordirector.raspbian.org jessie/contrib armhf Packages [37.5 kB]
Get:9 http://mirrordirector.raspbian.org jessie/non-free armhf Packages [70.3 kB]
Get:10 http://mirrordirector.raspbian.org jessie/rpi armhf Packages [1,356 B]  
Ign http://archive.raspberrypi.org jessie/main Translation-en_GB               
Ign http://archive.raspberrypi.org jessie/main Translation-en                  
Ign http://archive.raspberrypi.org jessie/ui Translation-en_GB                 
Ign http://archive.raspberrypi.org jessie/ui Translation-en         
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en_GB        
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en           
Ign http://mirrordirector.raspbian.org jessie/main Translation-en_GB           
Ign http://mirrordirector.raspbian.org jessie/main Translation-en              
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en_GB       
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en          
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en_GB            
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en               
Fetched 9,354 kB in 49s (188 kB/s)                                             
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
apache2 is already the newest version.
build-essential is already the newest version.
git-core is already the newest version.
libapache2-mod-php5 is already the newest version.
php5 is already the newest version.
php5-cgi is already the newest version.
php5-cli is already the newest version.
php5-common is already the newest version.
python-dev is already the newest version.
python-pip is already the newest version.
The following packages were automatically installed and are no longer required:
  libasn1-8-heimdal libdrm-freedreno1 libdrm-nouveau2 libdrm-radeon1 libelf1 libgssapi3-heimdal libhcrypto4-heimdal
  libheimbase1-heimdal libheimntlm0-heimdal libhx509-5-heimdal libkrb5-26-heimdal libllvm3.5 libroken18-heimdal
  libwind0-heimdal libxfce4ui-1-0 xfce-keyboard-shortcuts
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 22 not upgraded.

***** Installing/updating required python packages via pip... *****

Requirement already up-to-date: pyserial in /usr/local/lib/python2.7/dist-packages
Requirement already up-to-date: psutil in /usr/local/lib/python2.7/dist-packages
Requirement already up-to-date: simplejson in /usr/local/lib/python2.7/dist-packages
Requirement already up-to-date: configobj in /usr/local/lib/python2.7/dist-packages
Requirement already up-to-date: gitpython in /usr/local/lib/python2.7/dist-packages
Requirement already up-to-date: six in /usr/local/lib/python2.7/dist-packages (from configobj)
Cleaning up...

***** Done processing BrewPi dependencies *****


***** Updating cron for the brewpi user... *****

no crontab for brewpi
Checking entry for brewpi ...
Done checking entry brewpi ...
WiFi checker is disabled.
Restarting cron
[ ok ] Restarting cron (via systemctl): cron.service.

***** Fixing file permissions for /var/www *****

***** Fixing file permissions for /home/brewpi *****

The update script can automatically check your controller firmware version and program it with the latest release on GitHub, would you like to do this now? [Y/n]:Y
 Stopping any running instances of BrewPi to check/update controller...
 
Checking current firmware version...
 Nov 24 2016 16:21:22   Opening serial port
 Found BrewPi v0.4.3 build 0.4.3-0-g4d00879, running on a Particle Photon with a V2 shield on port /dev/ttyACM0

 Current firmware version on controller: 0.4.3
 
Checking GitHub for available release...
 Latest version on GitHub: 0.4.4
 Downloading firmware...
downloading https://github.com/BrewPi/firmware/releases/download/0.4.4/brewpi-photon-0.4.4.bin
 Updated system firmware for the photon found in release 0.4.4
downloading https://github.com/BrewPi/firmware/releases/download/0.4.4/system-part1-0.5.3-photon.bin
downloading https://github.com/BrewPi/firmware/releases/download/0.4.4/system-part2-0.5.3-photon.bin
 Downloaded new system firmware to:

 /home/brewpi/utils/downloads/0.4.4/system-part1-0.5.3-photon.bin
and

 /home/brewpi/utils/downloads/0.4.4/system-part2-0.5.3-photon.bin

 Latest firmware downloaded to:
/home/brewpi/utils/downloads/0.4.4/brewpi-photon-0.4.4.bin
 
Updating firmware...

 ****    Photon Program script started    ****
 Settings will be restored if possible
 Devices will be restored if possible
 Checking old version before programming.
 Nov 24 2016 16:21:29   Opening serial port
 Checking current version: Found BrewPi v0.4.3 build 0.4.3-0-g4d00879, running on a Particle Photon with a V2 shield on port /dev/ttyACM0

 Requesting old settings from Photon...
 Saved old settings to file settings-Nov-24-2016-16-21-32.json
 
Found a Photon and running as root/sudo, using DFU mode to flash firmware.
 
Trying to automatically reboot into DFU mode and update your firmware.
 
If the Photon does not reboot into DFU mode automatically, please put it in DFU mode manually.
 Running command: sudo /usr/bin/python /home/brewpi/utils/flashDfu.py --autodfu --noreset --file=/home/brewpi/utils/downloads/0.4.4 --system1=/home/brewpi/utils/downloads/0.4.4/system-part1-0.5.3-photon.bin --system2=/home/brewpi/utils/downloads/0.4.4/system-part2-0.5.3-photon.bin
Will automatically reboot newly detected photons into DFU mode
Using local files instead of downloading a release. 

Path is a directory. Searching for files in path.

booooo
Traceback (most recent call last):
  File "/home/brewpi/utils/flashDfu.py", line 184, in <module>
    dfuUtilVersion =  re.search('(?<=dfu-util\\s)\\S*', output).group()
AttributeError: 'NoneType' object has no attribute 'group'
 
Updating firmware over DFU finished

 Waiting for device to reset.
 Nov 24 2016 16:21:46   Opening serial port
 Checking new version: Found BrewPi v0.4.3 build 0.4.3-0-g4d00879, running on a Particle Photon with a V2 shield on port /dev/ttyACM0

 Resetting EEPROM to default settings
 INFO MESSAGE 15: EEPROM initialized
 Now checking which settings and devices can be restored...
 Trying to restore compatible settings from 0.4.3 to 0.4.3
 Migrating these settings: [["tempFormat", "C"], ["fridgeSet", null], ["beerSet", null], ["mode", "o"], ["heater1_kp", 10.0], ["heater1_ti", 600], ["heater1_td", 60], ["heater1_infilt", 1], ["heater1_dfilt", 4], ["heater2_kp", 10.0], ["heater2_ti", 600], ["heater2_td", 60], ["heater2_infilt", 1], ["heater2_dfilt", 4], ["cooler_kp", 10.0], ["cooler_ti", 1800], ["cooler_td", 200], ["cooler_infilt", 1], ["cooler_dfilt", 4], ["beer2fridge_kp", 2.0], ["beer2fridge_ti", 7200], ["beer2fridge_td", 1200], ["beer2fridge_infilt", 1], ["beer2fridge_dfilt", 4], ["beer2fridge_pidMax", 10.0], ["minCoolTime", 120], ["minCoolIdleTime", 180], ["heater1PwmPeriod", 4], ["heater2PwmPeriod", 4], ["coolerPwmPeriod", 1200], ["deadTime", 1800]]
 Omitting these settings: []
 INFO MESSAGE 12: Received new setting: tempFormat = C
 INFO MESSAGE 12: Received new setting: fridgeSet = null
 INFO MESSAGE 12: Received new setting: beerSet = null
 INFO MESSAGE 12: Received new setting: mode = o
 INFO MESSAGE 12: Received new setting: heater1_kp = 10.0
 INFO MESSAGE 12: Received new setting: heater1_ti = 600
 INFO MESSAGE 12: Received new setting: heater1_td = 60
 INFO MESSAGE 12: Received new setting: heater1_infilt = 1
 INFO MESSAGE 12: Received new setting: heater1_dfilt = 4
 INFO MESSAGE 12: Received new setting: heater2_kp = 10.0
 INFO MESSAGE 12: Received new setting: heater2_ti = 600
 INFO MESSAGE 12: Received new setting: heater2_td = 60
 INFO MESSAGE 12: Received new setting: heater2_infilt = 1
 INFO MESSAGE 12: Received new setting: heater2_dfilt = 4
 INFO MESSAGE 12: Received new setting: cooler_kp = 10.0
 INFO MESSAGE 12: Received new setting: cooler_ti = 1800
 INFO MESSAGE 12: Received new setting: cooler_td = 200
 INFO MESSAGE 12: Received new setting: cooler_infilt = 1
 INFO MESSAGE 12: Received new setting: cooler_dfilt = 4
 INFO MESSAGE 12: Received new setting: beer2fridge_kp = 2.0
 INFO MESSAGE 12: Received new setting: beer2fridge_ti = 7200
 INFO MESSAGE 12: Received new setting: beer2fridge_td = 1200
 INFO MESSAGE 12: Received new setting: beer2fridge_infilt = 1
 INFO MESSAGE 12: Received new setting: beer2fridge_dfilt = 4
 INFO MESSAGE 12: Received new setting: beer2fridge_pidMax = 10.0
 INFO MESSAGE 12: Received new setting: minCoolTime = 120
 INFO MESSAGE 12: Received new setting: minCoolIdleTime = 180
 INFO MESSAGE 12: Received new setting: heater1PwmPeriod = 4
 INFO MESSAGE 12: Received new setting: heater2PwmPeriod = 4
 INFO MESSAGE 12: Received new setting: coolerPwmPeriod = 1200
 INFO MESSAGE 12: Received new setting: deadTime = 1800
 Now trying to restore previously installed devices: [{u'a': u'2804CDA1060000FB', u'c': 1, u'b': 1, u'd': 0, u'f': 9, u'i': 0, u'h': 2, u'j': 0.0, u'p': 0, u't': 1}, {u'a': u'2899E5A20600004E', u'c': 1, u'b': 0, u'd': 0, u'f': 6, u'i': 1, u'h': 2, u'j': 0.0, u'p': 0, u't': 1}, {u'a': u'2865F8A0060000D6', u'c': 1, u'b': 0, u'd': 0, u'f': 5, u'i': 2, u'h': 2, u'j': 0.0, u'p': 0, u't': 1}, {u'c': 1, u'b': 0, u'd': 0, u'f': 2, u'i': 3, u'h': 1, u'p': 17, u't': 4, u'x': 0}, {u'c': 1, u'b': 0, u'd': 0, u'f': 3, u'i': 4, u'h': 1, u'p': 16, u't': 4, u'x': 0}]
 Restoring device: {"a": "2804CDA1060000FB", "c": 1, "b": 1, "d": 0, "f": 9, "i": 0, "h": 2, "j": 0.0, "p": 0, "t": 1}
 Photon reports: device updated to: {"i":0,"t":1,"c":1,"b":1,"f":9,"h":2,"d":0,"p":0,"a":"2804CDA1060000FB","j":  0.000}

 Restoring device: {"a": "2899E5A20600004E", "c": 1, "b": 0, "d": 0, "f": 6, "i": 1, "h": 2, "j": 0.0, "p": 0, "t": 1}
 Photon reports: device updated to: {"i":1,"t":1,"c":1,"b":0,"f":6,"h":2,"d":0,"p":0,"a":"2899E5A20600004E","j":  0.000}

 Restoring device: {"a": "2865F8A0060000D6", "c": 1, "b": 0, "d": 0, "f": 5, "i": 2, "h": 2, "j": 0.0, "p": 0, "t": 1}
 WARNING 4: Falling back on backup sensor.
 WARNING 4: Falling back on backup sensor.
 Photon reports: device updated to: {"i":2,"t":1,"c":1,"b":0,"f":5,"h":2,"d":0,"p":0,"a":"2865F8A0060000D6","j":  0.000}

 Restoring device: {"c": 1, "b": 0, "d": 0, "f": 2, "i": 3, "h": 1, "p": 17, "t": 4, "x": 0}
 Photon reports: device updated to: {"i":3,"t":4,"c":1,"b":0,"f":2,"h":1,"d":0,"p":17,"x":0}

 Restoring device: {"c": 1, "b": 0, "d": 0, "f": 3, "i": 4, "h": 1, "p": 16, "t": 4, "x": 0}
 INFO MESSAGE 21: Back on main sensor instead of backup sensor.
 INFO MESSAGE 21: Back on main sensor instead of backup sensor.
 Photon reports: device updated to: {"i":4,"t":4,"c":1,"b":0,"f":3,"h":1,"d":0,"p":16,"x":0}

 Restoring installed devices done!
 ****    Program script done!    ****
BrewPi script will restart automatically.


*** Done updating BrewPi! ***

Oops, thanks. Fixed the instruction.

1 Like

To give other users some confidence. Update to 0.4.4 went well. Many thanks to Elco and his team!

update 0.4.4.txt (20.1 KB)

1 Like

Upgrade worked great!

Had to update /etc/apache2/apache2.conf and set the KeepAliveTimeout to 99 to keep Safari on iPad happy (remove the annoying Script not responding message).

Thanks @Elco!

1 Like

Thanks Espen,

Nice change!

don’t forget to restart apache after you edited apache2.conf

sudo service apache2 restart

Updated with no issues, then added Espen’s apache edit… that’s been bugging the crap out of me!

Updated with zero issues. The update didn’t disrupt any of my edited files (remote access for public / admin pages or my setup running Raspberry Pints and the BrewPi servers on the same Pi). Very nice…very happy. Also didn’t change any of my Advanced Settings that we custom setup for my conical FTSS/ Glycol chiller.

Hi Elco,

Have updated to 0.4.4 appeared to go ok. The latest brew has been maintained perfectly.

However I seem to have a problem changing the beer set temp and or mode when using the web interface. I have in this instance tried to change the beer temp from 19 to 20, when “applying it” nothing changes on the web interface but the display of the brewpi does show the new temp.
Copy of the log when the change was applied.

Nov 26 2016 15:22:01 Notification: Beer temperature set to 19.0 degrees in web interface
Nov 26 2016 15:22:02 Controller debug message: INFO MESSAGE 12: Received new setting: mode = b
Nov 26 2016 15:22:02 Controller debug message: INFO MESSAGE 12: Received new setting: beerSet = 19.0
Nov 27 2016 00:00:00 Notification: New day, creating new JSON file.
Nov 28 2016 00:00:00 Notification: New day, creating new JSON file.
Nov 29 2016 00:00:00 Notification: New day, creating new JSON file.
Nov 30 2016 00:00:00 Notification: New day, creating new JSON file.
Dec 01 2016 00:00:00 Notification: New day, creating new JSON file.
Dec 01 2016 13:33:56 Notification: Beer temperature set to 20.0 degrees in web interface
Dec 01 2016 13:33:56 Controller debug message: INFO MESSAGE 12: Received new setting: mode = b
Dec 01 2016 13:33:56 Controller debug message: INFO MESSAGE 12: Received new setting: beerSet = 20.0
Dec 01 2016 13:35:18 Notification: Beer temperature set to 20.0 degrees in web interface
Dec 01 2016 13:35:18 Controller debug message: INFO MESSAGE 12: Received new setting: mode = b
Dec 01 2016 13:35:18 Controller debug message: INFO MESSAGE 12: Received new setting: beerSet = 20.0
stdout:

Do you see anything I’m doing wrong, never experienced this problem before.

Cheers
Dave.

Have just noticed if I stop and start the script it does update the web interface?

Thanks for that bug report! Took me a while to find the cause.

The bug was in the script:
Incoming serial data is read in a background thread. On incoming serial data, this background thread checks the buffer to find occurrences of \n to see if any complete lines are received and adds these to a queue.
The bug was that on each blob or incoming serial data, it only did this once. So if multiple lines were received in one blob, it would only process the first one and leave the rest in the buffer. It would only process the line it left when a new blob came in.

I think this went unnoticed with the previous versions of the firmware, because it was slower and it was unlikely that multiple lines were received in 0.01 seconds.

Anyway, it is fixed now. Please update your script. :slight_smile:

OK… This is the part I’m having a little bit of trouble with being a brewer and not a programmer…“Please update your script”…

So, I go to the “fix for serial buffer being only processed 1 line at a time”’ and I see a file (or part of a file) “called”

backgroundserial.py

I assume this file resides somewhere on the Raspberry Pi in a BrewPi directory???

Looks like there are 8 additions and 4 deletions. Are these marked in the attached file? Or, will I need to go line by line and make my file identical? Or…Can I just cut and paste the entire file over the existing file?

Last question, I have not yet updated the firmware to 0.4.4, If I perform this update in the near future…probably tomorrow, will this issue already have been corrected on the update?

Thanks for your help.

Ric

How do I update only the script? Run the update script?

Thanks Elco, that’s sorted it!

For those who are as equally coding challenged…this it what I did, quote from an earlier post.

Updating your BrewPi (BrewPi Spark Only)
To update to the latest release, you can simply run our update script from the brewpi-tools repo.
If you followed or guide, this will be in ~/brewpi-tools/

So log into your brewpi via SSH (for example using putty16

And then run the following commands:

cd ~/brewpi-tools
sudo python updater.py
Quick tip: use TAB to auto-complete file names. You’ll make less errors.

The updater will update the script, web interface and dependencies. It will then ask to check for updates for your controller

That’s it. If you are up-to-date.

Good luck

Dave.

Yes, running our updater is the safest way.

Another option for advanced users is to go to the directory:
cd /home/brewpi-script
And do a git pull
git pull

If you run our updater, this fix is already included.

YES!!! Got it! Even we python/raspian/RPi challenged people can do this!!!

Thanks to all.

Ric

I assume that this does not apply if you have the arduino stack?

Correct, the current code base is not compatible with Arduino because it doesn’t fit the platform anymore.

I just ran the updater today and after a small log-in problem (user problem, not system) everything seemed to go OK. After the update I changed my beer, and switched to fridge constant temp. But after 20 minutes it does not seem to be heating. Is this a glitch? What other information should I send?

Prettige Kerstfeest

Stefan