Spark setup problems [SOLVED]


#1

After my issues getting the script running i thought it would be a simple case of setting up the sensors etc and starting to test my brew fridge out. After updating the Sparks firmware as per the instructions everything seemed to be going well when after assigning one of the sensors to the beer control the Spark started beeping. I then tried to unassign it to the beer and all I got was a single tone for about 30 seconds and then the screen went white. There now seems to be no way to get the Spark to reboot as every time it fires up it just goes straight to the white screen and there is no way to re flash it.

Prior to setting up the device all sensors and relays were working from the Sparks test UI.

Any helping on sorting this and getting a functioning Spark would be appreciated.


#2

Hi Huckwell, this is very strange behavior that I have not seen before.

Can you email me your full log file (in /home/brewpi/logs/stderr.txt)?
Did you flash brewpi.bin from our official release?
I have no idea why your core is doing this, but I really want to know. If you send me your skype id in a PM, I can help you out more easily and perhaps see the symptoms.

You can reflash your core by restoring it to factory defaults.
Via the two small holes in the bottom of the enclosure, you can press the mode and reset button on the spark core with a pin. If you hold the mode button (bottom one) for 10 seconds at startup, the core will restore it’s factory firmware.

See factory reset on this page: http://docs.spark.io/connect/

You can then flash brewpi.bin from 0.2.7 again via the Spark Cloud over WiFi, bottom of this page:
http://docs.spark.io/api/

Alternatively, you can flash over USB with DFU:
http://docs.spark.io/connect/#appendix-dfu-mode-device-firmware-upgrade


#3

Thanks for the help Elco. Not sure how to attach text files but the following is what came up when the error happened:

. Please upload a new version of BrewPi to your Arduino.
**** Spark Core Program script started ****

Settings will not be restored

Devices will not be restored

Checking old version before programming.

Checking current version: Found BrewPi v0.2.6 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 oldAvrSettings-Mar-13-2015-15-25-53.json

Waiting for the binary file to be sent … (press ‘a’ to abort)

sent packet nr 0

sent packet nr 0

File flashed successfully

Waiting for device to reset.

Checking new version: Found BrewPi v0.2.6 build 0, running on a Spark Core with a Rev-C shield on port /dev/ttyACM0

Resetting EEPROM to default settings

Spark Core debug message: INFO MESSAGE 15: EEPROM initialized

Now checking which settings and devices can be restored…

No settings to restore!

No devices to restore!

**** Program script done! ****

If you started the program script from the web interface, BrewPi will restart automatically

Mar 13 2015 15:26:30 New program uploaded to Arduino, script will restart
Mar 13 2015 15:26:39 Notification: Script started for beer 'My First BrewPi Run’
Mar 13 2015 15:26:49 Found BrewPi v0.2.6 build 0, running on a Spark Core with a Rev-C shield on port /dev/ttyACM0

