[Version 2 Release] RaspberryPints - Digital Taplist Solution

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Its not too hard if you have PHP and SQL experience.

There SQL view to get the pours (found in the schema.sql file) and a pourListTable.php (under includes) to display the pours history. index.php would need to be modified to include the pourListTable.php or copy the contents of pourListTable into the index.php. Add in the options that pourListTable uses to database and the config_names.php

Also I have new columns in the Database that would either need to be added to the original or removed from new stuff.

Tks. I really like the “pours history” tab in the new version sense it’s already configured to spit out any info one desires! Have a programmer friend that might take a look at it but don’t think he’s versed in php.
 
fwiw, you can get all the history you want on the original R'Pints using phpmyadmin (though you do need to modify the sql to set the date - by default that field is Nulled for each pour). Plus you can do all kinds of filtering which can be handy for debugging issues...

Cheers!

The work is already done!

IMG_0069.JPG

IMG_0070.JPG
 
Its not too hard if you have PHP and SQL experience.

There SQL view to get the pours (found in the schema.sql file) and a pourListTable.php (under includes) to display the pours history. index.php would need to be modified to include the pourListTable.php or copy the contents of pourListTable into the index.php. Add in the options that pourListTable uses to database and the config_names.php

Also I have new columns in the Database that would either need to be added to the original or removed from new stuff.

Tks, I’ll give it a shot though I not versed in either [emoji854]
 
Alright guys. I think I'm on to something. I ended up starting from scratch and followed the script found here (https://raw.githubusercontent.com/rtlindne/RaspberryPints/master/util/installRaspberryPints) Based on the screenshot provided, I believe I have an older version of RPints. (version 1.0.3.395 to be exact) I am having a difficult time upgrading though. Can someone please walk me through how to upgrade to the newest version? Thanks in advance!

upload_2018-12-28_13-11-42.png
 
Umm...if it isn't actually populated with record data can it be said to be "done"?
Anyway, phpmyadmin offers some serious record management abilities that I doubt anyone really wants to duplicate inside R'Pints...

Cheers!
I again agree with what day_trippr says, phpmyamin can already do all of that and more and it's installed by default, so it's already waiting for you to use.
 
Don't get me wrong, I'm +10 grateful for the effort put in by RandR+, particularly as his effort may be the one that keeps R'Pints alive :)
And if I jumped the gun and that table could have been populated then it's a worthwhile feature to have, at least to the extent of its record filtering and edit capabilities.
But again, phpmyadmin is loaded for bear and would likely be impractical to fully duplicate its abilities inside R'Pints...

Cheers!
 
Hello all, I have been lurking in thread for some time and finally decided to put a raspberry pints together. I have a rapberry pi 3b+ and an alamode board. I installed the package for the flowmeters. I can access raspberry pints and can see the tap list ect..but getting the flowmeters up and running is providing to be an issue any help would be greatly appreciated
 
Greetings @Marvin Herrin, and welcome to our little corner of Home Brew Talk :mug:

In the hope that you're at the same point, go back to my post here, then read the next two replies.

Let us know if that gets you up and running!

Cheers!
Thanks for the speedy response . I copied the file into the specified path and executed the command and I'm not seeing any change.
 
Just to check, is your RaspberryPints installation rooted at /var/www/html or /var/www/ and did you make sure the value of DIR in the flowmon service file was correct?

Otherwise, did enable "Use Flow Monitoring" in the management gui (found under Personalization - Show/Hide Columns)?

Cheers!
 
Just to check, is your RaspberryPints installation rooted at /var/www/html or /var/www/ and did you make sure the value of DIR in the flowmon service file was correct?

Otherwise, did enable "Use Flow Monitoring" in the management gui (found under Personalization - Show/Hide Columns)?

Cheers!
The installation was rooted to/var/www/html, I double checked the dir for the flowmon file and that has the correct path as pointed out in your post. I went in and checked "use flow monitoring" and that was set to on.
 
Ok, let's try this: in a terminal session run the following command:

