Uninstalling and reassigning device permanently not possible via web interface

First off, I’m new on the forum and would like to commend Elco on the fantastic job he’s doing.

I’m running the Brew Pi with a spark photon running the 0.2.11 firmware.
Unfortunately in my urge to test the BrewPi setup out, i plugged in four sensors and watched the temperature on the display. However it seems that this has got the sensors stuck in their device slots, as I cannot unassign a device slot/function.

This would not be a problem, but the brewpi thinks that a 1/2 inch bsp threaded sensor is the one assigned to measure beer temperature and and I cannot fit it into my thermowell.

I’ve tried setting the function to “none”, unassigning the slot, and reassigning one of the probes that fit into the well.
The web interface does not update to reflect this, but the spark/display seemingly does. However when power is removed and the device is restarted, it’s back to square one.

I’ve also noted that using “read value” will show the same temperature for the unconnected device and the device on slot 3, which is the one I’d like to permanently assign to measure beer temp. Somehow it seems to link the value from device 3 (connected) to device 2 (not connected but assigned as beer temp).

Anyone know how to fix this / what I’m doing wrong? I’ve tried different browsers (on a Mac - Safari, Firefox, Chrome), but to no avail.

All the best,

Peter

Uninstall should work by setting the function to none and clicking apply. I don’t know how it could get in a state where this is not working.

If you want to start fresh, sending ‘E’ over serial will reset all settings.
On the Pi:

sudo echo -ne 'E\n' > /dev/ttyACM0
1 Like

Just FYI @Elco my setup is doing the same. Just found this thread while trying to troubleshoot.

I can reboot and it will be fixed though.

Hi Elco,

Thanks for your reply - took a while for me to get around trying this.
I still can’t get rid of the existing device settings.

I just tried
sudo echo -ne 'E\n' > /dev/ttyACM0
but the device settings are still set.
The output from the brewpi console is

Nov 08 2015 18:35:05 Opening serial port Nov 08 2015 18:35:05 Notification: Script started for beer 'My First BrewPi Run' Nov 08 2015 18:35:15 Checking software version on controller... Nov 08 2015 18:35:16 Found BrewPi v0.2.11 build 0.2.11-0-ga28c22d, running on a Particle Photon with a V2 shield on port /dev/ttyACM0 Nov 08 2015 18:52:38 controller debug message: INFO MESSAGE 12: Received new setting: beerSet = 5.0 Nov 08 2015 18:59:09 controller debug message: INFO MESSAGE 15: EEPROM initialized Nov 08 2015 18:59:10 controller debug message: WARNING 2: Temperature sensor disconnected pin 0, address 285CD4A206000073 Nov 08 2015 18:59:10 controller debug message: WARNING 2: Temperature sensor disconnected pin 0, address 28A74E74060000FB Nov 08 2015 18:59:10 controller debug message: WARNING 2: Temperature sensor disconnected pin 0, address 280FAE730600005A

If I set function to none and click apply for Device 0 (which I’d like to be replaced by what is now Device 3 and measure Beer temperature):

Device config command sent, U:{"i":"-1","c":"0","b":"0","f":"0","h":"2","p":"0","a":"285CD4A206000073"}

and then set to Device 3 to be Device 0, Chamber 1, Beer 1, Beer temp:

Device config command sent, U:{"i":"0","c":"1","b":"1","f":"9","h":"2","p":"0","a":"285FC4A1060000DE"}

Then it will measure beer temp, however 285FC4A1060000DE is not now Device 0, but still Device 3.
Strangely, device 2, which is not plugged in, shows the same temperature measurement as device 3, in the device Configuration tab.
If the power fails and I press refresh device list, it resets to the original settings.

is there a hex file I can use to reprogram the brewpi or any other way to fix this?

I should mention I only have device 3 plugged atm.

All the best,
Peter

I did this:

sudo echo 'E\n' > /dev/ttyACM0

Not sure what the lack of -ne does but it worked for me.

Hope you get it sorted out.

Hi Bryan,

Thanks for the suggestion,

sudo echo 'E\n' > /dev/ttyACM0

did clear Device 3, but not Device 0,1 or 2, unfortunately.

The moment I plug that sensor back in it is automatically re-assigned as Device 3.
I looked on github for a precompiled hex file I could upload as there is an option not to keep device settings - any other ideas as to how I could reassign the sensors or start with a blank slate?

All the best,

P

Sorry @BorealBeer, I’m not real sure then. I don’t think you’d have to unplug the sensors. I guess I’d try:

sudo ~/brewpi-tools/updater.py 

Then I’d try to unassign every dropdown on the config page and hit apply to each. Then I’d rerun the

sudo echo 'E\n` > /dev/ttyACM0

If that doesn’t work, I’d have to toss it to someone smarter than me (and there are quite a few of them on here).

I’ll be following along though to see what happens.

Hi @bryancm1 and @Elco, I tried every single possible permutation of updater, unassigning, reassigning etc, but to no avail.

Is there a virgin .hex file that i could upload via the web interface?

Did you ever just hit the “reset” button on the Spark?

I did, the settings still stick though.

If you flash again with FlashDfu, are your devices erased then?
I am making a note of this bug for better handling of duplicate devices.

I just tried this, but the devices still stick.

This is the input/output:

pi@brewpi ~ $ sudo python /home/brewpi/utils/flashDfu.py --autodfu
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/ttyACM1', 'Particle Photon')
Putting Photon in DFU mode
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 25 2015 09:12:31   Opening serial port
 Success! Found BrewPi v0.2.11 build 0.2.11-0-ga28c22d, running on a Particle Photon with a V2 shield on port /dev/ttyACM0

 Resetting EEPROM to default settings
 INFO MESSAGE 15: EEPROM initialized
 WARNING 2: Temperature sensor disconnected pin 0, address 285CD4A206000073
 WARNING 2: Temperature sensor disconnected pin 0, address 28A74E74060000FB
 WARNING 2: Temperature sensor disconnected pin 0, address 280FAE730600005A
pi@brewpi ~ $ sudo echo -ne 'E\n' > /dev/ttyACM0

I then tried to flash with the PWM release, which gave an error:

...............
File downloaded successfully
Error during download get_status
Error during download get_status
Programming done, now resetting EEPROM to defaults
Opening serial port
Nov 25 2015 09:19:27   Opening serial port
Traceback (most recent call last):
  File "/home/brewpi/utils/flashDfu.py", line 199, in <module>
    programmer.fetch_version("Success! ")
  File "/home/brewpi/utils/../programController.py", line 296, in fetch_version
    version = brewpiVersion.getVersionFromSerial(self.ser)
  File "/home/brewpi/utils/../brewpiVersion.py", line 39, in getVersionFromSerial
    if line:
UnboundLocalError: local variable 'line' referenced before assignment

Then went back to the stable release, but devices still stick. Are the devices stored on the raspberry pi as well? does the EEPROM get repopulated from the pi?

The brewpi is now no longer working at all - it starts up, but does not communicate with the web interface via the script.

I tried

pi@brewpi ~/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
Quit message sent to BrewPi instance with pid 3046!
You are on branch master
The latest commit in /home/brewpi  is 4c7dfa342d8403eb2b485e9970e2cdec9e53c9e4 on Wed, 05 Aug 2015 23:15:44
The latest commit on origin/master is 4c7dfa342d8403eb2b485e9970e2cdec9e53c9e4 on Wed, 05 Aug 2015 23:15:44
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      is d44c03e786d0bde0dc43f86a8bd655659f3f3d2b on Wed, 11 Mar 2015 22:59:39
The latest commit on origin/master is d44c03e786d0bde0dc43f86a8bd655659f3f3d2b on Wed, 11 Mar 2015 22:59:39
Your local version of /var/www is up to date!

No changes were made, skipping runAfterUpdate.sh.
If you encounter problems, you can start it manually with:
sudo /home/brewpi/utils/runAfterUpdate.sh

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]:
 Stopping any running instances of BrewPi to check/update controller...
 
Checking current firmware version...
Nov 25 2015 09:47:04   Opening serial port
JSON decode error: Unterminated string starting at: line 1 column 19 (char 18)
Could not parse version number: {"v":"0.2.11","n":"0.2.11-0-ga28c2
 Current firmware version on controller: 0.0.0
 
Checking GitHub for latest release...
 Latest version on GitHub: 0.2.11
 
Version on GitHub is newer than your current version, downloading new version...
 Downloading latest firmware...
 Downloading firmware failed


*** Done updating BrewPi! ***

pi@brewpi ~/brewpi-tools $ 

I confirmed that the internet is working using sudo apt-get update…

Running sudo python /home/brewpi/utils/flashDfu.py once gave an error again, but when I ran it a second time it worked and the brewpi is once again communicating with the web interface.

I still haven’t managed to reset the installed device list though.

im running into a similar problem any updates on a solution?

No unfortunately not.
Haven’t tried if the new update will wipe the settings but I’m not holding my breath as the dfu flash didn’t do anything. I’m hoping @Elco will come up with a solution soon.

I updated to the new 0.4 version today and noticed on the terminal that the raspberry pi restores settings from a file kept in /home/brewpi/settings (I think this is where it was).
Deleted the settings file, flashed the brewpi using flashDfy.py and this removed the sensors finally.

However, now I have a new problem, which is that temperature is reported correctly in the device config screen and on the brewpi test screen (24.6 degrees C) but when I enter the Beer Profile mode, the web script and the brewpi screen report a very different temperature (40.9 degrees C).
But I guess thats for new thread, as the original problem of being unable to uninstall devices has been solved/circumvented.