Mar 13 2015 15:28:12 Installed devices received: []
Mar 13 2015 15:28:12 Available devices received: [{‘a’: ‘28FA9A7306000058’, ‘c’: 1, ‘b’: 0, ‘d’: 0, ‘f’: 0, ‘i’: -1, ‘h’: 2, ‘j’: 0.0, ‘p’: 0, ‘t’: 0}, {‘a’: ‘28AE187406000064’, ‘c’: 1, ‘b’: 0, ‘d’: 0, ‘f’: 0, ‘i’: -1, ‘h’: 2, ‘j’: 0.0, ‘p’: 0, ‘t’: 0}, {‘a’: ‘28819F73060000EA’, ‘c’: 1, ‘b’: 0, ‘d’: 0, ‘f’: 0, ‘i’: -1, ‘h’: 2, ‘j’: 0.0, ‘p’: 0, ‘t’: 0}, {‘c’: 1, ‘b’: 0, ‘d’: 0, ‘f’: 0, ‘i’: -1, ‘h’: 1, ‘p’: 10, ‘t’: 0, ‘x’: 1}, {‘c’: 1, ‘b’: 0, ‘d’: 0, ‘f’: 0, ‘i’: -1, ‘h’: 1, ‘p’: 11, ‘t’: 0, ‘x’: 1}, {‘c’: 1, ‘b’: 0, ‘d’: 0, ‘f’: 0, ‘i’: -1, ‘h’: 1, ‘p’: 16, ‘t’: 0, ‘x’: 1}]
Mar 13 2015 15:28:49 Device updated to: {“i”:0,“t”:1,“c”:1,“b”:1,“f”:9,“h”:2,“d”:0,“p”:0,“a”:“28FA9A7306000058”,“j”: 0.000}
Mar 13 2015 15:29:11 Arduino debug message: WARNING 2: Temperature sensor disconnected pin 0, address 28AE1874D0D8E8C8
Mar 13 2015 15:29:11 Device updated to: {“i”:1,“t”:1,“c”:1,“b”:0,“f”:6,“h”:2,“d”:0,“p”:0,“a”:“28AE1874D0D8E8C8”,“j”: 0.000}
Mar 13 2015 15:29:11 Arduino debug message: WARNING 1: Invalid command received by Arduino: 6
Mar 13 2015 15:29:11 Arduino debug message: WARNING 1: Invalid command received by Arduino: 0
Mar 13 2015 15:29:11 Arduino debug message: WARNING 1: Invalid command received by Arduino: 0
Mar 13 2015 15:29:11 Arduino debug message: WARNING 1: Invalid command received by Arduino: 0
Mar 13 2015 15:29:11 Arduino debug message: WARNING 1: Invalid command received by Arduino: 0
Mar 13 2015 15:29:11 Arduino debug message: WARNING 1: Invalid command received by Arduino: 6
Mar 13 2015 15:29:11 Arduino debug message: WARNING 1: Invalid command received by Arduino: 4
Mar 13 2015 15:29:11 Arduino debug message: WARNING 1: Invalid command received by Arduino: "
Mar 13 2015 15:29:11 Arduino debug message: WARNING 1: Invalid command received by Arduino: }
Mar 13 2015 15:29:39 Device updated to: {“i”:2,“t”:1,“c”:1,“b”:0,“f”:5,“h”:2,“d”:0,“p”:0,“a”:“28819F73060000EA”,“j”: 0.000}
Mar 13 2015 15:29:51 Installed devices received: [{‘a’: ‘28FA9A7306000058’, ‘c’: 1, ‘b’: 1, ‘d’: 0, ‘f’: 9, ‘i’: 0, ‘h’: 2, ‘j’: 0.0, ‘p’: 0, ‘t’: 1}, {‘a’: ‘28AE1874D0D8E8C8’, ‘c’: 1, ‘b’: 0, ‘d’: 0, ‘f’: 6, ‘i’: 1, ‘h’: 2, ‘j’: 0.0, ‘p’: 0, ‘t’: 1}, {‘a’: ‘28819F73060000EA’, ‘c’: 1, ‘b’: 0, ‘d’: 0, ‘f’: 5, ‘i’: 2, ‘h’: 2, ‘j’: 0.0, ‘p’: 0, ‘t’: 1}]
Mar 13 2015 15:29:52 Available devices received: [{‘a’: ‘28AE187406000064’, ‘c’: 1, ‘b’: 0, ‘d’: 0, ‘f’: 0, ‘i’: -1, ‘h’: 2, ‘j’: 0.0, ‘p’: 0, ‘t’: 0}, {‘c’: 1, ‘b’: 0, ‘d’: 0, ‘f’: 0, ‘i’: -1, ‘h’: 1, ‘p’: 10, ‘t’: 0, ‘x’: 1}, {‘c’: 1, ‘b’: 0, ‘d’: 0, ‘f’: 0, ‘i’: -1, ‘h’: 1, ‘p’: 11, ‘t’: 0, ‘x’: 1}, {‘c’: 1, ‘b’: 0, ‘d’: 0, ‘f’: 0, ‘i’: -1, ‘h’: 1, ‘p’: 16, ‘t’: 0, ‘x’: 1}]
Mar 13 2015 15:30:29 Arduino debug message: WARNING 2: Temperature sensor disconnected pin 0, address 28FA9A73D0FFFFFF
Mar 13 2015 15:30:29 Device updated to: {“i”:0,“t”:1,“c”:1,“b”:0,“f”:5,“h”:2,“d”:0,“p”:0,“a”:“28FA9A73D0FFFFFF”,“j”: 0.000}
Mar 13 2015 15:30:29 Arduino debug message: WARNING 1: Invalid command received by Arduino: 6
Mar 13 2015 15:30:29 Arduino debug message: WARNING 1: Invalid command received by Arduino: 0
Mar 13 2015 15:30:29 Arduino debug message: WARNING 1: Invalid command received by Arduino: 0
Mar 13 2015 15:30:29 Arduino debug message: WARNING 1: Invalid command received by Arduino: 0
Mar 13 2015 15:30:29 Arduino debug message: WARNING 1: Invalid command received by Arduino: 0
Mar 13 2015 15:30:29 Arduino debug message: WARNING 1: Invalid command received by Arduino: 5
Mar 13 2015 15:30:29 Arduino debug message: WARNING 1: Invalid command received by Arduino: 8
Mar 13 2015 15:30:29 Arduino debug message: WARNING 1: Invalid command received by Arduino: "
Mar 13 2015 15:30:29 Arduino debug message: WARNING 1: Invalid command received by Arduino: }
Mar 13 2015 15:30:37 Installed devices received: [{‘a’: ‘28FA9A73D0FFFFFF’, ‘c’: 1, ‘b’: 0, ‘d’: 0, ‘f’: 5, ‘i’: 0, ‘h’: 2, ‘j’: 0.0, ‘p’: 0, ‘t’: 1}, {‘a’: ‘28AE1874D0D8E8C8’, ‘c’: 1, ‘b’: 0, ‘d’: 0, ‘f’: 6, ‘i’: 1, ‘h’: 2, ‘j’: 0.0, ‘p’: 0, ‘t’: 1}, {‘a’: ‘28819F73060000EA’, ‘c’: 1, ‘b’: 0, ‘d’: 0, ‘f’: 5, ‘i’: 2, ‘h’: 2, ‘j’: 0.0, ‘p’: 0, ‘t’: 1}]
Mar 13 2015 15:30:37 Available devices received: [{‘a’: ‘28FA9A7306000058’, ‘c’: 1, ‘b’: 0, ‘d’: 0, ‘f’: 0, ‘i’: -1, ‘h’: 2, ‘j’: 0.0, ‘p’: 0, ‘t’: 0}, {‘a’: ‘28AE187406000064’, ‘c’: 1, ‘b’: 0, ‘d’: 0, ‘f’: 0, ‘i’: -1, ‘h’: 2, ‘j’: 0.0, ‘p’: 0, ‘t’: 0}, {‘c’: 1, ‘b’: 0, ‘d’: 0, ‘f’: 0, ‘i’: -1, ‘h’: 1, ‘p’: 10, ‘t’: 0, ‘x’: 1}, {‘c’: 1, ‘b’: 0, ‘d’: 0, ‘f’: 0, ‘i’: -1, ‘h’: 1, ‘p’: 11, ‘t’: 0, ‘x’: 1}, {‘c’: 1, ‘b’: 0, ‘d’: 0, ‘f’: 0, ‘i’: -1, ‘h’: 1, ‘p’: 16, ‘t’: 0, ‘x’: 1}]
Mar 13 2015 15:31:26 Arduino debug message: WARNING 2: Temperature sensor disconnected pin 0, address 28819F73D0FFFFFF
Mar 13 2015 15:31:26 Device updated to: {“i”:2,“t”:1,“c”:1,“b”:1,“f”:9,“h”:2,“d”:0,“p”:0,“a”:“28819F73D0FFFFFF”,“j”: 0.000}
Mar 13 2015 15:31:26 Arduino debug message: WARNING 1: Invalid command received by Arduino: 6
Mar 13 2015 15:31:26 Arduino debug message: WARNING 1: Invalid command received by Arduino: 0
Mar 13 2015 15:31:26 Arduino debug message: WARNING 1: Invalid command received by Arduino: 0
Mar 13 2015 15:31:26 Arduino debug message: WARNING 1: Invalid command received by Arduino: 0
Mar 13 2015 15:31:26 Arduino debug message: WARNING 1: Invalid command received by Arduino: 0
Mar 13 2015 15:31:26 Arduino debug message: INFO MESSAGE 15: EEPROM initialized
Mar 13 2015 15:31:26 Arduino debug message: WARNING 1: Invalid command received by Arduino: "
Mar 13 2015 15:31:26 Arduino debug message: WARNING 1: Invalid command received by Arduino: }
Mar 13 2015 15:32:15 Arduino debug message: WARNING 2: Temperature sensor disconnected pin 0, address 28819F73D0FFFFFF
Traceback