Code:
ps aux |grep flow_monitor

What you should see is:

Code:
pi@rpints ~ $ ps aux |grep flow_monitor
pi        2075  0.0  0.7  11508  6720 ?        S    17:28   0:03 /usr/bin/python /var/www/python/flow_monitor.py
pi       29109  0.0  0.1   4044  1780 pts/0    S+   23:47   0:00 grep --color=auto flow_monitor
pi@rpints ~ $

If you only get the second line then the flow_monitor port listener isn't actually running.

[note: ignore the path, my installation is rooted at /var/www]


You can also run this command:

Code:
sudo /etc/init.d/flowmon status

and the result should look like this:

Code:
pi@rpints ~ $ sudo /etc/init.d/flowmon status
[ ok ] /var/www/python/flow_monitor.py is running.
pi@rpints ~ $

Cheers!
 
If you determine the flowmon service and flow_monitor listener are running, check out my post here for some notes about installing on Jessie and dealing with the Apache2 DocumentRoot being at /var/www/html.

In short you'll at least have to edit flow_monitor.py to change the poursdir setting (by default = '/var/www' and in your case needs to be changed to ='/var/www/html').

Cheers!
 
Speaking of phpmyadmin...one can do interesting things by exporting selected data and using Excel to plot trends.

For example, I wanted to get a feel for when a keg is going to kick by looking at its trend line. So I ran an SQL search on the pours table for that tapid (every tapped keg gets a unique tapid), exported that dataset in CSV format, pulled that into Excel, then added a column that reflected the remaining volume. Basically the top entry in the column = 5 minus the pour volume cell value for that row, then the next entry below subtracts the next pour volume cell value from the previous remaining volume value, and so on through the rest of the record set.

Then I told Excel that the column with CURRENT_TIMESTAMP was indeed a Date construct and picked the format from the Type list so it would know which part was the date and which was the time.

Now with the remaining volume and pour date/time set up I pulled them into the Chart tool and plotted the trend. It showed this keg was losing a gallon every four weeks so there's a little more than four weeks left before it kicks if the trend holds.

sql_tricks.jpg


fwiw, this happens to be a keg of my imperial chocolate stout of which I typically have a short 4-6 ounce pour nightly before bed, which informs its long life :) I always have a backup keg (right now I have two) so it's never "out"...

Cheers!
 
Here's another plot, this one of a keg of Julius clone, with a consumption rate just under 1 gallon per week (we were visiting the oldest son's family during the flat region right of middle so I'm working from the left of that).

julius_pours.jpg


All kinds of geeky stuff to play with :D

Cheers!
 
Alright guys. I think I'm on to something. I ended up starting from scratch and followed the script found here (https://raw.githubusercontent.com/rtlindne/RaspberryPints/master/util/installRaspberryPints) Based on the screenshot provided, I believe I have an older version of RPints. (version 1.0.3.395 to be exact) I am having a difficult time upgrading though. Can someone please walk me through how to upgrade to the newest version? Thanks in advance!

That version number doesn't mean anything in that version, if you followed my script then you will have the latest working version of Raspberry Pints.

The reason I don't have an updated version number is that I'm not sure what I should put since my version is a fork of the original.
 
That version number doesn't mean anything in that version, if you followed my script then you will have the latest working version of Raspberry Pints.

The reason I don't have an updated version number is that I'm not sure what I should put since my version is a fork of the original.
I think you should go with v3.0 as it's clearly a major version release from v2.0.1 which is the last version the original developers released before abandoning the project.
 
Don't get me wrong, I'm +10 grateful for the effort put in by RandR+, particularly as his effort may be the one that keeps R'Pints alive :)
And if I jumped the gun and that table could have been populated then it's a worthwhile feature to have, at least to the extent of its record filtering and edit capabilities.
But again, phpmyadmin is loaded for bear and would likely be impractical to fully duplicate its abilities inside R'Pints...

