Brewometer integration


#330

Hate to sound so noobish, but I have no idea how to install this (copy the folders, etc). The only folders I have are:

/home/pirate/brewpi-data/data

I don’t know how to do these steps:

  • The files in the brewpi-web folder should be copied to the /var/www directory. Ensure you fix the ownership once the files are copied over (sudo chown -R www-data:www-data /var/www)
  • The files in the brewpi-script folder should be copied to the /home/brewpi directory. Ensure you fix the ownership once the files are copied over (sudo chown -R brewpi:brewpi /home/brewpi)

Also, when I go to get the bluez etc:

  • sudo apt-get install bluez python-bluez python-scipy python-numpy libcap2-bin

It just says:

Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package python-bluez
E: Unable to locate package python-scipy
E: Unable to locate package numpy

Sorry to be so inexperienced, but could I have one of you kind gentlemen baby-step my dumb ass through this?


#331

Figured it out. I needed to go into the container console to run the commands. But now I’m stuck trying to get the TiltHydrometerTest.py to pick up my Tilt. Here’s what I get:

root@63da5767a696:/home/brewpi/brewpi-brewometer/tiltHydrometer-test# python TiltHydrometerTest.py
Scanning - 20 Secs (Control+C to exit early)
Unhandled exception in thread started by <bound method TiltHydrometerManager.scan of <TiltHydrometer.TiltHydrometerManager instance at 0x7522c710>>
Red: NoneTraceback (most recent call last):
File “/home/brewpi/brewpi-brewometer/tiltHydrometer-test/TiltHydrometer.py”, line 360, in scan

blescan.hci_le_set_scan_parameters(sock)
File “/home/brewpi/brewpi-brewometer/tiltHydrometer-test/blescan.py”, line 107, in hci_le_set_scan_parameters
old_filter = sock.getsockopt( bluez.SOL_HCI, bluez.HCI_FILTER, 14)
_bluetooth.error: (9, ‘Bad file descriptor’)
Green: None
Black: None
Purple: None
Orange: None
Blue: None
Yellow: None
Pink: None
Red: None
Green: None
Black: None
Purple: None
Orange: None
Blue: None
Yellow: None
Pink: None

And it just continues until I interrupt with CTRL C.

Any thoughts?


#332

Oh well. I’ll use the Tilt app/web page for this brew I guess. Mayve next brew. It’s my RPi3 bluetooth. Gotta figure out why it’s not working.

Eric


#333

Hi @wooby111, Did you run all the apt-get and setcap commands (outlined in the readme) successfully?

That error looks like something hasn’t been setup correctly with the bluetooth.


#334

Yes but the first time I didn’t run it inside the container console and it gave me package read errors. Also, when I ran the setcap command, it just paused and returned me to the command prompt. No specific confirmation texts or anything specific really. Is that normal?


#335

How did you get your graph to show Fahrenheit over Centigrade?


#336

That has nothing to do with the Tilt/Brewometer. That is simply in the Brewpi settings under the Maintenance panel


#337

Odd.

My Maintenance is set to Fahrenheit but the chart still shows Centigrade.


#338

I have the same issue as Wooby111, but had no challenges whatsoever executing all commands in the container.
If I run the same command with a sudo, it also generates these errors, so it’s not a matter of the privileges.
Do I need to enable anything on the ocntainer side for this to work? Just like you need to run a command to map a USB port for a BrewPi to the container?

My output:
/home/brewpi/tiltHydrometer-test# python TiltHydrometerTest.py
ERROR: Loading default settings file (tiltHydrometer/settings.ini): No section: 'Manager’
Scanning - 20 Secs (Control+C to exit early)
Red: None
Unhandled exception in thread started by <bound method TiltHydrometerManager.scan of <TiltHydrometer.TiltHydrometerManager instance at 0x76c4fdc8>>Green: None
Black: None
Purple: None
Orange: None
Blue: None
Yellow: None
Pink: None
Traceback (most recent call last):
File “/home/brewpi/tiltHydrometer-test/TiltHydrometer.py”, line 360, in scan
blescan.hci_le_set_scan_parameters(sock)
File “/home/brewpi/tiltHydrometer-test/blescan.py”, line 107, in hci_le_set_scan_parameters
old_filter = sock.getsockopt( bluez.SOL_HCI, bluez.HCI_FILTER, 14)
_bluetooth.error: (9, ‘Bad file descriptor’)


