Controller debug message: WARNING 1: Invalid command received by controller: r /updating to 0.5.7 (SOLVED)


#1

Hi there,

Today I reinstalled brewpi ‘the new way’ with the docker method.

I see an error/warning message in the log file:

controller debug message: WARNING 1: Invalid command received by controller: r

Is this a serious problem?

thanks

Jul 19 2018 15:13:22 Connecting to controller...
Jul 19 2018 15:13:22 Background thread for serial started
Jul 19 2018 15:13:22 Serial (re)connected over WiFi at socket://192.168.178.45:6666
Jul 19 2018 15:13:24 Found BrewPi v0.5.5 build 0.5.5-0-g3a3680b9c, running on a Particle Photon with a V2 shield
Jul 19 2018 15:13:25 Controller debug message: WARNING 1: Invalid command received by controller: r
Jul 19 2018 15:14:55 Installed devices received: [{"c": 1, "b": 0, "d": 0, "f": 8, "i": 22, "h": 1, "p": 16, "t": 3, "v": 0, "x": 0}]
Jul 19 2018 15:14:56 Available devices received: [{"c": 1, "b": 0, "d": 0, "f": 0, "i": -1, "h": 1, "p": 17, "t": 0, "x": 0}, {"c": 1, "b": 0, "d": 0, "f": 0, "i": -1, "h": 1, "p": 11, "t": 0, "x": 0}, {"c": 1, "b": 0, "d": 0, "f": 0, "i": -1, "h": 1, "p": 10, "t": 0, "x": 0}]

#2

No, this is not a problem.
It’s a new command introduced in version 0.5.6, which 0.5.5 does not know yet.
It requests the reason for the last restart.

I just put 0.5.6 out there officially. It should finally have truly stable WiFi.

Check https://github.com/BrewPi/firmware/releases


#3

Hi Elco,

I tried to update to 0.5.6.

All went correct.

I updated as described in the wiki:

docker run -it --name brewpi-dfu --privileged -v ~/brewpi-data:/data --rm brewpi/brewpi-raspbian python utils/flashDfu.py --trigger
docker run -it --name brewpi-dfu --privileged -v ~/brewpi-data:/data --rm brewpi/brewpi-raspbian python utils/flashDfu.py --noreset 

However. the spark 2 booted in de hardware testmode. The led breathes slow blue.
There are 2 temp probes installed and they show a value.

In the webinterface no temps are displayed. In the device config I can see the 2 temp probes including the values.

What should I do?

log:

Jul 20 2018 21:00:41 Background thread for serial stopped
Jul 20 2018 21:00:53 Notification: Script started for beer '180720 belgian dubbel'
Jul 20 2018 21:00:53 Connecting to controller...
Jul 20 2018 21:00:53 Background thread for serial started
Jul 20 2018 21:00:53 Serial (re)connected over WiFi at socket://192.168.178.45:6666
Jul 20 2018 21:00:55 Found BrewPi v0.5.6 build 0.5.6-0-g85ed7a8, running on a Particle Photon with a V2 shield
Jul 20 2018 21:11:21 Port setting changed to: socket://192.168.178.45:6666
Jul 20 2018 21:11:21 Background thread for serial stopped
Jul 20 2018 21:11:22 Background thread for serial started
Jul 20 2018 21:11:22 Serial (re)connected over WiFi at socket://192.168.178.45:6666
Jul 20 2018 21:11:27 Port setting changed to: socket://192.168.178.45:6666
Jul 20 2018 21:11:27 Background thread for serial stopped
Jul 20 2018 21:11:27 Background thread for serial started
Jul 20 2018 21:11:27 Serial (re)connected over WiFi at socket://192.168.178.45:6666

#4

How settings are stored changed in 0.5.6.
If you update with updateFirmare.py as described in the release, it will restore the settings for you afterwards.

FlashDfu doesn’t implement this. You’ll have to add them again. If you have many valves and it’s cumbersome to do this, there is probably a workaround using backed up settings. If necessary I can help you with that tomorrow.


#5

If we’re currently on 0.5.4 we have to use flash-dfu to update to 0.5.5 first before using updateFirmware.py to update to 0.5.6, correct?


#6

That’s what I recommend. Use flashDfu with --noreset. Then update with updateFirmware.py and restore the settings.


#7

It’s my understanding that using the command:

docker run -it --name brewpi-dfu --privileged -v ~/brewpi-data:/data --rm brewpi/brewpi-raspbian python utils/flashDfu.py --noreset

