[Solved] Temp sensor input vs BrewPi temperature vastly different

I’ve read every post I can find on other who have temperature problems, but it seems mine is very unique. First, my setup:

  • RaspberryPi 2 w/ Raspian installed
  • BrewPi Spark
  • v 0.2.10 installed
  • Fridge and Beer sensors are in the fridge just dangling, room sensor is laying on top of the fridge
  • Output 3 is connected to Arduino handling the stepper motor function of the Fridge’s damper
  • Output 1 and 2 are not connected
  • All temp sensors are soldered together and connect to one RJ11 plug because I already had 10 one wire sensors laying around from when I planned to do a BrewPi from scratch (before I found you!)
  • No Color TFT screen attached because I broke my, replacement purchased, hopefully will have soon
  • Problems described below existed in both 0.2.7 and now 0.2.10
  • Both the BrewPi and RaspberryPi have been restarted

I have a few problems; one is that no matter whether I assign a device to something or not, it never shows up in the installed devices list:

The temperature sensor shows up assigned to Fridge, Beer, Room properly, it even acts upon those values as it should, but it never shows up as installed.

Second, and much more important, is that that the temperatures being read by the temp sensors are spot on in the device list (seen here and verified by an independent thermometer for both in the fridge and the room):

but when viewed from the display page, the temperatures are off by a large degree; The beer sensor is reading 29.861, but BrewPi reports it as 33.4. The fridge sensor is reading 29.637 but BrewPi reports it as 15.8.

Both sensors are literally within a cm from each other and, as verified by the devices panel, are reading correctly. I can’t for the life of me figure out why BrewPi thinks they are vastly different. I’ve even had it believe the fridge was higher than the beer, and they followed a very specific distance from each other:

Any ideas?

Thank you in advance,

Bret

I think the problem has started with that devices are not installed, but for some reason still are registered as fridge and beer sensor. How this is possible, I really do not know.

Can you try resetting all settings by executing this command:

echo -ne 'E\n' > /dev/ttyACM0

This removes all settings and should remove your installed devices as well. I think that if you add them again, they will stick. If they are registering as installed devices correctly, I think the temperature differences will go away.

Can you also share the output of the update script when you update the firmware?

Okay, I ran the command, then the BrewPi didn’t respond anymore, so I went ahead and ran the update and got the following:

    pi@raspberrypi ~ $ sudo python ~/brewpi-tools/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 2396!
You are on branch master
The latest commit in /home/brewpi  is 015e5c7040672af9e0dc3045ac1b681036c372d6 on Wed, 22 Apr 2015 05:01:36
The latest commit on origin/master is 015e5c7040672af9e0dc3045ac1b681036c372d6 on Wed, 22 Apr 2015 05:01:36
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 17:59:39
The latest commit on origin/master is d44c03e786d0bde0dc43f86a8bd655659f3f3d2b on Wed, 11 Mar 2015 17: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...
 Current firmware version on controller: 0.2.7
 
Checking GitHub for latest release...
 Latest version on GitHub: 0.2.10
 
Version on GitHub is newer than your current version, downloading new version...
 Downloading latest firmware...
downloading https://github.com/BrewPi/firmware/releases/download/0.2.10/brewpi-spark-core-revc-0_2_10.bin
 Latest firmware downloaded to /home/brewpi/utils/downloads/0.2.10/brewpi-spark-core-revc-0_2_10.bin
 ****    Spark Core Program script started    ****
 Settings will be restored if possible
 Devices will be restored if possible
 Checking old version before programming.
 Checking current version: Found BrewPi v0.2.7 build 0, running on a Spark Core with a Rev-C shield on port /dev/ttyACM1

 Requesting old settings from Spark Core...
 Saved old settings to file settings-Apr-30-2015-18-50-55.json
 Waiting for the binary file to be sent ... (press 'a' to abort)

 sent packet nr 0 
 sent packet nr 1 
 sent packet nr 2 
 sent packet nr 3 
 sent packet nr 4 
 sent packet nr 5 
 sent packet nr 6 
 sent packet nr 7 
 sent packet nr 8 
 sent packet nr 9 
 sent packet nr 10 
 sent packet nr 11 
 sent packet nr 12 
 sent packet nr 13 
 sent packet nr 14 
 sent packet nr 15 
 sent packet nr 16 
 sent packet nr 17 
 sent packet nr 18 
 sent packet nr 19 
 sent packet nr 20 
 sent packet nr 21 
 sent packet nr 22 
 sent packet nr 23 
 sent packet nr 24 
 sent packet nr 25 
 sent packet nr 26 
 sent packet nr 27 
 sent packet nr 28 
 sent packet nr 29 
 sent packet nr 30 
 sent packet nr 31 
 sent packet nr 32 
 sent packet nr 33 
 sent packet nr 34 
 sent packet nr 35 
 sent packet nr 36 
 sent packet nr 37 
 sent packet nr 38 
 sent packet nr 39 
 sent packet nr 40 
 sent packet nr 41 
 sent packet nr 42 
 sent packet nr 43 
 sent packet nr 44 
 sent packet nr 45 
 sent packet nr 46 
 sent packet nr 47 
 sent packet nr 48 
 sent packet nr 49 
 sent packet nr 50 
 sent packet nr 51 
 sent packet nr 52 
 sent packet nr 53 
 sent packet nr 54 
 sent packet nr 55 
 sent packet nr 56 
 sent packet nr 57 
 sent packet nr 58 
 sent packet nr 59 
 sent packet nr 60 
 sent packet nr 61 
 sent packet nr 62 
 sent packet nr 63 
 sent packet nr 64 
 sent packet nr 65 
 sent packet nr 66 
 sent packet nr 67 
 sent packet nr 68 
 sent packet nr 69 
 sent packet nr 70 
 sent packet nr 71 
 sent packet nr 72 
 sent packet nr 73 
 sent packet nr 74 
 sent packet nr 75 
 sent packet nr 76 
 sent packet nr 77 
 sent packet nr 78 
 sent packet nr 79 
 sent packet nr 80 
 sent packet nr 81 
 sent packet nr 82 
 sent packet nr 83 
 sent packet nr 84 
 sent packet nr 85 
 sent packet nr 86 
 sent packet nr 87 
 sent packet nr 88 
 sent packet nr 89 
 sent packet nr 90 
 sent packet nr 91 
 sent packet nr 92 
 sent packet nr 93 
 sent packet nr 94 
 sent packet nr 95 
 sent packet nr 96 
 sent packet nr 97 
 sent packet nr 98 
 sent packet nr 99 
 sent packet nr 100 
 sent packet nr 101 
 sent packet nr 102 
 sent packet nr 103 
 sent packet nr 104 
 sent packet nr 105 
 sent packet nr 0 
 File flashed successfully
 Waiting for device to reset.