#339

Aha. It’s a nuance I didn’t pickup from @wooby111’s original post.

Are you both running these in a docker container?

I think the issue is the way bluetooth in the docker container works with the RPi3 bluetooth. I’ve not tested this yet in a container, so you’re both forging new ground.

If you run hcitool lescan from within the container, do you see any results? If not, then you migh tneed to look at teh docker configuration… A quick search reveals a number of people who have made bluetooth work inside a docker container, but you need to look at the arguments you launch your docker container with.

Let me know how you go - It would be worth an update to the readme if it can be made to work.


#340

The /home/brewpi/tiltHydrometer/settings.ini has the C/F setting for recording values from the tilt. The graph is driven from the Brewpi settings, as @jhenry said.


#341

From what I see so far, it seems all the ones that succeeded either ran the container in prvileged mode
( —net=host —privileged) or host mode (network_mode: “host”).
If anyone has a more security conservative way of doing it, I’m open to suggestions, otherwise I’ll give prvileged mode a try when I find some time later this week.

Another thing that I found now that I’m back in the brewery again (had the Raspberry and Tilt on the desk for the Tilt integration) is that I don’t have a WiFi connection to my BrewPi’s anymore, or at least, the script’s not running and generates a JSON syntax error, even when restarting the containers and only then starting the BrewPi’s.
Any idea what could cause this?
All I did so far was the steps described in the Tilt integration readme, the Brewpi’s connected fine over Wifi to my containers before.

Maybe doing the containers AND the tilt integration was a bit ambitious at this stage :wink:


#342

There’s nothing in the Tilt modification code that should stop the wifi integration from working… That’s not to say there couldn’t be a bug.

What errors do you see in the logs?


#343

I think this has nothing to do with Tilt.

WiFi seems a bit unstable still, but I have not been able to find the cause yet. I think it might even be in the Particle framework. So don’t worry about it being caused by the Tilt. It is not and I am trying to fix it.


#344

Ok, just coincidental timing then.
I’ll jut redeploy one of the containers with USB forwarding again then so I at least have one stable connection during brewday.


#345

I always do it over and over 2 or 3 times. Mine never takes on the first time I change it.


#346

Howdy all - I’ve just checked in an update to js/beer-chart.js into my repository. The updates make the drawing/refreshing of the graph much faster, even with large data sets.

My current brew, which has been going for 2 weeks, now takes < 3s to draw the graph, as opposed to the 30+ secs it was taking before.

Give it a whirl if you’re interested.


#348

I am having mixed result right now. Some background info first: I am running brewPi in the new docker format. All the files are copied into the folders that I checked (/home/brewpi/ and /var/www/html/). I confirmed the settings file is there. And in the pic I know it says script not running but it was at the time the data was logged. Also the tiltHydromterTest.py IS showing good data for my black Tilt.

As you can see I have the normal brewPi screen and it seems to be logging two extra data lines. One is the temp from Tilt (the jump is from when i changed from C to F), and the other is all the way at the bottom of the chart which is the gravity reading 1.000 since it was in normal water. I did put it in salt water and confirmed it rose up to 1.030, but it was still all the way at the bottom of the chart. Also unlike other pics I have seen here it does not show Tilt as an object on the right side along with beer and Fridge Temp.

Any help would be appreciated!


#349

Also I have a brew going now and it seems the numbers being charted are off. If you zoom way in it shows the current gravity to have just hit the 1.050 mark, but the TiltHydrometerTest.py is showing 1.045 which I confirmed with a regular hydrometer.


#350

Have you entered your calibration values into the config file on your brewpi? The calibration in the app isn’t loaded onto the tilt so you’ll have to enter them into the config file on your brewpi separately.

I keep entering the un-calibrated values (from the app) and matching hydrometer readings when I’ve been doing brews. I also did about 10-15 readings using DME before first using it. I now find my tilt is correct to approx +/-1.001 so about the same as a hydrometer. Though I have noticed temp can affect the reading by ~1.001-1.002 when crashing. So use experience/common sense when looking at your readings :slight_smile: