Brewometer integration

Thanks Elco. Before I started the Tilt integration I updated to the latest legacy branch and checked out that everything worked correctly. I then very methodically made incremental changes, checking things out at each step. I installed the Bluetooth support and ran the TiltHydrometerTest ok.

The mistake I made was that I followed the instructions literally and put the brewpi-web folder in the /var/www/html directory and the brewpi-script folder in the /home/brewpi directory. Everything still worked ok with the LCD panel and ability to start a new brew script. I did this several times and was puzzled why the Y2 (SG) axis did not show up and there were no changes to the appearance of the graph. I then read up a lot on this thread and realized my mistake. ** Instead of copying the folders to the brewpi-web and brewpi-script folders I should have copied the folder’s contents to those folders - overwriting the old files **.

When I did that, and removed the folders is when the LCD panel disappeared and my ability to run a script. I also cannot stop the script and the graph data is old data from the time I put the brewpi-web folder’s content in the /var/www/html folder and the brewpi-script folder’s content in the /home/brewpi directory. I went through the sudo chown steps and ran the fixPermissions script several times. Neither report an error.

I will work on this more today but am out of ideasn at the moment as I do not know how to troubleshoot the python script, javascript and css.

Thanks to all that have helped here,

Paul

@elco you stated that it does not seem like I am running the lgacy version anymore and I have been thinking about that. Prior to the @sbowler tilt installation, I did run the BrewPi updater with the --ask option and selected the legacy branch. A lot of files were updated and I gave the system a good checking that all was working before starting the install of the brewpi-brewometer files from GitHub.

What I am now wondering is whether those brewpi-brewometer files (brewpi-script and brewpi-web) are compatible with the legacy branch I am running.

Maybe someone that has done this update can comment.

Paul

@sbowler’s mod isn’t legacy compatible. But others have modified @sbowler’s work to make it compatible. You’d have a to dig through the brewometer integration thread to find the repo though.

Thanks. Yes I have done quite a bit of reading on that. It seems I have two options and both are workable solutions - the ‘SuperCow’ and the ‘Jlvnyc’ solutions.

I am currently reverting back to the baseline working BrewPi legacy and will check that works OK (as it has for the past 2+ years). Then I will pick one of the two above solutions and use sudo git clone to get the files. @rolomo and @Ron_K both have had good results with this.

Paul

Legacy Pi3+Arduino installation with Tilt using jlvnyc’s solution.

I have made some progress here, but need some help @rolomo @Ron_K.

Once I realized that the @sbowler script would not work with the RPi+Arduino legacy branch, I reverted to a backup I made prior to tilt integration and checked out that all worked well. That datapoint established, I decided to go with jlvnyc’s solution and followed Rolomo’s well documented installation process in post #287. All went well with no errors. The BerewometerTest.py ‘sees’ my orange Tilt hydrometer ok.

The graph now includes the SG axis but there is no Tilt data and the Orange Tilt does not show up in the graph legend. Also the graph axis is in Celsius instead of Fahrenheit.

In reading through this 450+ post thread, I see that others have had problems with the Fahrenheit conversion and this is not as easy to change as in @sbowler’s original code due to the absence of the settings.ini file. I found instructions to change line 427 of the brewpi.py file to:
brewometer =
Brewometer.BrewometerManager(True, 300, 10000)
but that didn’t work, even after flushing the browser, starting a new script and rebooting the RPi.

Any other ideas? I have included a screenshot below.

Also what would be the reason for the Tilt not to show in the graph legend? I read somewhere about replacing the beer-chart.js file with a newer one? Do I need to do this and if so which repo do I get it from? The word ‘state’ appears where the Orange Tilt data should be in the graph legend.

No errors are shown in the stderr log.
Thanks,

Paul

Did you start a new brew after you made your modifications? That got many of us. the graph doesn’t update info on an existing brew.

This is what got me when I was doing it. make sure you do not have any blank lines in the script.
“Replace all blank lines in TEMPERATURE.* and GRAVITY.* with # comments as the first character.
The code doesn’t tolerate any blank lines in those files.”

Also Sbowler posted this:
@Ron_K, glad you got it working. For future reference, the Fahrenheit conversion can be configured through the tiltHydrometer/settings.ini file (in /home/brewpi ). Change the line FahrenheitTemperatures: False to FahrenheitTemperatures: True if you want temps in F.

I forgot to mention the supercow fork is the most current in my opinion. It was updated just 4 days ago while JVgolfs has not been touched in 3 years.

