Firmware 0.2.8: Fermentation GUI is out

Dear brewers,

We have a big update ready for you guys: firmware version 0.2.8 is out!

New user interface

The biggest change in this release is that it that the display now shows:

  • Beer, fridge and room temperature
  • Beer and fridge setpoint
  • Mode
  • Heating/Cooling/Idle

Please see the photo below (sorry for the bad lighting conditions).

We added a nice big font for numbers which is used for temperatures and set points. Some of you might recognize the font from German traffic signs. Big bright blocks was what we had in mind. The UI will be refined with time: the layout and colors can probably use some tweaking, but that was no excuse to hold back the release. Your feedback will be very welcome! Some of the text might be a bit small, but space on the screen is limited.
This new UI is almost entirely Matthew’s work (@mdma), so show him some love!

At startup, the controller now shows the BrewPi logo for 5 seconds. During these 5 seconds, you can tap the screen if the touch screen needs to be re-calibrated.

The test screen, which will be very helpful when building your fermentation fridge, is still available.

When you set the mode to Test Mode under advanced settings, your controller will automatically switch to this screen. It will show you all connected temperature sensors and with the 3 buttons on the bottom row you can toggle the outputs.

Arduino support

We split off the firmware repository from the brewpi-avr repository a few months ago to port it to the Spark Core. We have now refactored all our code so we can build again for the Arduino, so we only have a single repository for all platforms.
From now on, our Arduino users will get the latest update if the hardware supports it. The Arduino is still not recommended for new users. We are running into the limits of the platform and not all new features will be available in the future.

Reliability updates

We changed how temperature sensors are initialized. We detect when a sensor has just been connected by writing a value into the volatile memory of the sensor. We can check this value to see whether the sensor has been disconnected and do a proper slow initialization in that case. This should fix any issues that people had with not getting the right temperatures on their screen.
We also refactored OneWire to be faster and more reliable. For a full list of changes, please refer to the Changelog on GitHub.

Updating your BrewPi

I have worked the entire weekend to improve and simplify the update process. We wanted to release the firmware on Friday, but reasoned that it would be smarter to revamp the update process first to make the release as smooth as possible.

Our update script now fetches the latest firmware from the GitHub Releases using their API, flashes it to your controller and then restores all your settings.

You can run the updater (which is part of the brewpi-tools repo) with the following command:

cd ~/brewpi-tools
sudo python updater.py

We removed most of the prompts from the update script, because most users just want to update to the latest stable release. If you still want to be asked which remote and which branch to update from, you can run the updater with and extra argument:

sudo python updater.py --ask

Next up

We switched to using regular GitHub issues to manage our tasks and planning. This makes the development process transparent towards our users and lowers the barrier to contributing. For our next sprint, @mdma started with making the user interface interactive (touch) and I will start looking at PWM support.

If you would like to help out, please just drop us a line. We use Slack for communication between developers and if you want to help out, we’ll send you and invite to discuss what you can do.

There are several open tasks in Python and in the web interface (mainly JavaScript).

I will also start with better documentation of the whole setup process. I know the available info is very minimal, but prioritized this release.

Cheers!

:beers:

Elco Jacobs

9 Likes

Awesome work @Elco nd @mdma! Just upgraded and it’s looking good. Question- for those of us running the brewpi spark, do we still need to update on the develop branch? It doesn’t appear to be the case, but I wanted to verify.

Good question. Please switch back to master on everything :smile:

develop will be our developing branch and should not be treated as stable. When we have tested new features properly, these will be merged into master.

1 Like

@mdma @elco The GUI looks great. Way to go fellows!

1 Like

How will this affect those of us who are running multiple inatances. What would be the process of getting everything updated.

If you do not have your web interface and script in /var/www/ and /home/brewpi, the updater will ask you where it can find it.

If the updater does not work well, you can still do a git pull in each directory manually:

git checkout master
git pull

After that, run this in each script dir:

bash utils/runAfterUpdate.sh

