Brewometer integration

Howdy @vanosg .

Yep I’d be very happy to help convert this into a module. Maybe PM me and we can go through the specifics there.

Hi @odezzy,

The Brewometer logging is done only through the PI, so from a hardware perspective you should be right. However, we do use the logging mechanism built into the brewpi script (brewpi.py). So if that is unable to run without a Spark/Arduino attached, then we’re in a bit of trouble. I haven’t done any investigation into the script to see if the script could be modified to work without a connected device.

My advice would be to go through the brewpi.py python code and try disabling any lines that look like they exit if the connection to the Spark is lost.

Good luck!

@odezzy have you taken a look at https://github.com/andrewerrington/fuscus it simulates the Spark attached to the Pi, so you can graph the Breometer without any ten sensors etc.

Rich

Hi @sbowler thanks for writing this integration i ordered myself a brewometer of the back of seeing this thread. It arrived yesterday and i have been messing around with the integration today. I’ve managed to get it almost working but i have now modified so many things i think that i will start from scratch. This is the first time that i’ve used git hub so apologies if this is a daft question but can i just use the green ‘Clone or Download’ tab then copy the https link and then use git clone https://github.com/sibowler/brewpi-brewometer.git ? If so which directory do i direct it to?

Will i still need to apt-get python-scipy and python-numpy? I tried earlier but it says that it is an invalid operation:

sudo apt-get python-scipy
E: Invalid operation python-scipy

I’ve got lost trying to get rid of unwanted brewometers from the web interface so that mine, yellow, isn’t hidden behind the fermentation profile by deleting lines of script which i possibly should not have done…

@beardy82
do apt-get install python-scipy

you forgot the ‘install’ :slight_smile:

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?