Unable to flash firmware to Photon

Hi all, I’ve been trying to flash the firmware onto my photon for the firt time but i’ve been having some issues… It is a stand alone Photon if that matters, BrewPi has never been loaded on it before. Everything looks like it’s going well until it tries to open a serial port at the end. I get “Warning: Cannot receive version number from controller. Your controller is either not programmed yet or running a very old version of BrewPi. It will be reset to defaults.
Resetting EEPROM to default settings”

I tried a lot of different things after looking at many posts and thought I may have screwed things up worse in the process. To be sure, I reformatted my SD card and started with a fresh install of Raspbian. I updated the RPi, installed BrewPi-tools and started fresh but still no luck…

Here is the log:

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
[Errno 2] No such file or directory
Could not connect to socket of BrewPi process, maybe it just started and is not listening yet.
Could not send quit message to BrewPi instance with pid 6130!
Killing it instead!
SIGKILL sent to BrewPi instance with pid 6130!
You are on branch develop
Your checked out branch is not master, our stable release branch.
It is highly recommended that you switch to the stable master branch. Would you like to do that? [Y/n]:y
Switching branch to master
The master branch is not your currently active branch - would you like me to check it out for you now? (Required to continue) [Y/n]: y
Branch master set up to track remote branch master from origin.
Successfully switched to master
The latest commit in /home/brewpi is 7711c14de039f88c8f119f83acb2436b38e14923 on Thu, 01 Dec 2016 06:04:01
The latest commit on origin/master is 7711c14de039f88c8f119f83acb2436b38e14923 on Thu, 01 Dec 2016 06:04:01
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/html is 1e0778703edbbd3ef33072ba0b260c491fba90cc on Mon, 11 Jan 2016 08:04:54
The latest commit on origin/master is 1e0778703edbbd3ef33072ba0b260c491fba90cc on Mon, 11 Jan 2016 08: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 13 old .pyc files
Deleted 3 empty directories

***** 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… *****

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 …
Checking entry for wifichecker …
Done checking entry wifichecker …
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…
Mar 22 2017 18:09:37 Opening serial port
Unable to receive version from controller.
Is your controller unresponsive and do you wish to try restoring your firmware? [y/N]:
y
Will try to restore the firmware on your Particle Photon
Please put your controller in DFU mode now by holding the setup button during reset, until the LED blinks yellow.
Press Enter when ready.

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 not be restored
Devices will not be restored

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
dfu-util not found, downloading dfu-util…
downloading http://dfu-util.sourceforge.net/releases/dfu-util-0.7-binaries/linux-armel/dfu-util
Detecting DFU devices
Found 1 devices: [‘2b04:d006’]
Device identified as Particle Photon
First updating system firmware for the Photon, part 1: /home/brewpi/utils/downloads/0.4.4/system-part1-0.5.3-photon.bin
dfu-util 0.7

Copyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2012 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Filter on vendor = 0x2b04 product = 0xd006
Opening DFU capable USB device… ID 2b04:d006
Run-time device DFU version 011a
Found DFU: [2b04:d006] devnum=0, cfg=1, intf=0, alt=0, name="@Internal Flash /0x08000000/03016Ka,01016Kg,01064Kg,07128Kg"
Claiming USB DFU Interface…
Setting Alternate Setting #0
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
No valid DFU suffix signature
Warning: File has no DFU suffix
DfuSe interface name: "Internal Flash "
Downloading to address = 0x08020000, size = 250956

File downloaded successfully
Continuing updating system firmware for the Photon, part 2: /home/brewpi/utils/downloads/0.4.4/system-part2-0.5.3-photon.bin
dfu-util 0.7

Copyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2012 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Filter on vendor = 0x2b04 product = 0xd006
Opening DFU capable USB device… ID 2b04:d006
Run-time device DFU version 011a
Found DFU: [2b04:d006] devnum=0, cfg=1, intf=0, alt=0, name="@Internal Flash /0x08000000/03016Ka,01016Kg,01064Kg,07128Kg"
Claiming USB DFU Interface…
Setting Alternate Setting #0
Determining device status: state = dfuDNLOAD-IDLE, status = 0
aborting previous incomplete transfer
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
No valid DFU suffix signature
Warning: File has no DFU suffix
DfuSe interface name: "Internal Flash "
Downloading to address = 0x08060000, size = 189068

File downloaded successfully
Now writing BrewPi firmware /home/brewpi/utils/downloads/0.4.4/brewpi-photon-0.4.4.bin to Photon
dfu-util 0.7

Copyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2012 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Filter on vendor = 0x2b04 product = 0xd006
Opening DFU capable USB device… ID 2b04:d006
Run-time device DFU version 011a
Found DFU: [2b04:d006] devnum=0, cfg=1, intf=0, alt=0, name="@Internal Flash /0x08000000/03016Ka,01016Kg,01064Kg,07128Kg"
Claiming USB DFU Interface…
Setting Alternate Setting #0
Determining device status: state = dfuDNLOAD-IDLE, status = 0
aborting previous incomplete transfer
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
No valid DFU suffix signature
Warning: File has no DFU suffix
DfuSe interface name: "Internal Flash "
Downloading to address = 0x080a0000, size = 88164

File downloaded successfully
Programming done

Updating firmware over DFU finished

Waiting for device to reset.
Mar 22 2017 18:11:15 Opening serial port
Warning: Cannot receive version number from controller. Your controller is either not programmed yet or running a very old version of BrewPi. It will be reset to defaults.
Resetting EEPROM to default settings
Warning: Cannot receive version number from controller after programming.
Something must have gone wrong. Restoring settings/devices settings failed.

BrewPi script will restart automatically.
Firmware update done

I have tried running flashDfu.py with the same results. Any ideas?

The BrewPi firmware cannot run on a bare photon. It expects certain peripherals to be available, for example the OneWire bus master and the display. It is probably hanging in the display calibration routine.
It looks like the firmware flashed sucessfully from the log file.

So you need the BrewPi Spark board to use our firmware.

Oh, okay. That makes sense. Thanks for the quick response!

I think I have this problem after updating. The screen is black with a blinking blue light. I don’t understand what the fix is. Can someone dumb it down for me? Cheers.

The bootloader needs an update. If you set up WiFi with the particle iOS or Android app it will download it from the cloud.