will try and flash the latest firmware which is 0.5.6 but your instructions say to flash 0.5.5 first, after which the Photon should attempt to automatically try and update the bootloader over wifi. How do we specify to flash 0.5.5 instead of the latest 0.5.6? Do I put:

docker run -it --name brewpi-dfu --privileged -v ~/brewpi-data:/data --rm brewpi/brewpi-raspbian python utils/flashDfu.py --noreset --tag=0.5.5

How do I determine the bootloader has been updated successfully if it is not done by your flashDfu script? Can I see this through the Particle ios app (I have already set up wifi for the Photon)? It seems the Photon LED status should also indicate the bootloader status?


#8

If the photon has WiFi, all the bootloader and system image stuff will be fixed from the cloud automatically.
I think you can probably update to 0.5.7 directly.


#9

Bad luck.

The log gave the same sequence as the one I have sent to you in my PM.

Shall I reset the spark 2 to factory settings and try again?

cheers,

Douwe

pi@raspberrypi:~ $ docker run -it --name brewpi-update --privileged -v ~/brewpi-data:/data --rm brewpi/brewpi-raspbian python utils/updateFirmware.py
Persistent files already present
[ ok ] Starting nginx: nginx.
 Stopping any running instances of BrewPi to check/update controller...

Checking current firmware version...
 Jul 25 2018 07:31:31   Background thread for serial started
 Jul 25 2018 07:31:31   Serial (re)connected over WiFi at socket://192.168.178.45:6666
 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.

 Jul 25 2018 07:32:17   Background thread for serial stopped

Checking GitHub for available release...

Available releases:

[0] 0.5.7
[1] 0.5.5
[2] 0.5.2
[3] 0.5.1
[4] 0.5.0
[5] 0.4.4
[6] 0.4.3
[7] 0.4.2
[8] 0.4.1
[9] 0.4.0
[10] 0.2.11
[11] Cancel firmware update
Enter the number [0-11] of the version you want to program [default = 0 (0.5.7)]: 0
 Downloading firmware...
downloading https://github.com/BrewPi/firmware/releases/download/0.5.7/brewpi-photon-0.5.7.bin
 Updated system firmware for the photon found in release 0.5.5
downloading https://github.com/BrewPi/firmware/releases/download/0.5.5/system-part1-0.8.0-rc.3-photon.bin
downloading https://github.com/BrewPi/firmware/releases/download/0.5.5/system-part2-0.8.0-rc.3-photon.bin
 Downloaded new system firmware to:

 /home/brewpi/utils/downloads/0.5.5/system-part1-0.8.0-rc.3-photon.bin
and

 /home/brewpi/utils/downloads/0.5.5/system-part2-0.8.0-rc.3-photon.bin

 Latest firmware downloaded to:
/home/brewpi/utils/downloads/0.5.7/brewpi-photon-0.5.7.bin

Updating firmware...

****    Photon Program script started    ****
Settings will not be restored
Devices will not be restored
 Jul 25 2018 07:32:31   Background thread for serial started
 Jul 25 2018 07:32:31   Background thread for serial stopped

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.5.7/brewpi-photon-0.5.7.bin --system1=/home/brewpi/utils/downloads/0.5.5/system-part1-0.8.0-rc.3-photon.bin --system2=/home/brewpi/utils/downloads/0.5.5/system-part2-0.8.0-rc.3-photon.bin
Will automatically reboot newly detected photons into DFU mode
Using local files instead of downloading a release.

Using binary file: /home/brewpi/utils/downloads/0.5.7/brewpi-photon-0.5.7.bin
dfu-util version 0.9 found installed on system.
WARNING: It is not possible to update the bootloader with DFU. If the new release requires an updated bootloader, the photon will automatically download it from the Particle cloud.
This does require a WiFi connection on the Photon.
If the photon does not have WiFi credentials, it will start in listening mode (blinking blue).
Please use the Particle phone app to set up WiFi. Your photon will hang in safe mode until the bootloader is updated from the cloud.
If the photon has invalid WiFi credentials, it will hang blinking green. Hold the setup button for 5 seconds to trigger listening 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/ttyACM0 - Photon - Photon Serial
Putting Particle Photon in DFU mode
dfu-util: Cannot open DFU device 2b04:d006

dfu-util: Cannot open DFU device 2b04:d006

dfu-util: Cannot open DFU device 2b04:d006

dfu-util: Cannot open DFU device 2b04:d006

dfu-util: Cannot open DFU device 2b04:d006

dfu-util: Cannot open DFU device 2b04:d006

^CTraceback (most recent call last):
  File "/home/brewpi/utils/flashDfu.py", line 364, in <module>
