BrewPi/brewpi-script

UnboundLocalError: local variable 'line' referenced before assignment

Closed this issue · 0 comments

(brewpi)[rbrady@localhost utils]$ sudo python flash_dfu.py --tag 0.3.0a --autodfu
[sudo] password for rbrady:
Will try to download release '0.3.0a'
Will automatically reboot newly detected photons into DFU mode
Detecting DFU devices
Did not find any DFU devices.
Is your Photon or Spark Core running in DFU mode (blinking yellow)?
Waiting until a DFU device is connected...
Found new serial port connected: ('/dev/ttyACM9', 'Particle Photon')
Putting Photon in DFU mode
Found 1 devices: ['2b04:d006']
Device identified as Particle Photon
Downloading latest firmware...
downloading https://github.com/BrewPi/firmware/releases/download/0.3.0a/brewpi-0.3.0a-photon.bin
Firmware downloaded to /home/rbrady/brewpi-script/utils/downloads/0.3.0a/brewpi-0.3.0a-photon.bin
downloading https://github.com/BrewPi/firmware/releases/download/0.3.0a/system-part1-09dd809-photon.bin
downloading https://github.com/BrewPi/firmware/releases/download/0.3.0a/system-part2-09dd809-photon.bin
Release contains updated system firmware for the photon
First updating system firmware for the 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/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 = 0x08020000, size = 248764
.............................................................
File downloaded successfully
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 = 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 = 150432
.....................................
File downloaded successfully
Now writing BrewPi firmware /home/rbrady/brewpi-script/utils/downloads/0.3.0a/brewpi-0.3.0a-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/03_016Ka,01_016Kg,01_064Kg,07_128Kg"
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 = 58164
...............
File downloaded successfully
Error during download get_status
Error during download get_status
Programming done, now resetting EEPROM to defaults
Opening serial port
Aug 08 2015 16:58:24 Opening serial port
Traceback (most recent call last):
File "flash_dfu.py", line 203, in
programmer.fetch_version("Success! ")
File "/home/rbrady/brewpi-script/utils/../program_controller.py", line 296, in fetch_version
version = brewpi_version.getVersionFromSerial(self.ser)
File "/home/rbrady/brewpi-script/utils/../brewpi_version.py", line 39, in getVersionFromSerial
if line:
UnboundLocalError: local variable 'line' referenced before assignment