Brewometer integration

:slight_smile: Glad it’s working well for you. My changes are really s scratch on the surface of all the BrewPi work that Elco’s done. It’s an awesome bit of kit.

@prmurphy63026 - It’s still not possible to control the fermentation temp using the Tilt’s thermometer as input.

@Raptor - I’ve got a change coming that will automatically restart the Tilt connection without needing to restart the script. I hit a hurdle when I went to test and found that my BrewPi SD card had corrupted itself over Christmas. Almost there now though.

Thanks @sbowler - I don’t actually restart the script as such - I changed your code to move the exception block to catch the issue earlier and thus stopping the whole lot crashing. I also restart the scanning if it is not running from both the brewpi and your tilt class.

Simon,
I have had a corrupted SD card a couple of times too. Here is what I have done and things have been pretty stable.

  1. Added a surge protector/UPS. Just a cheap one as the RPi does not use much juice but hopefully enough to carry it through the occasional power interruptions that we have, now and then.
  2. Avoid restarting RPi by disconnectiong power and reconnectiong. Whenever possible I use Putty and then do sudo shutdown (with or without -r). I read in some other fori (fora? forums?) that RPis do not like the disconnect of power without shutdown. Obviously it works mostly, but I am concerned about the few times that it does mess up your card

Stefan

Did you verify that brewpi was working before adopting the changes for this modification? I can’t explain why you are getting the error message indicating that your not on legacy. I think you need to make sure brewpi is working first then try the modification. If it still throws the error with no modification then I’d ask Elko for help.

Hello Ron,

I am having the same problem as nanotap. Everything was working fine up until I copied over the scripts from the https://github.com/supercow/brewpi-brewometer repository. I have a feeling that it is the scripts downloaded from there that breaks it.

Reinstalling Brewpi and then reselecting the legacy branch starts everything working again. Checking the brewpi.py file from Supercow’s git repository shows:

logMessage("Checking software version on controller… ")
hwVersion = brewpiVersion.getVersionFromSerial(ser)
if hwVersion is None:
logMessage("Warning: Cannot receive version number from controller. " +
"Your controller is either not programmed or running a very old version of BrewPi. " +
“Please upload a new version of BrewPi to your controller.”)
# script will continue so you can at least program the controller
lcdText = [‘Could not receive’, ‘version from controller’, ‘Please (re)program’, ‘your controller’]
else:
logMessage(“Found " + hwVersion.toExtendedString() +
" on port " + ser.name + “\n”)
if LooseVersion( hwVersion.toString() ) < LooseVersion(compatibleHwVersion):
logMessage(“Warning: minimum BrewPi version compatible with this script is " +
compatibleHwVersion +
” but version number received is " + hwVersion.toString())
if int(hwVersion.log) != int(expandLogMessage.getVersion()):
logMessage(“Warning: version number of local copy of logMessages.h " +
“does not match log version number received from controller.” +
“controller version = " + str(hwVersion.log) +
”, local copy version = " + str(expandLogMessage.getVersion()))
if hwVersion.family == ‘Arduino’:
exit(”\n ERROR: the newest version of BrewPi is not compatible with Arduino. \n” +
“You can use our legacy branch with your Arduino, in which we only include the backwards compatible changes. \n” +
“To change to the legacy branch, run: sudo ~/brewpi-tools/updater.py --ask , and choose the legacy branch.”)

So it seems that the version of the script in the repository is what is causing the problem.

Regards,
Jerry

@jerryp, @Ron_K. :slight_smile:I can confirm that my version of the scripts from “supercow” is working, after I comment out the following in brewpi.py:

if hwVersion.family == ‘Arduino’:
exit("\n ERROR: the newest version of BrewPi is not compatible with Arduino. \n" +
“You can use our legacy branch with your Arduino, in which we only include the backwards compatible changes. \n” |+
“To change to the legacy branch, run: sudo ~/brewpi-tools/updater.py --ask , and choose the legacy branch.”)

I did a new fresh install of Brewpi, install the legacy version, test it and up and running as before.
I copied then all the files from “supercow” and run Elcos “fixpermission” script to make sure everything is right. I do still have some logentry says I’, not running the right version, but it works.

Tested then the Breometer with water to calibrate it, so some sugerwater (SG 1.048) and calibrate, and let it go for a week.

Now I have my brew batch #002-2017 in fermenter, and the Brewometer work as a charm. (see pic)
The only issue is what someone else says, the refresh of page are slower than without brewometer integration, even if I set the logentry to be every 5 min.

So, if someone can clear this out why the “Arduino” check fails on a Arduino (Genuino board in Norway), I’ll be glad:)

//Cheers

That is great to know @nanotapp. I will give that a go once my current brew finishes. I have the Tilt Hydrometer logging to Google Docs, so at least that is working. Do not want to risk messing anything up during this run…

1 Like

I’m having some issues getting this working with the legacy branch. First of all I seem to have some BT issues

Secondly the graph doesn’t seem to be logging anything - no temperatures from my regular probes, no gravity or temp readings from my Tilt.

I’ve tried both the jlvnyc and supercow variations to no avail… Anyone got any ideas?

Hi. From the look of the logs, the Bluetooth is set-up correctly, as it’s detecting both a red and blue Brewometer/Tilt.

Did you read through the posts around the Arduino mod advice to see if there were any answers there?

Yeah… figured everything out eventually. I’m on the legacy branch so ended up using a fork of your code. I’ve also got two brewpi arduinos running off a single Pi. The fork I used needed a couple of modifications to show F over C and I also had to put the brewometer calibration files in a sibling directory to my two chamber directories. Finally, I cleared out the data directories so the graphs would reset properly. I don’t think any of this is down to your code and I want to thank you for leading this integration effort… I think it’s really quite awesome!

HI Guys! Congrats to all who have contributed to this awesome integration! I currently run a branch of legacy that supports using an ESP-8266 instead of arudino. Here is the repo / info = https://github.com/thorrak/brewpi-esp8266/blob/master/docs/INSTALL.md. From the reading I’ve done in this thread, trying to get the Tilt to work on my install will likely break the ESP-8266 functionality. Does anyone else have the Tilt integration working with the ESP-8266 wireless controllers? Any help / input is greatly appreciated!

Hi @cripplecreek. Why do you think it will break the ESP-8266 functionality? The Tilt integration operates on your Raspberry Pi using bluetooth. What I can’t tell from the INSTALL.md instructions on your repo is where the actual Brewpi script is running? Does it still run on the Raspberry Pi, or does it run on the ESP-8266?

If it’s the former, then you can re-integrate the modification into your repo. If it’s the latter, then will likely only get it to work if you can somehow enable a bluetooth connection on the ESP8266, which I’m not sure is possible. From the brief research I did, the successor to the ESP8266 had Bluetooth and Bluetooth LE, which is what you need to drive the mod.

Thanks @sbowler!
The script is installed onto the Pi. In my case, a 2b with a USB wifi / bluetooth le adapter. The esp8266 acts as an arduino. Do think it would be possible to add the Tilt code into my brewpi.py?

Definitely. Do a compare of the changes in the brewpy.py file. Given you’ve got the esp8266 to work, I don’t think you’ll have too much trouble merging the changes in to your script.

Have you tried to see if your BLE adapter can see your Tilt?

@sbowler You ROCK!!!
Don’t know why I had any hesitations in having a go at this. I followed the directions in the readme and had essentially no issues. One word of advise for others wanting to get this integration working by adding @sbowler’s code into their existing Brewpi setup, choose your editor wisely. My initial attempt was made from my Mac using Coda 2. I got tons of delimiter errors when the script attempted to run. I tried to fix one after another. Ultimately, I re-did the code additions from a PC using Notepad++ and got it going with relative ease. Thanks again!!

Alright, what am I missing?? I reinstalled to get the tilt working and I lost all of my pretty lines. Tilt is paired, temp sensor and heater is set up same as before. Also, do I need to add the tilt somehow to to the device list?

RK9251,
I had the same problem. Turns out that the new code doesn’t like to see the old data. You need to start a new brew making sure to name it something that you haven’t already brewed. Then everything should start showing up.

Can you post a screenshot and were you successfully able to run the test script?

Here is a screenshot. I can’t find the test script. I am using this install script. I managed to insert your test script and it did not show any connection. Although, I can see that the device is paired from the desktop.

The test scripts and instructions can be found on github (same source that the install script uses).

The test script can confirm if the Tilt is able to be seen by the Pi.