Software Install Guide
#4

Just chiming in to say mine started beeping just like Huckwell’s as I was assigning the probes. I shut everything down and didn’t have the white screen issue. When it restarted everything was normal again, so I tried reassigning the probes, it started beeping again. I am running the latest update.


#5

Flashing 0.2.7 has not worked, It should have received about 90 packets, with 0 being the last one. It just reverted back to the firmware that was allready on there: 0.2.6.

There was a bug in 0.2.6, too low serial timeout. This has been fixed in 0.2.7. That is were all those invalid commands received come from: the message was cut off early and the remainder of the message is being interpreted as a new message.

Can you try to flash 0.2.7 again? Make sure to get the file from GitHub with right click ‘save as…’.

Flashing 0.2.7 should fix this. Because you still have 0.2.6 on the device, you should be able to flash via the web interface.

If you cannot flash via the web interface, because you do not have brewpi on the device anymore (no 2 beeps at startup) or in any other emergency case, you can flash via DFU.

To do this, download a compiled binary of dfu-util (this instruction is for the raspberry pi, if you are not running on a pi, you will need a different version). Do not install it from apt-get, the version on apt is outdated (0.5). After download, change the permissions to allow executing it with chmod:

cd ~
wget http://dfu-util.sourceforge.net/releases/dfu-util-0.7-binaries/linux-armel/dfu-util
sudo chmod 777 dfu-util

Also download the binary to flash to the user’s home directory:

wget https://github.com/BrewPi/firmware/releases/download/0.2.7/brewpi.bin

Put your spark core in DFU mode. This is done by resetting the device while holding the mode button until you see a yellow LED flashing. With the Spark Core being inside the enclosure, this is a bit harder.
There are two holes in the bottom. When looking into the USB connector, the right hole is above the mode button and the left hole is above the reset button.

I find it easiest to hold the mode button down with a pin, while plugging in the USB cable. After 3 seconds, the light should flash. If you hold it for 10 seconds, this will do a factory reset. Don’t do this.

List devices with dfu-util:

./dfu-util -l

It should show your device:

Found DFU: [1d50:607f] devnum=0, cfg=1, intf=0, alt=0, name="UNDEFINED"
Found DFU: [1d50:607f] devnum=0, cfg=1, intf=0, alt=1, name="UNDEFINED"

Now flash brewpi.bin to the spark core, with the following command:

sudo dfu-util -d 1d50:607f -a 0 -s 0x08005000:leave -D brewpi.bin

The output should look like this:

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 = 0x1d50 product = 0x607f
Opening DFU capable USB device... ID 1d50:607f
Run-time device DFU version 011a
Found DFU: [1d50:607f] devnum=0, cfg=1, intf=0, alt=0, name="@Internal Flash  /0x08000000/20*001Ka,108*001Kg"
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 1024
No valid DFU suffix signature
Warning: File has no DFU suffix
DfuSe interface name: "Internal Flash  "
Downloading to address = 0x08005000, size = 96308
...............................................................................................
File downloaded successfully
Transitioning to dfuMANIFEST state
Error during download get_status