Update your Arduino with:

python util/updateFirmware.py

Please make a backup of all directories first.

Allrighty! Now just contact my friend who knows more from IT and let him install this new version.

Awesome work guys!! Can’t wait to get back from work now!

So, just to confirm, if I am currently on the development branch do I just simply run the commands in the first post above, or do I need to manually switch back to master before updating? If I need to manually switch back, how do I do this?

Thanks again @Elco

The updater will ask you if you want to get back on the master branch.

Perhaps just being stupid, but after updating how do I switch out of testing mode?

Glad you asked, I’m sure there are others wondering the same thing! :+1:

In the web UI, select the mode, like off, fridge constant, beer constant, beer profile. This will change the mode away from “test”.

To go back to test mode, select the “Advanced Settings” tab and select the desired mode with the “mode” drop-down.

1 Like

I moved 10 posts to a new topic: Updating manually (because I’m running multiple instances of BrewPi on one pi)

Thanks - worked great! I had to switch it to ‘off’ first - if you switch it to beer constant or fridge constant it says invalid mode and it remains in test mode.

Hello there,

I’m having a bit of trouble, and I don’t know what to do, any help would be greatly appreciated. This is what I see when I try to update the firmware. Also, when I try to update it on the web host, I get an error telling me I didn’t specify the board, even though I did say it was the Spark Core.

Thanks,

pi@raspberrypi ~/brewpi-tools $ sudo python 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
You are on branch master
The latest commit in /home/brewpi is 02314980470a75242fdc8f022e35de4d4bd1fcec on Wed, 15 Apr 2015 23:09:19
The latest commit on origin/master is 02314980470a75242fdc8f022e35de4d4bd1fcec on Wed, 15 Apr 2015 23:09:19
Your local version of /home/brewpi is up to date!

*** Updating BrewPi web interface repository ***
You are on branch master
The latest commit in /var/www is d44c03e786d0bde0dc43f86a8bd655659f3f3d2b on Wed, 11 Mar 2015 21:59:39
The latest commit on origin/master is d44c03e786d0bde0dc43f86a8bd655659f3f3d2b on Wed, 11 Mar 2015 21:59:39
Your local version of /var/www is up to date!

No changes were made, skipping runAfterUpdate.sh.
If you encounter problems, you can start it manually with:
sudo /home/brewpi/utils/runAfterUpdate.sh

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…
Current firmware version on controller: 0.2.7

Checking GitHub for latest release…
Traceback (most recent call last):
File “updater.py”, line 424, in
updateFirmware.updateFromGitHub(userInput) # update and restore settings, do not prompt user
File “/home/brewpi/utils/updateFirmware.py”, line 66, in updateFromGitHub
releases = gitHubReleases(“https://api.github.com/repos/BrewPi/firmware”)
File “/home/brewpi/utils/gitHubReleases.py”, line 9, in init
self.update()
File “/home/brewpi/utils/gitHubReleases.py”, line 32, in update
self.releases = json.load(urllib2.urlopen(self.url + “/releases”))
File “/usr/lib/python2.7/urllib2.py”, line 127, in urlopen
return _opener.open(url, data, timeout)
File “/usr/lib/python2.7/urllib2.py”, line 401, in open
response = self._open(req, data)
File “/usr/lib/python2.7/urllib2.py”, line 419, in _open
’_open’, req)
File “/usr/lib/python2.7/urllib2.py”, line 379, in _call_chain
result = func(*args)
File “/usr/lib/python2.7/urllib2.py”, line 1219, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File “/usr/lib/python2.7/urllib2.py”, line 1181, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno -5] No address associated with hostname>
pi@raspberrypi ~/brewpi-tools $ sudo /home/brewpi/utils/runAfterUpdate.sh
Cleaning up BrewPi script directory…
Deleted 13 old .pyc files

***** Installing/updating required packages… *****

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.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

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