Traceback (most recent call last):
  File "utils/updateFirmware.py", line 265, in <module>
    result = updateFromGitHub(userInput=userInput, beta=beta, useDfu=useDfu)
  File "utils/updateFirmware.py", line 236, in updateFromGitHub
    time.sleep(1)
    {'settings': restoreSettings, 'devices': restoreDevices})
KeyboardInterrupt  File "/home/brewpi/utils/../programController.py", line 169, in programController

    return programmer.program(hexFile, system1File, system2File, useDfu, restoreWhat)
  File "/home/brewpi/utils/../programController.py", line 239, in program
    process.wait()
  File "/usr/lib/python2.7/subprocess.py", line 1073, in wait
    pid, sts = _eintr_retry_call(os.waitpid, self.pid, 0)
  File "/usr/lib/python2.7/subprocess.py", line 121, in _eintr_retry_call
    return func(*args)
KeyboardInterrupt

The led on the spark was blinking yellow during the update


#10

Is the IP address still valid? You should be able to update over WiFi.

To update over USB with docker, first trigger DFU mode:

docker run -it --name brewpi-update --privileged -v ~/brewpi-data:/data --rm brewpi/brewpi-raspbian python utils/flashDfu.py --trigger

Then run the update command:

docker run -it --name brewpi-update --privileged -v ~/brewpi-data:/data --rm brewpi/brewpi-raspbian python utils/flashDfu.py --noreset

Just to be sure, click the factory defaults button afterwards.


#11

Hi Elco,

Here is the log. The spark still boots in hardware test mode but the firmware has been updated to 0.5.7.
How can I stop this and let it boot in normal mode?

The display shows the IP address: 192.168.178.45 and the temps of the connected probes.
The USB cable is still connected.

pi@raspberrypi:~ $ docker run -it --name brewpi-update --privileged -v ~/brewpi-data:/data --rm brewpi/brewpi-raspbian python utils/flashDfu.py --trigger
Persistent files already present
[ ok ] Starting nginx: nginx.
Found new serial port connected: /dev/ttyACM0 - Photon - Photon Serial
Putting Particle Photon in DFU mode
pi@raspberrypi:~ $ docker run -it --name brewpi-update --privileged -v ~/brewpi-data:/data --rm brewpi/brewpi-raspbian python utils/flashDfu.py --noreset
Persistent files already present
[ ok ] Starting nginx: nginx.
dfu-util version 0.9 found installed on system.
WARNING: It is not possible to update the bootloader with DFU. If the new release requires an updated bootloader, the photon will automatically download it from the Particle cloud.
This does require a WiFi connection on the Photon.
If the photon does not have WiFi credentials, it will start in listening mode (blinking blue).
Please use the Particle phone app to set up WiFi. Your photon will hang in safe mode until the bootloader is updated from the cloud.
If the photon has invalid WiFi credentials, it will hang blinking green. Hold the setup button for 5 seconds to trigger listening mode.

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

/home/brewpi/utils/downloads/0.5.5/system-part1-0.8.0-rc.3-photon.bin and

/home/brewpi/utils/downloads/0.5.5/system-part2-0.8.0-rc.3-photon.bin

Updating system firmware for the photon, part 1: /home/brewpi/utils/downloads/0.5.5/system-part1-0.8.0-rc.3-photon.bin
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device...
ID 2b04:d006
Run-time device DFU version 011a
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
DfuSe interface name: "Internal Flash   "
Downloading to address = 0x08020000, size = 239300
Download        [=========================] 100%       239300 bytes
Download done.
File downloaded successfully
Updating system firmware for the photon, part 2: /home/brewpi/utils/downloads/0.5.5/system-part2-0.8.0-rc.3-photon.bin
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device...
ID 2b04:d006
Run-time device DFU version 011a
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
DfuSe interface name: "Internal Flash   "
Downloading to address = 0x08060000, size = 251580
Download        [=========================] 100%       251580 bytes
Download done.
File downloaded successfully
Now writing BrewPi firmware /home/brewpi/utils/downloads/0.5.7/brewpi-photon-0.5.7.bin to photon
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device...
ID 2b04:d006
Run-time device DFU version 011a
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
DfuSe interface name: "Internal Flash   "
Downloading to address = 0x080a0000, size = 91000
Download        [=========================] 100%        91000 bytes
Download done.
File downloaded successfully
Programming done
pi@raspberrypi:~ $ ^C

#12

Just apply a temperature setting and it will change to the new mode.


#13

Hi Elco,

Thanks for your support. We are back on track again!

many thanks,

Douwe