[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.
@kaljade Thanks. Found the script by RandR+. That should get me the installation.

However, what I was really looking for was a recommended list of all of the sensors, RPi Plates and mods folks are using. All in a one stop shop. A lot of the posts in here are "this is what you do for this" or "this is what you do for that". And all great info, but its spread out and a bit convoluted.

I'll do it myself as I step through all of the installation procedures and getting the sensors installed and working, but I was hoping to not reinvent the wheel.
 
@kaljade Thanks. Found the script by RandR+. That should get me the installation.

However, what I was really looking for was a recommended list of all of the sensors, RPi Plates and mods folks are using. All in a one stop shop. A lot of the posts in here are "this is what you do for this" or "this is what you do for that". And all great info, but its spread out and a bit convoluted.

I'll do it myself as I step through all of the installation procedures and getting the sensors installed and working, but I was hoping to not reinvent the wheel.
day_trippr did a rollup which there's a link two in the second post in this thread. Cliff Notes are, use an arduino instead of a alamode, swissflow sensors are still the flowmeter of choice, but the cheaper adafruit ones will suffice. Mods are uncharted territory if you are using the RandR+ version but it's highly cofigurable so you might not need any.

Cheers,

Kal
 
fwiw, on the hardware side...I run RaspberryPints on a pair of RPi2B modules with Alamode shields (working system and a hot spare unit) but I've run it on a B, a 3B and a Zero W. The only difference from one to another is the screen update time, with the 3B being barely-discernible-blink-fast to the B and Zero W where you might have to wait a second or so.

I've also used a standard Arduino Uno R3 instead of the Alamode - it's a much cheaper solution and offers more usable AVR digital IO pins = more meters.

For "sensors" I run a six pack of Swissflow SF800 flow meters in the keezer, which is festooned with ds18b20 temperature sensors tracking air and beer temperatures.

Software side mods are many and evolved over the years which is why stuff tends to be scattered through this and the predecessor thread. Among the many is a PIR widget to wake up a sleeping tap list screen, integrating various temperature readings into the tap list display, and as you may have noticed lots of massaging of the actual tap list display to use different icons and the like.

Honestly, one is best served by pouring a tall one and starting from the beginning...

Cheers!
 
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
It's all good. That line some how magically disappeared from my index file! A quick check in windiff exposed the difference.
 
Replace the BIG, long nasty if else if from
www.homebrewtalk.com/forum/threads/version-2-release-raspberrypints-digital-taplist-solution.487694/page-67#post-8044468

with the following.

#Force ebc value to a whole number by casting to integer
$workEBC = (int) $ebc;

# The ebc value image displayed is 1 less than the ebc value. If less than 36 build the value to display
# otherwise, default to srm-36
$srmImgClass = ($workEBC < 36) ? "srm-" . ($workEBC - 1) : "srm-36";

Works fine, but I'm still not getting the hop image/hop color and alcohol image/color.
 
Found and fixed the problem! style.css is missing the ;

From
www.homebrewtalk.com/forum/threads/version-2-release-raspberrypints-digital-taplist-solution.487694/page-67#post-8044468

.srm-indicator{
position: absolute;
height: 100%;
width: 100%;
top: 0;
left: 0;

background: url(img/srm/pint-stroke.png) <- NOTICE MISSING ;
}

change to
background: url(img/srm/pint-stroke.png);

Reboot and now everything is working!

Hopefully, this will help others.

Also, replace the BIG, long nasty if else if from
www.homebrewtalk.com/forum/threads/version-2-release-raspberrypints-digital-taplist-solution.487694/page-67#post-8044468

with the following.

#Force ebc value to a whole number by casting to integer
$workEBC = (int) $ebc;

# The ebc value image displayed is 1 less than the ebc value. If less than 36 build the value to display
# otherwise, default to srm-36
$srmImgClass = ($workEBC < 36) ? "srm-" . ($workEBC - 1) : "srm-36";
 
Last edited:
I've looked at the Raspberry Pints code. Geez. We could and should improve things. In software development I realize there are always many ways to do the same thing, many way to achieve the desired results. But, at the same time, there is working smart vs. work hard. I'd rather work smart.

For example, in index.php the code is constantly switching between html and php. This is "beating the server" and "expensive". There is no valid reason for constant switching between html and php.

Just a small sample.

Original index.php
<table>
<thead>
<tr>
<?php if($config[ConfigNames::ShowTapNumCol]){ ?>
<th class="tap-num">
TAP<br>#
</th>
<?php } ?>

<?php if($config[ConfigNames::ShowSrmCol]){ ?>
<th class="srm">
GRAVITY<hr>COLOR <-- WE really should have a closing </hr>. Browser can probably figure this out, but we're making it work.
</th>
<?php } ?>

See the switching between html and php?

IMO, better to minimize the switching. Use php echo to write to the output stream.

echo '<table>';
echo ' <thead>';
echo ' <tr>';

if($config[ConfigNames::ShowTapNumCol]) {
echo '<th class="tap-num">TAP<br />#</th>' };

if($config[ConfigNames::ShowSrmCol]){
echo '<th class="srm">GRAVITY<hr>COLOR</hr></th>'};

etc...

While I know the if statement is only 1 line and the {} are not needed for 1 line if statements, including the {} just make things clear and cleaner. Especially for future mods. Nothing like debugging something where the {} were omitted and it's not obvious what's happening.

I too know the difference between the single quote ' vs the double quote ". However, multi single quoting around something, such as '''tap-num''' is confusing and ugly.

Why minimize switching? Server sends to output stream quicker meaning browser renders quicker.

Just my thoughts, my opinions. Not criticizing anyone or any techniques. Just trying to be helpful.
 
Last edited:
Being an inveterate spaghetti coder (my skills and actual attention units were always on the hardware side) I never comment on others' work ;)

If you want a challenge, fix the original package so it will run on whatever replaced mysql5 on Raspbian Stretch...

Cheers!
 
Well I'm almost done again. Working on pours.php now and will test shortly. I don't have hardware to test but I'll push a few pours via a browser or something to make sure everything updates as appropriate.

General question for anyone playing with RPints. The way things look in the code is that the keg objects are pretty much useless. It seems like it would make sense to link a beer to a keg via a linkage table to facilitate KegID, BeerID, StartVol, CurrentVol. you could even link the tapId in as well to use a single linkage table for everything. The point is that if I take a beer off to swap in a different beer, I'd like to keep the pours against that keg so when I put it back on, it's already set to go.

Does this make sense or am i over-thinking/over-complicating/over-engineering things?

Tons. I'll add it to the list to do after the Skinning (correct me if I'm backwards but overhauling the main UI seems to be the most common "Hack" people tackle right?)

Anyone know if @kcolby implemented any of these enhancements to the handling of kegs in his version?
 
Being an inveterate spaghetti coder (my skills and actual attention units were always on the hardware side) I never comment on others' work ;)

If you want a challenge, fix the original package so it will run on whatever replaced mysql5 on Raspbian Stretch...

Cheers!

Difficult to remotely know what was done or not done to break your version of Raspberry Pints.

I've posted in this thread, not as a criticism of others, but to show/explain what I did to remove a problem I encountered. I was hoping others would see the debugging processing and encouragement to fix their own RPints problems.
 
fwiw, as much as I'd love to take credit for the original RaspberryPints it is not my work.

Anyway, the point was, while it appears there is a functional fork it would still be cool if someone discovered some minor changes could get the original working in today's Raspbian environment...

Cheers!
 
v2.0.1 from raspberrypints.com was the final version.
Yeah, Jessie isn't a challenge as the Raspbian kit for it included php-mysql5 so it's nbd to get running, just a couple of tweaks required. It was the Stretch package that dumped mysql for mariadb (I gather) and some method that R'Pints exploited to connect to the database is no longer viable.

fwiw, I have a hunch that R'Pints use of root access may be at the bottom of the issue...

Cheers!
 
fwiw, as much as I'd love to take credit for the original RaspberryPints it is not my work.

Anyway, the point was, while it appears there is a functional fork it would still be cool if someone discovered some minor changes could get the original working in today's Raspbian environment...

Cheers!
I wonder if it could be a easy as what they are doing here: https://help.nextcloud.com/t/upgrade-php5-to-php7-on-raspbian-jessie-8-0/24537
I'm not a PHP Programmer (not any kind of Software Engineer for that matter) but the dotdeb.org source appears to contain some if not all of the deprecated PHP7.0 packages that RPints relies on?
 
Last edited:
I do know in other php setups, updating php broke things. Once I got RPints working I turned off the RP wifi and will not do any OS, mySQL, php or other updates.

Yes, I modify RPints, but not the underlying system. The recent RPints mods are the SRM glasses thanks to input from Kaljade.

Day_tripper was your RPints ever working? If so, what happened?
 
[...]Day_tripper was your RPints ever working? If so, what happened?

My RaspberryPints installations have always worked and are still working, but they were installed atop Wheezy and then Jessie which both supported mysql5.

I'm getting the impression that there's a communication problem extant here...

Cheers!
 
My (albeit limited) understanding of the situation is that MariaDB is a drop-in replacement for MySQL that is better optimised to handle larger scale databases, the issue is that Strech uses PHP7.0 which removed support for deprecated libraries that were still available in PHP5.6 (eg PHP5-MySQL). So what we need is either a) a viable in place PHP7.0 uprade pathway that works from Jessie and above, or b) a simple modification to the original RPints installation to support PHP7+

My two cents...

Cheers,

Kal
 
On another note, Keg Volume Kalculator - Metric Flavour:

screen_20190104-082023.png


Kal's world makes sense again! ;)
 
When I updated a hobby site from php5.x to 7, version 7 broke a number of working things. So, perhaps, in addition to the MariaDB compatibility issues there are also php issues.

I have an extra microSD card. I am tempted to tackle this issue. However, I do have numerous other items "on my plate" at this time. Still, a challenge exists that's calling me...
 
Yeah, I think getting original RPints up to PHP7.0 and MariaDB 10.2 is definitely the high watermark! If you choose to accept the challenge I'd be happy to offer whatever assistance I can.

Cheers,

Kal
 
I don't see any real showstoppers there that would affect RPints, do you?

Really difficult to quickly determine. Depends on the version of MySQL. Some compatibility items don't look as bad as others. I do know, upgrading from MSSQL 9 to 10 to 13 I'm constantly "bumping" into issues that are not supposed to be issues.
 
Yeah, I think getting original RPints up to PHP7.0 and MariaDB 10.2 is definitely the high watermark! If you choose to accept the challenge I'd be happy to offer whatever assistance I can.

Cheers,

Kal

Kal you were most helpful when I changed the SRM graphics in RPints. Perhaps, the 2 of us working on this issue together?

BTW, I sincerely miss Radio Australia, VLW4, VLW9, VLW15 and the Northern Territories stations on shortwave. Those were the days!
 
Really difficult to quickly determine. Depends on the version of MySQL. Some compatibility items don't look as bad as others. I do know, upgrading from MSSQL 9 to 10 to 13 I'm constantly "bumping" into issues that are not supposed to be issues.
Looking at PHPMyAdmin it says I'm currently running MySQL 5.5, so going to either MariaDB 5.5, 5.6, or 10.0 should be fairly straight forward. Going from PHP5.6 -> PHP7.0 on the other hand is going to be a bit more difficult.

The main reason for wanting to upgrade both is that would bring the environment up to spec with Stretch and therefore maintain future compatibility.
 
Looking at PHPMyAdmin it says I'm currently running MySQL 5.5, so going to either MariaDB 5.5, 5.6, or 10.0 should be fairly straight forward. Going from PHP5.6 -> PHP7.0 on the other hand is going to be a bit more difficult.

The main reason for wanting to upgrade both is that would bring the environment up to spec with Stretch and therefore maintain future compatibility.

So MariaDB may not actually be the problem. Hmm... I could clone my existing microSD with Raspbian Jessie and install MariaDB 10.0. If RPints works then this rules out problems with MariaDB. Then it's onto the php upgrade. Lets crawl before we walk...

Can someone build my wine glass rack wife keeps bugging me to build for the bar while I work on this instead?
 
Kal you were most helpful when I changed the SRM graphics in RPints. Perhaps, the 2 of us working on this issue together?

BTW, I sincerely miss Radio Australia, VLW4, VLW9, VLW15 and the Northern Territories stations on shortwave. Those were the days!
Sounds like a plan! I'll start looking into it over the weekend (I'll grab yet another SD card and start playing around with it).

Yeah, there's been a huge backlash over the axing of Radio Australia shortwave broadcasts over here, the ABC boss got fired shortly after getting grilled by a Senate fairness commission, so it may be back...
 
So MariaDB may not actually be the problem. Hmm... I could clone my existing microSD with Raspbian Jessie and install MariaDB 10.0. If RPints works then this rules out problems with MariaDB. Then it's onto the php upgrade. Lets crawl before we walk...
Sounds like a plan, in my day job we routinely upgrade DBs from MySQL to MariaDB for performance gains (but these are online learning sites with massive databases). PHP on the other hand is a another kettle of fish, but due to PHP5.6 security patching officially ending last Monday, there'll be a much greater emphasis on that this year no doubt.
 
Now I just need to learn how to clone a Linux microSD. If it was a Windows drive I could clone it in my sleep :)

Can't use Windows to clone the microSD as Windows doesn't "see" Linux partitions. Interesting that Linux sees Windows items without problems. Would think, Windows 10 with bash support, would be better about Linux partitions and files, but No!
 
Sounds like a plan! I'll start looking into it over the weekend (I'll grab yet another SD card and start playing around with it).

To help you out on your quest the problem is that the MySQL_[function]s were deprecated in php 7

most of the changes needed are straight forward as there are direct replacements for the functions, but I think there or 2 in the original that don't have a new direct function but could be worked around

Example
mysql_connect($servername,'root',$rootpass);
mysql_query($sql) ;
$qry = mysql_query($sql);
while($b = mysql_fetch_array($qry)) {
$b['id']
}

could be (there are different ways in PHP to DB access this is just my preference)

$mysqli = new mysqli("$host", "$username", "$password", "$db_name")or die("cannot connect to server");
$qry = $mysqli->query($sql);
while($qry && $b = $qry->fetch_array()){
$b['id']
}
 
Now I just need to learn how to clone a Linux microSD. If it was a Windows drive I could clone it in my sleep :)

Can't use Windows to clone the microSD as Windows doesn't "see" Linux partitions. Interesting that Linux sees Windows items without problems. Would think, Windows 10 with bash support, would be better about Linux partitions and files, but No!
Follow this guide to hot clone the SD card using the Pi: https://www.homebrewtalk.com/forum/...roller-for-cheap.466106/page-179#post-8083569
 
Back
Top