Firmware 0.2.8: Fermentation GUI is out

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.

My update went ok until it tried to check firmware version.

   Traceback (most recent call last):
  File "updater.py", line 424, in <module>
    updateFirmware.updateFromGitHub(userInput) # update and restore settings, do not prompt user
  File "/home/brewpi/utils/updateFirmware.py", line 20, in updateFromGitHub
    import brewpiVersion
  File "/home/brewpi/brewpiVersion.py", line 21, in <module>
    from BrewPiUtil import asciiToUnicode
ImportError: cannot import name asciiToUnicode

It updated the firmware after I ran it again selecting No to update the firmaware and then running it again and selecting yes. So the 3rd time was the charm. :wink:

Update: Lost all of my settings on the update.

Looks great guys, Super easy to upgrade. Way to go, I know you have been swamped.

All looks good here - had the same error as above:

indent preformatted text by 4 spacesThe 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
Traceback (most recent call last):
File "updater.py", line 424, in <module>
updateFirmware.updateFromGitHub(userInput) # update and restore settings, do not prompt user
File "/home/brewpi/utils/updateFirmware.py", line 20, in updateFromGitHub
import brewpiVersion
File "/home/brewpi/brewpiVersion.py", line 21, in <module>
from BrewPiUtil import asciiToUnicode
ImportError: cannot import name asciiToUnicode

Checked DNS was resolving successfully, which it was, re-ran the script, and it went through fine. Successfully backed up and restored current settings as well.

Cheers,

Ben

The reason for the error is as follows:

  • The update script starts and imports module BrewPiUtil form the script dir
  • It updates the script
  • It tries to use the import asciiToUnicode, which is part of the new version, but it still has the old import and uses it instead of the new version.

That is why it works on second try. Will be fixed shortly :slight_smile:

Programming using dfu-utils worked.

Thanks for the advice