I agree anyone with SQL experience is better using a sql viewer like phpmyadmin to see, filter and order the Pours table from the original Raspberry Pints. It allows more capabilities right now and more than what I will be working on.

the screenshot provided by @volsherdeers did not show any data because of the filters that were on there, here is a screen shot from mine that shows what it looks like

upload_2018-12-29_15-2-18.png
 

Attachments

  • upload_2018-12-29_14-56-28.png
    upload_2018-12-29_14-56-28.png
    174.1 KB · Views: 38
  • upload_2018-12-29_15-1-51.png
    upload_2018-12-29_15-1-51.png
    168.9 KB · Views: 39
Keg Volume Kalculator Mod: How to install

Difficulty level: Medium (requires command line and SFTP).

Assumptions/dependencies: Assumes that you have official RPints 2.0.1 installed on a PHP5 environment (Wheezy/Jessie), forked versions of RPints are not currently supported.

Warning: Before proceeding any further take a fresh disaster recovery backup of your Pi, I will attempt to assist anyone that gets stuck along the way, but sometimes things can go wrong and you'll need a rollback strategy in place.

Step 1: Altering the config and kegs database tables

Warning: Here be dragons!

I decided to add a few new rows to the config table to store our brewery default settings, so that you don't need to populate these every time you tap a keg, and also created a new column in the kegs table to store individual keg maximum volume as generic values based on keg type is not granular enough in a real world environment (eg one of your kegs may have a big dent in the side of it so it holds less than it used to).

So SSH into your Pi and then run the following command:
Code:
sudo mysql -u root -p
Enter your RPints password then copy the entire following and paste in into the terminal:
Code:
use raspberrypints;
INSERT INTO config ( configName, configValue, displayName, showOnPanel, createdDate, modifiedDate ) VALUES
( 'altitude', '0', 'Altitude', '0', NOW(), NOW() ),
( 'temperature', '0', 'Temperature', '0', NOW(), NOW() ),
( 'pressure', '0', 'Pressure', '0', NOW(), NOW() );
ALTER TABLE kegs
ADD COLUMN maxVolume decimal(6,3) NOT NULL AFTER weight;
UPDATE kegs SET maxVolume = '5' WHERE kegTypeId = '1';
UPDATE kegs SET maxVolume = '2.5' WHERE kegTypeId = '2';
UPDATE kegs SET maxVolume = '3' WHERE kegTypeId = '3';
UPDATE kegs SET maxVolume = '10' WHERE kegTypeId = '4';
UPDATE kegs SET maxVolume = '5' WHERE kegTypeId = '5';
UPDATE kegs SET maxVolume = '5.16' WHERE kegTypeId = '6';
UPDATE kegs SET maxVolume = '7.75' WHERE kegTypeId = '7';
UPDATE kegs SET maxVolume = '7.75' WHERE kegTypeId = '8';
UPDATE kegs SET maxVolume = '15.5' WHERE kegTypeId = '9';
UPDATE kegs SET maxVolume = '13.2' WHERE kegTypeId = '10';
UPDATE kegs SET maxVolume = '10.81' WHERE kegTypeId = '11';
UPDATE kegs SET maxVolume = '10.81' WHERE kegTypeId = '12';
UPDATE kegs SET maxVolume = '21.62' WHERE kegTypeId = '13';
UPDATE kegs SET maxVolume = '43.23' WHERE kegTypeId = '14';
UPDATE kegs SET maxVolume = '64.85' WHERE kegTypeId = '15';
Quit;

This will not only create the rows/column but also set the default max volume for your existing kegs so you don't have to update them all manually.

Step 2: Copying the new files across to your Pi

Warning: Here be dragons!

I've attempted to maintain the same file structure that the original developers used in case they one day return and decide to incorporate this into the official version, so due to the fact that many files needed to be edited, I've put them all together in a zip file for you here: RPintsKegVolCalc.zip (MD5 checksum: 3231513238b679284fcdfeae353e8f3f).

