Brewometer integration

Hi @beardy82,

The unwanted brewometers will automatically dissappear when you get all the modifications installed correctly. The modified beer-chart.js is responsible for hiding those entries, so it looks like it hasn’t been copied to the web directory properly. Also, the brewometer colours are missing, so that looks like the css files haven’t been copied correctly.

When you clone that repository, just do it in the /home/pi or /tmp directories. Once you’ve downloaded the modification files, you then copy from those directories into the /var/www and /home/brewpi directories, as outlined in the instructions.

Thanks @sbowler , that all makes sense, i think i’m pretty much sorted with understanding how to go about it now so will have another crack after a fresh install at the weekend.

Hi mate, I am trying to get to get this to work on my legacy system and dont have a clue what to do. I have cloned all the files into a separate directory and now I have no clue what to do. I struggled to even get brewpi working when I got it. is there anyway you can let me know what files I have to change or even give the amended files.
Cheers Stew

I believe it’s here on github. These should be the files you are looking for: https://github.com/jlvnyc/brewpi-brewometer

It’s the same code from @sbowler but with the edits to the legacy branch for arduino.

I still can not get this to work. Can anyone please advise me to what mistakes I have made.
Cheers Stew


The top error I’m not so sure about. The Brewometer modification doesn’t use anything in the device configuration area… My only guess (if this worked before you did the mod) is that you’ve accidentally changed something in the brewpi.py script that’s stopped the device config from working. Do you have the tools to do a file comparison? If not, might be best to start with a fresh brewpi.py, check that this fixes the device config, then re-apply the mod.

The bottom error suggests that you’ve got the Brewometer mod working, but it doesn’t like the format of your TEMPERATURE.black and GRAVITY.black files… Can you post the contents of each here?

Cheers,

Simon

All good working now. I just don’t have the black dots next to bo temp and sg.

Great news.

As to your other problem: The lack of colour on the dots indicates that the brewometer.css file isn’t being picked up. Is it in the css/ directory? And if so, did you copy the modified index.php file across (this has the reference to the css/brewometer.css file).

Because I am using weaved for remote access could that cause the problem.
Cheers Stew

Hi @rbpalmer i loosely followed the External Access as well. Would you mind telling me a bit more about what / where you added the extra code to the admin.php file? Did you make any alterations to the PublicBeerPanel.php file?

Would appreciate your help to save me trawling through the code looking for discrepancies.

Thanks in advance.

Hi Rich, thanks for the pointer to fuscus. I was able to get fuscus running, and that did indeed solve the problem of the brewpi script stopping all the time.
Since I don’t have any temperature sensors attached to the pi, it doesn’t show a chart, because it’s not receiving any temperature data from the virtualized “spark”. As a result it’s also not displaying any of the brewometer data.
I can see that the brewometer code is indeed pulling data from the brewometer sensor, but it isn’t making it through to the brewpi chart.
I will need to do some more troubleshooting to find out where it’s getting stuck.

Cheers,

Oliver

Hi @beardy82,

I did have to do a few alterations and then decided that it was not worth the effort going forward. if the Brewpi software was updated I would then have to retro fit the changes again.

External access can be done in many different way and in the end I have decided to use VPN access to my local LAN.

Rich

@odezzy,

your right, I have two suggestions, either you have to hack the code to insert data as if there is a temp sensor on the end or just purchase one temp sensor and a 4.7k resistor and set it to measure room temp.

Rich

I decided the same thing and started from scratch on a new Rpi3 and have used Weaved for the remote access. Will save a lot of hassle when the new update comes along.

Hi @sbowler,

I had this up and running sucessfully before and started a new fermentation, with a new battery in the brewometer, on saturday.
The data was correctly sent from the brewometer to the brewpi server to start with, but then suddenly stopped (see screenshot, this may have coincided with a brief power outage).
If I ssh into the pi (it is at a remote location) i can still get brewometer data via the BrewometerTest.py script, but the output on the brewpi maintenance panel log is

