Brewometer integration

Do you see any changes on your UI?

Are you able to see any Tilt related lines in your stderr/stdout logs?

UI didn’t change and there nothing in the logs about the Tilt as far as I can tell.

I’ve gone back to TiltPi in the meantime since I have something fermenting I want to keep an eye on, but can try again some more this weekend/next week.

Are you sure you managed to change the files inside the container/in the right spot? The other thing to check is that re-started the script (or container) after making all the updates.

Sorry if this is the wrong place … but I just installed this successfully on the Legacy/Arduino system I have been running for the last 2 or 3 years … and wanted to say many many thanks to Both Elco (for conceiving of, and putting together such awesomeness) and sbowler (bloody legend) for their respective parts.

For something I spent less than AU$100 on 3 years ago, plus the recent additions/replacement of a Rpi3 and a new Tilt, … I can stare right into the heart of the beast now, and see what it’s really up to (noise notwithstanding)

It’s an awesome system for me and my shed, love ya work.

Help, please. My BrewPi SD card corrupted and I did not have a copy of the card after installing the Tilt stuff (stupid me). I have rebuilt using the legacy BrewPi as I am lost with the new BrewPi and containers, dockers , etc. However, your readme at GitHub is missing the instructions on loading/installing to my machine. Can you let me know what I should be doing? “sudo apt-get install ?..?”

Stefan

Hey, this is awesome! I’m not really a coder, I have just installed everything (on Legacy) following steps, but I would love to know how you did this. But I don’t know what all the code you added was.

to beer-panel.php I added the “lcd-line-4” line:
47%20PM

But after that, I am lost. I am unclear what to add to the main.js file. I found the refreshLCD function, but what would populate that with the data?

I am also unclear what to add to the brewpi.py file or where within that file.

Having the Tilt gravity in the LCD panel would be awesome for me! I greatly would appreciate any help on this!
Thanks