At this point I walked away, had dinner, did some laundry, came back and it was still at the same point, so I disconnected the BrewPi and plugged it back in which cased:

Traceback (most recent call last):
  File "/home/brewpi/utils/updateFirmware.py", line 144, in <module>
    result = updateFromGitHub(userInput)
  File "/home/brewpi/utils/updateFirmware.py", line 124, in updateFromGitHub
    {'settings': restoreSettings, 'devices': restoreDevices})
  File "/home/brewpi/utils/../programController.py", line 160, in programController
    return programmer.program(hexFile, restoreWhat)
  File "/home/brewpi/utils/../programController.py", line 225, in program
    self.fetch_new_version()
  File "/home/brewpi/utils/../programController.py", line 308, in fetch_new_version
    self.versionNew = self.fetch_version("Checking new version: ")
  File "/home/brewpi/utils/../programController.py", line 293, in fetch_version
    version = brewpiVersion.getVersionFromSerial(self.ser)
  File "/home/brewpi/utils/../brewpiVersion.py", line 60, in getVersionFromSerial
    ser.setTimeout(oldTimeOut) # restore previous serial timeout value
  File "/usr/local/lib/python2.7/dist-packages/serial/serialutil.py", line 402, in setTimeout
    if self._isOpen: self._reconfigurePort()
  File "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 325, in _reconfigurePort
    raise SerialException("Could not configure port: %s" % msg)
serial.serialutil.SerialException: Could not configure port: (5, 'Input/output error')


*** Done updating BrewPi! ***

After trying BrewPi web interface and it saying the firmware wasn’t updated, I tried again:
Round 2:

    pi@raspberrypi ~ $ sudo python ~/brewpi-tools/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
You are on branch master
The latest commit in /home/brewpi  is 015e5c7040672af9e0dc3045ac1b681036c372d6 on Wed, 22 Apr 2015 05:01:36
The latest commit on origin/master is 015e5c7040672af9e0dc3045ac1b681036c372d6 on Wed, 22 Apr 2015 05:01:36
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 17:59:39
The latest commit on origin/master is d44c03e786d0bde0dc43f86a8bd655659f3f3d2b on Wed, 11 Mar 2015 17: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...

It locks up at this point.

You said earlier that you had 0.2.10 installed, but it looks like your controller was still running 0.2.7.

If updating automatically keeps failing, can you try updating via DFU?

Unplug USB, push down with a pin in the hole on the bottom closest to the Dutch flag and plug the USB cable back in. After 3 seconds, a yellow LED inside should start flashing. The core is now in DFU mode.

Then run our DFU flash script with:

sudo python /home/brewpi/utils/flashDfu.py
    pi@raspberrypi ~ $ sudo python /home/brewpi/utils/flashDfu.py
Downloading latest firmware...
Latest version on GitHub: 0.2.10
downloading https://github.com/BrewPi/firmware/releases/download/0.2.10/brewpi-spark-core-revc-0_2_10.bin
Latest firmware downloaded to /home/brewpi/utils/downloads/0.2.10/brewpi-spark-core-revc-0_2_10.bin
found DFU device, now flashing /home/brewpi/utils/downloads/0.2.10/brewpi-spark-core-revc-0_2_10.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 = 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 = dfuERROR, status = 10
dfuERROR, clearing status
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 = 106524
.........................................................................................................
File downloaded successfully
Transitioning to dfuMANIFEST state
Error during download get_status