Cannot fetch index base URL http://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement pyserial in /usr/local/lib/python2.7/dist-packages
No distributions at all found for pyserial in /usr/local/lib/python2.7/dist-packages
Storing complete log in /root/.pip/pip.log

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

***** Updating cron for the brewpi user… *****

no crontab for brewpi
Checking entry for brewpi …
Done checking entry brewpi …
Checking entry for wifichecker …
Done checking entry wifichecker …
Restarting cron
[ ok ] Restarting periodic command scheduler: cron[…] Stopping periodic command scheduler: cron.
[ ok ] Starting periodic command scheduler: cron.

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

***** Fixing file permissions for /home/brewpi *****
pi@raspberrypi ~/brewpi-tools $ .

Hi guys,

I have some troubles to update to 0.2.8 but the error seems to be different than @kekich one. I tried several times with the python script (using the web interface leads to the same issue)

The error is

Problem flashing file: 87

Can’t figure out what this means. Could you please help?

The full console output is reported here below:

sudo python 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 20391!
You are on branch master
The latest commit in /home/brewpi  is 02314980470a75242fdc8f022e35de4d4bd1fcec on Thu, 16 Apr 2015 01:09:19
The latest commit on origin/master is 02314980470a75242fdc8f022e35de4d4bd1fcec on Thu, 16 Apr 2015 01:09:19
Your local version of /home/brewpi is up to date!


*** Updating BrewPi web interface repository ***
You are on branch master
The latest commit in /var/www      is d44c03e786d0bde0dc43f86a8bd655659f3f3d2b on Wed, 11 Mar 2015 22:59:39
The latest commit on origin/master is d44c03e786d0bde0dc43f86a8bd655659f3f3d2b on Wed, 11 Mar 2015 22:59:39
Your local version of /var/www is up to date!

No changes were made, skipping runAfterUpdate.sh.
If you encounter problems, you can start it manually with:
sudo /home/brewpi/utils/runAfterUpdate.sh

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...
 Current firmware version on controller: 0.2.7
 
Checking GitHub for latest release...
 Latest version on GitHub: 0.2.8
 
Version on GitHub is newer than your current version, downloading new version...
 Downloading latest firmware...
downloading https://github.com/BrewPi/firmware/releases/download/0.2.8/brewpi-spark-core.bin
 Latest firmware downloaded to /home/brewpi/utils/downloads/0.2.8/brewpi-spark-core.bin
 ****    Spark Core Program script started    ****
 Settings will be restored if possible
 Devices will be restored if possible
 Checking old version before programming.
 Checking current version: Found BrewPi v0.2.7 build 0, running on a Spark Core with a Rev-C shield on port /dev/ttyACM0

 Requesting old settings from Spark Core...
 Saved old settings to file settings-Apr-18-2015-13-44-06.json
 
 Problem flashing file: 87
Please try again.
BrewPi script will restart automatically.


*** Done updating BrewPi! ***

And this is what is inside the stderr.txt file:

 Apr 18 2015 13:43:44   quit message received on socket. Stopping script.
 Apr 18 2015 13:45:06   Notification: Script started for beer 'My First BrewPi Run'
 Apr 18 2015 13:45:16   Checking software version on controller...
 Apr 18 2015 13:45:16   Found BrewPi v0.2.7 build 0, running on a Spark Core with a Rev-C shield on port /dev/ttyACM0

Looks like it cannot resolve the url to GitHub. Check your Internet connection and try to ping GitHub.

During the flashing, the core is running a process from Spark’s framework to receive the new firmware. This protocol is not always reliable, but usually works on retry. It also seems to be more reliable on Windows than on linux/osx. We are going to try to change the protocol, it does not only affect BrewPi, but all Spark Core users.

In the meantime you could try programming in Dfu mode if it keeps failing.

I can connect to the internet, and I can ping google.com, yahoo.com, and github.com without any issue.

The url it is trying to read is https://api.github.com/repos/BrewPi/firmware/releases

I wonder why it doesn’t work.