Oct 17 2016 00:24:26 Found BrewPi v0.4.3 build 0.4.3-0-g4d00879, running on a Particle Photon with a V2 shield on port /dev/ttyACM0

Unhandled exception in thread started by >
Traceback (most recent call last):
File "/home/brewpi/Brewometer.py", line 333, in scan
blescan.hci_enable_le_scan(sock)
File "/home/brewpi/blescan.py", line 79, in hci_enable_le_scan
hci_toggle_le_scan(sock, 0x01)
File "/home/brewpi/blescan.py", line 103, in hci_toggle_le_scan
bluez.hci_send_cmd(sock, OGF_LE_CTL, OCF_LE_SET_SCAN_ENABLE, cmd_pkt)
_bluetooth.error: (1, 'Operation not permitted')

I’ve tried rebooting but with no success. Could it be some kind of permissions or sudo problem - I did run apt-get upgrade and update after I started the fermentation, and the power outage could have led to the pi rebooting, so it may be that something broke during the update process.

Any ideas how I can get it to plot the data again?

Hi @BorealBeer,

I think your apt-get has probably changed some permission setting… Can you try re-running the command:
sudo setcap cap_net_raw+eip $(eval readlink -f `which python`)

This is the only one I’m aware of that needs to be run to allow the script to access the bluetooth stack with enough permission to pull the Brewometer/Tilt data.

I tried the command, but with no success. Will trawl the net a bit to see what else I could try. Thanks so much for taking the time to respond, will let you know if I find anything that works. I’m all ears for other suggestions as well!

Edit:

I thought it didn’t work at first but it just took some time to update on the graph. I can confirm that @sbowler suggestion worked perfectly - thank you so much!

I’ve been using the brewpi for about 5 brews now, installed on a Rasberry Pi generation I

Today I got my Tilt hydrometer

I wanted to include this in the brewpi interface following the instructions on GitHub

However, after updating with the updater.py command, my brewpi no longer works

Now I’m getting “script not running”. It’s been over 6 months that I installed my raspberry so updating took a long time, something in that update must have screwed something up…

Somebody here that might have an idea on what went wrong?

just found out that it was not the update that made my brewpi no longer work, but copying/overwriting the files from github. When I do this, I get an error that brewpi has a version which is not compatible with the arduino…

Are these github files only useable with the spark?

apparently there was a seperate github for the legacy branch (https://github.com/jlvnyc/brewpi-brewometer), so I tried again with this one. Now I don’t get the version error but I get this:

Oct 29 2016 22:28:15 Opening serial port
Oct 29 2016 22:28:15 Notification: Script started for beer 'My First BrewPi Run’
Oct 29 2016 22:28:25 Checking software version on controller…
Oct 29 2016 22:28:25 Found BrewPi v0.2.10 build unknown, running on an Arduino Uno with a revC shield on port /dev/ttyACM0

Traceback (most recent call last):
File “/home/brewpi/brewpi.py”, line 421, in
startBeer(config[‘beerName’])
File “/home/brewpi/brewpi.py”, line 296, in startBeer
changeWwwSetting(‘beerName’, beerName)
File “/home/brewpi/brewpi.py”, line 229, in changeWwwSetting
wwwSettingsFile = open(wwwSettingsFileName, ‘r+b’)
IOError: [Errno 13] Permission denied: '/var/www/userSettings.json’
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File “/usr/lib/python2.7/threading.py”, line 810, in __bootstrap_inner
File “/usr/lib/python2.7/threading.py”, line 763, in run
File “/home/brewpi/backgroundserial.py”, line 81, in __listenThread
File “/usr/local/lib/python2.7/dist-packages/serial/serialutil.py”, line 572, in inWaiting
File “/usr/local/lib/python2.7/dist-packages/serial/serialposix.py”, line 456, in in_waiting
: ‘NoneType’ object has no attribute ‘ioctl’

@sbowler do you have any idea what I’m doing wrong here?