The contents of that zip are as follows:
Code:
├── admin
│   ├── includes
│   │   ├── managers
│   │   │   └── keg_manager.php
│   │   └── models
│   │       └── keg.php
│   ├── keg_form.php
│   ├── keg_list.php
│   ├── left_bar.php
│   ├── personalize.php
│   ├── tap_form.php
│   ├── update_altitude.php *
│   ├── update_pressure.php *
│   └── update_temperature.php *
└── includes
   └── config_names.php
(the files with an asterisk next to them are newly created files that previously didn't exist)

Before copying these files across it's a good idea to diff your existing files against original RPints files to ensure any changes you've made to them are not lost (using WinDiff on Windows or DiffMerge on Mac for example). Here's a zip with just the unedited versions of the original files in it for you to use:
RPintsRevert.zip
(MD5 checksum: 852eb0280408903060a4144b19212a79).

Here's an example of changes on my tap_form.php file that I'll need to redo in order to get my metric back on again:

screen_20181231-131744.png


Once you've done the SFTP transfer, make sure you've got the right permissions with the following command:
Code:
sudo chmod -R 777 /var/www

Step 3: Editing your index.php file

No dragons here!

As index.php is the first file we all hack, I figured it would be easier to just provide the one line of code that needs updating rather than including the file then everyone having to hack all their changes back into in.

Find the following line:
PHP:
$sql = "SELECT `kegTypes`.`maxAmount` as kVolume FROM  `kegs`,`kegTypes` where  kegs.kegTypeId = kegTypes.id and kegs.id =".$kegID[0]."";
Change it to:
PHP:
$sql = "SELECT `kegs`.`maxVolume` as kVolume FROM `kegs` where kegs.id =".$kegID[0]."";

Then do a reboot just to be sure:
Code:
sudo reboot
This makes sure that the percentage indicator on the keg is using our new max volume instead of the generic max amount value.

That's it, stay tuned for our next episode where I explain how to use it ;-)

Cheers,

Kal
 
Last edited:
Keg Volume Kalculator Mod: How to use

KVK Mod is easy to use, firstly set your Beer Defaults:

screen_20181231-161054.png


Enter your defaults and save them one at a time, like so:

screen_20181231-161205.png


Altitude is your brewery altitude above sea level, this in conjunction with Beer Pressure is used to calculate the weight of the beer relative to pure water at the same pressure, and the amount of CO2 dissolved in the beer. Altitude is the only default not accessible on the tap form, so if you move house you'll need to update it here. If you live in a hermetically sealed environment like an underwater observatory or a submarine, leave this field as 0 and compensate in the Beer Pressure section below.

Beer Temperature is used to calculate the weight of the beer relative to pure water at the same temp, and the amount of CO2 dissolved in the beer, this can be overridden on a per tap basis, so if you normally cold crash or keg condition your beers you may set this to 36 for example, if you keg straight from the fermenter it may be 68.

Beer Pressure is used in conjunction with altitude in order to obtain absolute pressure (barometric pressure + gauge pressure), which is used to calculate the weight of the beer relative to pure water at the same pressure, and the amount of CO2 dissolved in the beer. It is important to note here that this pressure is the fermentation pressure not the kegging pressure, so if you do not ferment under pressure, this should be set to 0. If you live in a hermetically sealed environment you will need to "over or under" your barometric pressure compared to PSI at sea level (14.695 PSI) eg if your barometric pressure is 15 PSI and you usually ferment under pressure at 13 PSI then you would put 15-14.695+13=13.305.

Next if you know the actual max volumes of your individual kegs you can update them in the My Kegs page:

screen_20181231-161704.png


So now you are ready to go! When you tap a keg you'll notice the temperature and pressure defaults populated at the top of the form, and when you select a keg it will automatically calculate the weight of that keg if it was filled to maximum:

screen_20181231-161810.png


If it's not full, simply enter the actual weight of the keg and hit the 'Update Weight' button and the new volume will be calculated:

screen_20181231-161907.png


That's it, stay tuned for our next episode where we go behind the curtain and I'll explain how it works ;-)

Cheers,

Kal
 
Last edited:
Kaljade, after I transferred files and gave permissions, I went from this
Tap%20List-M.jpg

To this
screen%20grab-M.jpg


Opened the Index.php and did not have this line available to change!
" $sql = "SELECT `kegTypes`.`maxAmount` as kVolume FROM..."

So I'm guessing I'll need to re-insert my index.php mods ?
 
Last edited:
Hey all, is there a current setup procedure or best practices document, which starts at the beginning and includes the recommended parts list and/or options? A lot of good info in this thread, but its 98 pages long. Sure, I can wade through it if I have to and put together an updated outline, but before I do that, just wondering if someone else has already done it?
 
Kaljade, after I transferred files and gave permissions, I went from this
Tap%20List-M.jpg

To this
screen%20grab-M.jpg


Opened the Index.php and did not have this line available to change!
" $sql = "SELECT `kegTypes`.`maxAmount` as kVolume FROM..."

So I'm guessing I'll need to re-insert my index.php mods ?
Okay, figured it out, I had a hardcoded URL in the left_bar.php file, so when you clicked on your logo to go back to your tap list it took you to my RPints page (which explains the pours I got up to last night on New Years Eve).

You can either manually fix the file (replace the URL on line 16 with "../index.php"), or redownload the zip file and transfer across again.

Still doesn't explain why your index.php file is missing the $sql = "SELECT `kegTypes`.`maxAmount` line, unless you are looking at the wrong index.php file (there are more than one of them), or you are not using the original RPints code and have a forked version instead? If the former is the case ensure you have the public index.php file (located in you document root directory), if the latter is the case, you'll need to rollback to you DR backup as forked versions aren't supported at this stage.

Cheers,

Kal
 
Last edited:
Did the mods. Noticed my styles.css is named style.css.

The beer colors look great. Unfortunately, I've lost the IBU hop and hop coloring and the calories/alcohol glasses/coloring. Did a reboot after making the mods. Analyzing why I've lost the hop coloring and the calories/alcohol glass(es) and coloring.
There's likely a small error in one of the two files, if you want to PM them to me I'll take a look (you'll need to change the file extension of both to .txt to upload them).

Cheers,

Kal
 
In the index.php around line 248 I see the logic for the IBU. ABV logic is a bit further down. I don't recall if php is similar to javascript in that if an error is encountered then it just stops processing.
Yeah, php tends to silently fail on the line where the error is encountered, so nothing past that line gets executed
 
Hey all, is there a current setup procedure or best practices document, which starts at the beginning and includes the recommended parts list and/or options? A lot of good info in this thread, but its 98 pages long. Sure, I can wade through it if I have to and put together an updated outline, but before I do that, just wondering if someone else has already done it?
Yeah, there's a new php7 fork created by RandR+, instructions shouldn't be much further than a page or two back, so start from here and work back. Alternatively, if you want to install the original php5 version, go to the second post in this thread and follow the link. If you get stuck just holler.

Cheers,

Kal
 
Most interesting. I either only get the SRM glasses and colors or I get the IBU hop/colors and Alcohol glasses and colors. I'm not getting SRM glasses and colors, IBU hop/colors and alcohol glasses and colors all displaying. Done reboot, restarted browser.
 
Most interesting. I either only get the SRM glasses and colors or I get the IBU hop/colors and Alcohol glasses and colors. I'm not getting SRM glasses and colors, IBU hop/colors and alcohol glasses and colors all displaying. Done reboot, restarted browser.
Definitely sounds like something hasn't been escaped out properly in one of those files, maybe a missing semicolon or curly bracket?
 
I give up for now. It's New Year's Eve. Time for drinks with the wife and friends. To everyone at HBT. Cheers! Have a happy and healthy 2019. Happy New Year.
Happy New Year (our's was last night), reach out tomorrow if you want my assistance.

Cheers,

Kal
 

Latest posts

Back
Top