It does provide the double beep after it hits Error during download get_status.

That error is normal, it always shows that.
Please also reset to default settings with:

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

I did that and it still isn’t working. I get the following under the “View Logs” on the webpage:

wpa_supplicant: /sbin/wpa_cli daemon failed to start
run-parts: /etc/network/if-up.d/wpasupplicant exited with return code 1
May 01 2015 19:05:03 Notification: Script started for beer 'Fridge Hold Test'
May 01 2015 19:05:13 Checking software version on controller... 

I’ve tried doing all the steps again, flash DFU, echo the ‘E’, attempt to run, doesn’t work, attempt to update, hangs on the same spot. Other ideas?

I think for some reason serial/usb communication is not working and that the problem is not the controller.
The WiFi error also suggests something might be wrong on the USB bus. The problem is on the pi I think.

Could be caused by:

  • You have not enough power to the Raspberry Pi (what kind of power supply do you have?)
  • Your WiFi dongle is messing with the USB bus or too power hungry.
  • Something’s wrong with the Raspberry Pi or the software on it

I suggest trying:

  • A different USB cable
  • Powering the controller with a 12V adapter
  • Unplugging all temperature sensors and SSRs (a faulty sensor can draw a lot of current)
  • Updating all software and firmware on the pi (sudo apt-get update / sudo apt-get upgrade and sudo rpi-update)
  • Try the controller on a windows pc: for example with the Arduino IDE, open a serial port and send n, you should get a version number back

I’ll try those steps, but a quick note: I don’t use WiFi, I’m using Ethernet, is that a problem?

No, but just check /etc/cron.d/brewpi for the line:

# entry:wifichecker`

Change that to

# entry:~wifichecker`

And run our updater.py or updateCron.sh

This will disable our wifi keep alive script, which probably is the reason you saw:

wpa_supplicant: /sbin/wpa_cli daemon failed to start

Pi is powered via MacBook Pro

I’ve tried 3 USB cables, connecting a 12v supply, removing all other connections, I ran all the update/upgrade commands, and when I connected via serial to my MacBook it didn’t respond at all to ‘n’ or ‘n/n’.

Are you sure you have the right serial port? I do not have much experience getting this going on a mac.

Definitely; if the Spark isn’t plugged in it errors out on the same port. I wish I had another Core to test it… The Photon is only a month away too, doh!

Can you try on another system than your mac? It might be a driver issue.

It still didn’t work until I reset the Core back to factory defaults, then I was able to get responses from the ‘w’ and ‘i’ commands. I put it back into DFU mode and flashed the software, which gave this output:

pi@raspberrypi ~ $ sudo ./dfu-util -d 1d50:607f -a 0 -s 0x08005000:leave -D brewpi-arduino-uno-revC-0_2_10.hex 
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 = dfuERROR, status = 10
dfuERROR, clearing status
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 = 75671
..........................................................................
File downloaded successfully
Transitioning to dfuMANIFEST state
Error during download get_status

Now it won’t leave DFU mode and I’m not receiving any beeps anymore. I tried doing:

echo -ne 'E\n' > /dev/ttyACM0

But received:

-bash: /dev/ttyACM0: Permission denied

The only way to get it out of DFU mode is to hold down Mode for 10 seconds.

You are trying to flash an Arduino hex file to a Spark Core…

Please use the spark core .bin file

Missed that one… Im back to getting the double beep, it still doesn’t connect to the Pi and sending ‘n’ from Windows gets nothing in response. When I reset it to factory, I got a response from ‘i’ and ‘w’ using the same method, so I know I can communicate with the core using the same cables, software, etc. it seems to be once the BrewPi file is loaded that it stops working.

Can you come to the store chat or IRC (brewpi.com/chat) so I can help you debug?

UPDATE:
I forgot that @y2klightning e-mailed me because he broke his display. The display and touch screen were broken, so the core was hanging in the touch screen calibration. I built him a custom binary that skips the display/touch code as a temporary workaround until he receives a new screen :smile:

After that configured all settings again and the temperature difference issue went away too.

I wanted to wait a day to verify everything was working properly and it is! Thank you so much, Elco, I appreciate the one-on-one attention and willingness to reprogram things to get me up and running; I tried to throw in the towel while you kept going at it. I didn’t get around to brewing Sunday, but I will this Saturday and I can’t wait to see it in real action!

Bret

I had a similar issue. Could see the temp sensors but could not get them installed, so all I was seeing on the spark screen was --.- for temps. After running your reset to default line I was finally able to reconfigure my devices.

The error occurred during a hard shutdown (I just unplugged the Pi, to which the spark was connected and moved it to another power port).

Elco – major thank you again for being such an active developer!