Scripts hang at "Opening serial port" message


#1

I recently got everything configured and working great, then this weekend I had to shut both the BPi and RPi down to make some wiring changes on my control panel. I plugged everything back in and got a white screen on the BrewPi. I went to flash the photon with flashDfy.py and continue but it hangs at the “Nov 22 2015 21:53:52 Opening serial port” print out (after the double beep). It will not go past that. I tried running updater.py as well and got the same stall out. I’ve tried fixing the permissions as well with the fixPermissions.py script and manually. I’m stumped.

> $ sudo python /home/brewpi/utils/flashDfu.py --testmode
> Will set device to test mode after flashing
> 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 1 devices:  ['2b04:d006']
> Device identified as Particle Photon
> Downloading latest firmware...
> Latest stable version on GitHub: 0.2.11
> downloading https://github.com/BrewPi/firmware/releases/download/0.2.11/brewpi-0.2.11-photon.bin
> Firmware downloaded to /home/brewpi/utils/downloads/0.2.11/brewpi-0.2.11-photon.bin
> downloading https://github.com/BrewPi/firmware/releases/download/0.2.11/system-part1-09dd809-photon.bin
> downloading https://github.com/BrewPi/firmware/releases/download/0.2.11/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/brewpi/utils/downloads/0.2.11/brewpi-0.2.11-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 = 57432
> ...............
> File downloaded successfully
> Error during download get_status
> Error during download get_status
> Programming done, now resetting EEPROM to defaults
> Opening serial port
> Nov 22 2015 21:53:52   Opening serial port

Also, note the following output from autoSerial.py so I think I am getting a good connection with my USB cable.

$ sudo python /home/brewpi/autoSerial.py
All ports:  (('/dev/ttyACM0', 'ttyACM0', 'USB VID:PID=2b04:c006 SNR=00000000050C'),)
Compatible ports:  (('/dev/ttyACM0', 'Particle Photon'),)
Selected port:  ('/dev/ttyACM0', 'Particle Photon')

#2

I was able to solve this partially by working with Elco directly. The white screen issue is related to a faulty screen which will be replaced, but the serial port issue was resolved by flashing the DFU directly with a newer (developer) build using dfu-util and then reverting it back to the stable release using flashDFU.py. Very odd issue but now resolved.


#3

Hi @Elco and @Denny_Deaton, I think I’m experiencing a similar issue while trying to flash a Photon from an RPi. So far I just have the Photon and the RPi (no BrewPi shield yet). I followed the software install guide to update/upgrade the RPi and installed BrewPi with no issue. I put the Photon in DFU mode and ran ‘sudo python /home/brewpi/utils/flashDfu.py’ with the output shown below:

Using dfu-util binary at /home/brewpi/utils/downloads/dfu-util
    Detecting DFU devices
    Found 1 devices:  ['2b04:d006']
    Device identified as Particle Photon
    Downloading latest firmware...
    Latest stable version on GitHub: 0.4.1
    downloading https://github.com/BrewPi/firmware/releases/download/0.4.1/brewpi-0.4.1-photon.bin
    Firmware downloaded to /home/brewpi/utils/downloads/0.4.1/brewpi-0.4.1-photon.bin
    Updated system firmware for the photon found in release 0.4.0
    downloading https://github.com/BrewPi/firmware/releases/download/0.4.0/system-part1-0.4.7-photon.bin
    downloading https://github.com/BrewPi/firmware/releases/download/0.4.0/system-part2-0.4.7-photon.bin
    Downloaded new system firmware to:

    /home/brewpi/utils/downloads/0.4.0/system-part1-0.4.7-photon.bin and

    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 = 249740
    .............................................................
    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 = 169832
    ..........................................
    File downloaded successfully
    Now writing BrewPi firmware /home/brewpi/utils/downloads/0.4.1/brewpi-0.4.1-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 = 85216
    .....................
    File downloaded successfully
    Programming done
    Now resetting EEPROM to defaults
    Opening serial port
    Dec 20 2015 08:53:08   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
     INFO MESSAGE 15: EEPROM initialized

Does it matter that I don’t have a screen or other hardware on the BrewPi Spark Shield connected?


#4

I too am getting the message that it is unable to open the serial port. This is using a Spark Photon that I purchased on my own. I have been unable to flash the firmware by any method. Is there an updated version that will resolve this?


#5

May i know how you solved the issue of serial port unable to open? i am able to scan and connect all ble devices but when i try to update the firmware it says "unable to open serial port "