After struggling a while with a iSpindel I just received my Tilt. I got it running using a the TiltPi.
But I would love to have the readings from the Tilt in the brewpi graph. I can not get this working. I completed all the steps from the readme (https://github.com/sibowler/brewpi-brewometer/blob/master/README.md).
I use brewpi in the docker configuration and I updated brewpi before starting with the code below:

sudo apt-get install python-scipy python-numpy
sudo apt-get install bluez python-bluez python-scipy python-numpy libcap2-bin
sudo setcap cap_net_raw+eip $(eval readlink -f `which python`)
root@raspberrypi:/home/brewpi# python /home/brewpi/brewpi-brewometer/tiltHydrometer-test/TiltHydrometerTest.py    
	(I get a reading from the tilt!)

root@raspberrypi:/home/brewpi# cp -r /home/brewpi/brewpi-brewometer/brewpi-web/. /var/www/html/			
	(I can confirm that the items were copied)
sudo chown -R www-data:www-data /var/www/html/
root@raspberrypi:/home/brewpi# cp -r /home/brewpi/brewpi-brewometer/brewpi-script/. /home/brewpi/		
	(I can confirm that the items were copied)
sudo chown -R root:root /home/brewpi
	(here I used root:root instead of brewpi:brewpi)

I refreshed the browser en started the script again, even after restarting the brewpi container I dont see the graph.

update 14-10
I found out that brewpi-web should be copied to www-data /var/www/html/ and not to www-data /var/www/
Now something has changed in the brewpi graph. I now see all the tilts, but not yet the reading from my tilt.

Does anybody have an idea what goes wrong?

Somehow I got it working now. Below some problems:

  • selecting a value from one of the tilts is not possible in the legend, values from brewpi work fine.
  • the actual values from the tilt are not visible in the legend, values from brewpi are visible
  • the legend is way too long so the area with the status is in front of the legend
  • the scaling of the tilt gravity data is not correct. The gravity value is in the same scale as the temperature, so a value of 1 to 1.1 on a scale from 1 to 22. Only with zooming the graph is readable

I found the problem. I needed to clear my cache in google chrome.

Sorry to took so long to check out your reply. I stepped through the README but still get errors.

Firstly "python-scipy : Depends: libstdc++6(>= 4.3.0) but it is not going to be installed

I tried installing libstdc++6 and am told that it already installed (6.3.0-18+rpi1+deb9u1) and that it breaks python-scipy

Stefan

@sbowler, I made all the file / directory changes but when I go to run the TiltHydrometerTest.py I get this:

root@a578f97090d0:/home/brewpi/tiltHydrometer-test# sudo setcap cap_net_raw+eip $(eval readlink -f `which python`)
root@a578f97090d0:/home/brewpi/tiltHydrometer-test# python TiltHydrometerTest.py
Scanning - 20 Secs (Control+C to exit early)
Red: None
Green: None
Black: None
Unhandled exception in thread started by <bound method TiltHydrometerManager.scan of <TiltHydrometer.TiltHydrometerManager instance at 0x749aa0f8>>Purple: None


Traceback (most recent call last):
  File "/home/brewpi/tiltHydrometer-test/TiltHydrometer.py", line 360, in scan
Orange: None
    Blue: None
blescan.hci_le_set_scan_parameters(sock)
Yellow: None
  File "/home/brewpi/tiltHydrometer-test/blescan.py", line 107, in hci_le_set_scan_parameters
Pink: None
    old_filter = sock.getsockopt( bluez.SOL_HCI, bluez.HCI_FILTER, 14)
_bluetooth.error: (9, 'Bad file descriptor')
Red: None
Green: None
Black: None

I feel I’m missing something simple.

Hey I have hit the same issue, by the looks of things the latest version of docker now includes a device flag, so I think you need to include the Bluetooth device in the docker start up script. The examples I saw were for USB Bluetooth dongles not built in Bluetooth. But I can confirm my docker images does not have any bluetooth devices. Run hcitool dev to check. I’ll post again once I figure out what to do.

Ok so I manged to get access to Bluetooth in Docker by starting the docker image with --net=host.
So “docker run -d --name brewpi --net=host --privileged -p 80:80 -p 81:81 -v ~/brewpi-data:/data -v /etc/timezone:/etc/timezone -v /etc/localtime:/etc/localtime --restart always brewpi/brewpi-raspbian”
I didn’t get any data returned by the test scan but the error went away.

Ok so you also have to switch Bluetooth on… I did this on the host.

  • Type sudo bluetoothctl then press enter and input the administrator password (the default password is raspberry ).
  • Next, enter agent on and press enter. Then type default-agent and press enter.
  • Type scan on and press enter one more time.

All - Having trouble with tilt on latest firmware 0.5.10. Chrome/rpi3/brewpi with latest
tiltHydrometer-test/TiltHydrometerTest works correctly.
Webserver chart busted.
Followed 15 july - with the additional steps scattered throughout rest fo posts, also went back and stepped through confirming permissions correct. Even 777’d them. Still no go.

Get list of all tilts down the line - as in the April 15 rbpalmer post,

Reboot, restart script and then the chart and legends break.
Appears to then not populate the tilts in legend.
Log 1 in legend will show up after waiting a while. eg icon for log1 with no text, then text “log1” populates.
Other artifacts - chart constantly indicates set to warming, all existing stored data/profiles gets wiped.

If anyone has it working on firmware 0.5.10 - appreciate post up the accurate file permissions/locations and any updates to the sibowler’s post brewpi firmware 0.5.0?

I think time would be better spent integrating the tilt with our new BrewBlox stack.
I think it will be much easier, because it is built from scratch with external hardware integrations in mind.

If any of you wants to write a docker microservice to read data from the tilt and push it onto the event bus for logging, get in touch and we’ll help you get started. We have boilerplate python3 code for connecting to the framework, so what you would need to write yourself is mostly getting the data from the tilt. My guess is that it can be done in 100-200 lines of python.

The most difficult bit might be getting bluetooth to play nicely with docker.

1 Like

Will stick to current code base for a few more months-year. Taken many full moons to get to working hardware.

Happy to let others trailblaze and hit all the bugs for next 3-6 months.

The oct14 instructions above are incorrect and misses the all important step of waiting.

Thanks Elco, Ill take a look at BrewBlox.

@bensheridan, this info helped out a lot. I recreated my brewpi docker with the net=host flag, got the required files to where they needed to be and then ran the bluetooth commands on the host Pi. And then finally, the docker started seeing my tilt. Thanks for all the help!

Help - I’ve broken my BrewPi!

Background is a BrewPi legacy running OK for 2+ years using an Arduino Uno and I am adding a Tilt Hydrometer. I followed this thread and @sbowler instructions. The BrewPi software was updated to the latest and the files downloaded from GitHub. I admit I am a software noob, but with the support of this excellent forum and the history, I have made progress.

Symptoms:

  1. The Tilt communicates with the software when I run the TiltHydrometerTest.py script. It finds my orange tilt ok

  2. I ran the fixPermissions.py script after installation and it appears to have run without error. Previous to that I also ran the sudo chown commands as detailed in the instructions.

  3. I cleared the browser cache and have tried multiple browsers (PC and Apple Safari). Same result

  4. The Brewpi does not display the Y2 SG axis at all. The ‘LCD’ data panel in the upper left disappeared when I updated (overwrote) the brewpi-web folder in /var/www/html and when I try to run the script, it won’t run

  5. I changed the settings file to Fahrenheit. I also changed the default ‘.colour’ suffix to ‘.orange’ to match my Tilt on the Gravity and Temperature files in /home/brewpi/tiltHydrometer folder.

  6. I have rebooted the RaspberryPi multiple times.

The BrewPi page currently looks like the following. Please help. I want to brew this week and have spent all weekend getting this far!

Paul

FWIW, the stderr log file is as follows, with no logs reported in the stdout.:

Jan 13 2019 19:12:04 Notification: Script started for beer ‘Tilt hydrometer Ale #4
Jan 13 2019 19:12:04 Connecting to controller…
Traceback (most recent call last):
File “/home/brewpi/brewpi.py”, line 344, in
hwVersion = brewpiVersion.getVersionFromSerial(bg_ser)
File “/home/brewpi/brewpiVersion.py”, line 27, in getVersionFromSerial
oldTimeOut = ser.timeout
AttributeError: BackGroundSerial instance has no attribute ‘timeout’
Jan 13 2019 19:13:04 Notification: Script started for beer ‘Tilt hydrometer Ale #4
Jan 13 2019 19:13:04 Connecting to controller…
Traceback (most recent call last):
File “/home/brewpi/brewpi.py”, line 344, in
hwVersion = brewpiVersion.getVersionFromSerial(bg_ser)
File “/home/brewpi/brewpiVersion.py”, line 27, in getVersionFromSerial
oldTimeOut = ser.timeout
AttributeError: BackGroundSerial instance has no attribute ‘timeout’
Jan 13 2019 19:14:03 Notification: Script started for beer ‘Tilt hydrometer Ale #4
Jan 13 2019 19:14:03 Connecting to controller…
Traceback (most recent call last):
File “/home/brewpi/brewpi.py”, line 344, in
hwVersion = brewpiVersion.getVersionFromSerial(bg_ser)
File “/home/brewpi/brewpiVersion.py”, line 27, in getVersionFromSerial
oldTimeOut = ser.timeout
AttributeError: BackGroundSerial instance has no attribute ‘timeout’
Jan 13 2019 19:15:04 Notification: Script started for beer ‘Tilt hydrometer Ale #4
Jan 13 2019 19:15:04 Connecting to controller…
Traceback (most recent call last):
File “/home/brewpi/brewpi.py”, line 344, in
hwVersion = brewpiVersion.getVersionFromSerial(bg_ser)
File “/home/brewpi/brewpiVersion.py”, line 27, in getVersionFromSerial
oldTimeOut = ser.timeout
AttributeError: BackGroundSerial instance has no attribute ‘timeout’
Jan 13 2019 19:16:03 Notification: Script started for beer ‘Tilt hydrometer Ale #4
Jan 13 2019 19:16:03 Connecting to controller…
Traceback (most recent call last):
File “/home/brewpi/brewpi.py”, line 344, in
hwVersion = brewpiVersion.getVersionFromSerial(bg_ser)
File “/home/brewpi/brewpiVersion.py”, line 27, in getVersionFromSerial
oldTimeOut = ser.timeout
AttributeError: BackGroundSerial instance has no attribute ‘timeout’

Paul