@Ron_K Thanks for the input. I knew with two choices - the jlvnyc and the Supercow - I would pick the wrong one! Just in reading this thread more users seemed to be using the jlvnyc one.

Anyway - yes I think I have done all I can here. I have done multiple restarts of different test ‘brews’, multiple browser cache clears, tested with different browsers including the Apple Safari and Chrome, rebooted the RPi and eliminated blank lines in the calibration files.

Also your comment regarding the settings.ini file does not apply since the jlvnyc solution does not use the settings.ini file.

Now I need to read up on the Supercow implementation. Is that essentially the same install process on a ‘clean’ and updated Brewpi?

Thanks for the quick response Ron,

Paul

when I did it, I started with a clean install of brewpi followed by cloning supercows script. To be honest with you I havn’t needed to mess with it since I resolved the temperature issue. I’m away from home now, but when I return thursday I can look at my install to see how it compares to yours. In the mean time if you look at the posts around the same time discussing my issues, you may just find the answer there.

Did you try stopping logging, then restarting the script?

Thanks Ron. Yes - stopping and starting the script with different ‘brew’ names was done at least 7 times.

All the best.

Paul

Legacy Pi3+Arduino installation with Tilt using the Supercow version

I just wanted to report back that after a lot of hours working this, I have the Tilt working correctly. Thanks so much to @Elco, @sbowler, @Ron_K and Supercow for their tireless work in bringing this capability, and support in this forum, to the homebrewing community. It is very much appreciated.

My solution was to go with the Supercow forked code, plus some codechanges documented here in this thread coupled with lots of Ctrl-F5, reboots and power cycles.

One minor issue I have remaining is that the data in the data table on the right only populates when the browser’s cursor is on the graph area of the page. I am using the Google Chrome browser. The numbers turn to dashes when the cursor is in any other part of the page. I tested this with the Safari browser on my iPad and the data does not appear at all. See below.

I am unclear if this is a problem/feature that all are having.

Thanks again,

Paul

Mouse cursor off graph:

Mouse cursor on graph:

@sbowler
help please?

Running with the Tilt integration and having problems with the code on the latest current brewpi software directly on my rpi without docker.

did clone last week from:
cd /home/brewpi
sudo git clone https://github.com/sibowler/brewpi-brewometer.git

Have a BrewPi v0.5.10 build 0.5.10-0-gac67918, running on a Particle Photon with a V2 shield and the latest commit I believe (85f693ab5e3395cd10cc2d991ebcddc933c7d5cd) from the brewpi git repo.

The latest code in the tilt git repo doesn’t seem to work at all anymore due to brewpi changes of late, or I’m missing something big…

The current issue I’m having is in brewpiJson.py. It can’t seem to iterate on TiltHydrometer.TILTHYDROMETER_COLORS, with the following error every minute in the stderr.txt log:

Jan 17 2019 15:57:04   Notification: Script started for beer 'jan17test'
 Jan 17 2019 15:57:04   Connecting to controller...
 Jan 17 2019 15:57:04   Background thread for serial started
 Jan 17 2019 15:57:04   Serial (re)connected over WiFi at socket://192.168.4.244:6666
 Jan 17 2019 15:57:06   Found BrewPi v0.5.10 build 0.5.10-0-gac67918, running on a Particle Photon with a V2 shield
Jan 17 2019 15:57:06   DEBUG: Tilt Hydrometer Scan Data: Black,69,1.006
Traceback (most recent call last):
  File "/home/brewpi/brewpi.py", line 770, in <module>
    brewpiJson.addRow(localJsonFileName, newRow)
  File "/home/brewpi/brewpiJson.py", line 128, in addRow
    for colour in TiltHydrometer.TILTHYDROMETER_COLOURS:
NameError: global name 'TiltHydrometer' is not defined
 Jan 17 2019 15:58:04   Notification: Script started for beer 'jan17test'
 Jan 17 2019 15:58:04   Connecting to controller...
 Jan 17 2019 15:58:04   Background thread for serial started
 Jan 17 2019 15:58:04   Serial (re)connected over WiFi at socket://192.168.4.244:6666
 Jan 17 2019 15:58:06   Found BrewPi v0.5.10 build 0.5.10-0-gac67918, running on a Particle Photon with a V2 shield
Jan 17 2019 15:58:06   DEBUG: Tilt Hydrometer Scan Data: Black,69,1.005
Jan 17 2019 15:58:07   DEBUG: Tilt Hydrometer Scan Data: Black,69,1.005
Traceback (most recent call last):
  File "/home/brewpi/brewpi.py", line 770, in <module>
    brewpiJson.addRow(localJsonFileName, newRow)
  File "/home/brewpi/brewpiJson.py", line 128, in addRow
    for colour in TiltHydrometer.TILTHYDROMETER_COLOURS:
NameError: global name 'TiltHydrometer' is not defined
 Jan 17 2019 15:59:03   Notification: Script started for beer 'jan17test'
 Jan 17 2019 15:59:03   Connecting to controller...
 Jan 17 2019 15:59:03   Background thread for serial started
 Jan 17 2019 15:59:03   Serial (re)connected over WiFi at socket://192.168.4.244:6666
 Jan 17 2019 15:59:05   Found BrewPi v0.5.10 build 0.5.10-0-gac67918, running on a Particle Photon with a V2 shield
Traceback (most recent call last):
  File "/home/brewpi/brewpi.py", line 770, in <module>
    brewpiJson.addRow(localJsonFileName, newRow)
  File "/home/brewpi/brewpiJson.py", line 128, in addRow
    for colour in TiltHydrometer.TILTHYDROMETER_COLOURS:
NameError: global name 'TiltHydrometer' is not defined

Any ideas?

See the dots on the graph lines? What is happening here is the data table is showing data from those specific locations selected by the mouse cursor. Handy if you want to drill down to a specific point on the graph. I believe the dashes are normal. since real time data is shown in the LCD.

1 Like

@sbowler
I completed re installing everything. There are a couple issues I’m still trying to iron out.
I’m running the legacy branch of brewpi. Using @jvgolf 's fork of the brewometer modification.
My error log has this entry
Unhandled exception in thread started by <bound method BrewometerManager.scan of <Brewometer.BrewometerManager instance at 0x74538580>>
Traceback (most recent call last):
File “/home/brewpi/Brewometer.py”, line 305, in scan
returnedList = blescan.parse_events(sock, 10)
File “/home/brewpi/blescan.py”, line 130, in parse_events
pkt = sock.recv(255)
_bluetooth.error: (32, ‘Broken pipe’)

What do I need to fix this?

Also this
Apr 20 2019 22:07:14 Warning: minimum BrewPi version compatible with this script is 0.4.0 but version number received is 0.2.10

ERROR: the newest version of BrewPi is not compatible with Arduino.
You can use our legacy branch with your Arduino, in which we only include the backwards compatible changes.
To change to the legacy branch, run: sudo ~/brewpi-tools/updater.py --ask , and choose the legacy branch.

I didn’t expect this since this is supposed to be a fork for legacy use. any idea’s @jvgolf?

It sounds like you are having several issues. One, you are running version 0.4.x of BrewPi and you need to be on Legacy. Do what it says, issue the command:

sudo ~/brewpi-tools/updater.py --ask

and choose the legacy branch. You will not need to flash your firmware. After that you will need to do whatever integration you did to copy the scripts over.

After that … you might be closer. :slight_smile:

I did that prior to making the modification to monitor the tilt.
I was concerned that running it after would break the mods for the tilt.

*** Updating BrewPi web interface repository ***
You are on branch legacy

Available branches on the remote ‘origin’ for /var/www/html:
[0] develop
[1] feature/chart-export
[2] feature/notifications
[3] legacy
[4] master
[5] Skip updating this repository
Enter the number of the branch you wish to update [legacy]:3
The latest commit in /var/www/html is 398f1b50c71904f69e836b26299dd178d9d4515a on Mon, 11 Jan 2016 08:16:11
The latest commit on origin/legacy is 398f1b50c71904f69e836b26299dd178d9d4515a on Mon, 11 Jan 2016 08:16:11
Your local version of /var/www/html 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 updater indicates I’m current, and does not make any changes.
The mods are working to an extent.
I have the brewometer showing, but the thing is reporting values in C not F Although I did change that in settings.ini
and no logs in the maintenance panel.
I think its a broken path in the instructions but don’t know where to look.

Well, the brewpi.py file is at version 0.4.0 so you have the wrong file. This is a file which is copied over in the Tilt setup instructions, so it looks as if you pulled it from the wrong branch. I looked at @jvgolf’s repo and his Master branch (the only branch) is Legacy so I’m not sure how that got screwed up but it did.

Do you have data you need to keep, or can you be “brutal” about things?

I can be as brutal as needed. I’ve got it backed up to just before applying the mods. Unfortunately I’m heading to the airport. And won’t be able to touch it for 2 weeks.

Well, there’s a good chance I’ll have a better answer for you in two weeks. :grinning: Ping me then!