That last error is normal. Your controller should beep and be back with version 0.2.7


#6

Hi Elco,

Thanks for the help I have been away so only now had a chance to do this, but it is not working. I have followed the instructions to the letter and everything works fine until I do the final comand.

pi@raspberrypi ~ $ sudo dfu-util -d 1d50:607f -a 0 -s 0x08005000:leave -D brewpi.bin
sudo: dfu-util: command not found

Any idea why this is happening? Loosing a bit of patience with it.

Huckwell


#7

Install dfu-util with sudo apt-get install dfu-util.
If you need direct help, please go to store.brewpi.com and contact me via chat.

Do not install dfu-util through apt-get (which gets you 0.5), but download 0.7 from instructions above.
The error above was caused by missing ./. The correct command is:

sudo ./dfu-util -d 1d50:607f -a 0 -s 0x08005000:leave -D brewpi.bin

I have been able to help @Huckwell out via the webshop chat and teamviewer.
It seemed that the programming had indeed gone bad and a reflash via DFU fixed the issue.

If you run into issues yourself, providing support by being able to look at your screen and taking control to do things for you is a pleasure. So consider installing teamviewer for effective support!


#8

My Spark is now up and running and I am testing it out as we speak. A massive thanks to @Elco for some rapid and very effective support, much quicker than me fumbling along for the next week or so.

Looking forward to getting some beer on…


#9

I have the same problem with my Spark v2. I tried to do the new firmware update to 0.5.5 and it didnt work. In the trying process I did a factory reset by accident and now my spark v2 is completely empty.

I tried the solution from above but it doesnt work for me. I did chance the firmware to the latest because the 0.2.7 from above doesnt work anymore.
The log file:


HypriotOS/armv7: pirate@black-pearl in ~
$ ./dfu-util -l
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

Found DFU: [2b04:d006] devnum=0, cfg=1, intf=0, alt=0, name="UNDEFINED"
Found DFU: [2b04:d006] devnum=0, cfg=1, intf=0, alt=1, name="UNDEFINED"

HypriotOS/armv7: pirate@black-pearl in ~
$ sudo ./dfu-util -d 2b04:d006 -a 0 -s 0x08005000:leave -D brewpi-p1-0.5.5.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/03*016Ka,01*016Kg,01*064Kg,07*128Kg"
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 = 0x08005000, size = 97784
Error: Page at 0x08005000 is not writeable
    
HypriotOS/armv7: pirate@black-pearl in ~
$ ./dfu-util -l
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

Found DFU: [2b04:d006] devnum=0, cfg=1, intf=0, alt=0, name="UNDEFINED"
Found DFU: [2b04:d006] devnum=0, cfg=1, intf=0, alt=1, name="UNDEFINED"

HypriotOS/armv7: pirate@black-pearl in ~
$ sudo ./dfu-util -d 2b04:d006 -a 0 -s 0x08005000:leave -D brewpi-p1-0.5.5.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/03*016Ka,01*016Kg,01*064Kg,07*128Kg"
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 = 0x08005000, size = 97784
Error: Page at 0x08005000 is not writeable

#10

Oh this is a very old topic, with very out of date advice.

Just try running the flashDfu.py script instead.

Also consider reinstalling on raspbian with docker instead of hypriot. Raspbian will give you less issues and hypriot is not updated now that docker is well supported on normal raspbian.