• Please visit and share your knowledge at our sister communities:
  • If you have not, please join our official Homebrewing Facebook Group!

    Homebrewing Facebook Group

[Version 2 Release] RaspberryPints - Digital Taplist Solution

Homebrew Talk

Help Support Homebrew Talk:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
One last question. Did you change the following like TimL suggested?

Chang the following line in /includes/pours.php

$amount = $PULSE_COUNT / 21120;

to

$amount = $PULSE_COUNT / 1500;

I noticed that when you have that small a pulse count per volume, then you may have to change another value in the Alamode code, using the same procedure as when you changed the pin config (see here: http://raspberrypints.com/byo/step-9-configure-pi-hardware-flow-meters-wflow-meters/)

Just this time, in the following line:
https://github.com/RaspberryPints/R...arduino/raspberrypints/raspberrypints.ino#L68

change the '100' to something smaller (I used 35). Otherwise smaller pours (less than ~ 4 ounces) wouldn't register.

Cheers,
-Th
 
I noticed that when you have that small a pulse count per volume, then you may have to change another value in the Alamode code, using the same procedure as when you changed the pin config (see here: http://raspberrypints.com/byo/step-9-configure-pi-hardware-flow-meters-wflow-meters/)

Just this time, in the following line:
https://github.com/RaspberryPints/R...arduino/raspberrypints/raspberrypints.ino#L68

change the '100' to something smaller (I used 35). Otherwise smaller pours (less than ~ 4 ounces) wouldn't register.

Cheers,
-Th

THANK YOU! I knew there was something I was forgetting! I'll give that at try tonight after work.
 
It's been a bit quiet lately over at the RPints github repository, which is understandable; real live happens and may make it impossible to donate endless hours.

I had a couple of days over the last weekends finishing up my outdoor keezer build, and wound up fiddling with the code implementing a few things that I needed for it. Here's the break down:

Some bug fixes:
  • Firefox support: fixed the mask problem for the SRM display
  • fixed invalid keg state query when reducing number of taps
  • the tap form no longer requires input of associated alamode pin (see below)

New features:
  • now updates keg pours (and other stuff) to remote browser displays (no need for xdotools anymore)
  • tap valve/solenoid control: a tap can now have a valve/solenoid associated, which shuts the tap off or turns it on. This is controlled from the admin panel. The hardware is controlled via the Raspberry Pi's GPIO, and can be configured in the admin panel
  • fan (line cooling) control: RPINTS can now control a fan (or line cooling) output. The pin is configured in the admin panel. Two times can be set: the trigger time is the interval when the fan is turned on, and the fan time is the time how long the fan is running after it has been turned on
  • New tap configuration panel: There is a new panel in the admin section that configures the taps and its associated hardware pins. If configured to use flow counters, the pin associated with each tap can be set here. If configured for tap valve control, the GPIO pin for the tap can be set here. This no longer makes it necessary to enter the flow pin in the tap list when tapping a keg. This panel also has the controls for the fan, if that's configured.
  • added ability to use FireFox on Amazon FireTV as a tap list display

A couple screen shots are attached all the way below:
  • First one is the new tap list with solenoid/valve indicators on the right.
  • Second the new tap configuration panel
  • Third shows the taplist icon on my FireTV home screen
  • 4th is the tap list running on the AFTV.

The reason for the AFTV stuff is that I already had a outdoor TV hanging over where my taps are, and having yet another dedicated tap list monitor there would have looked a bit goofy. Also, there would have been hardly a way to get a HDMI cable there from the keezer. Now I can just use the remote to switch over to the tap list when done watching Kodi or Netflix.

So, this probably isn't ready for the end user, I have done little work to add this to or verify the installer. There are also a few extra modules needed, namely PyWebsockets and mod_python, this link has some more info to install those: https://github.com/HentschelT/RaspberryPints/blob/Version2/UPDATES.MD
It also needs an extra table in mysql, the sql to add this is added to the schema.sql. You also need to re-register the new flowmon script to /etc/init.d/ ; ps aux should now no longer show flow_mon.py but PintDispatch.py.

Just one word of caution: Don't run this outside of your home network/ firewall for now.

The repository is here: https://github.com/HentschelT/RaspberryPints/tree/Version2
I also added a pull request to the main RPints repo. Maybe the developers like it and merge it into the RPints distribution. It's based on Version2.
Disclaimer: Even tho this is based on Raspberry Pints, it's not a official release from the RPints developers, and it isn't endorsed as such.

If there is any interest on how I did the hardware side for the valves/solenoids/fan, let me know, I'll add that in another post.

Cheers,
-Th

RPints-Main.jpg


RPints-TapConfig.png


AFTV-IconMainscreen.jpg


AFTV-TapList.jpg
 
Those are all killer improvements. Especially the not having to enter the damn pin number every time you tap a keg. Are you going to make this "newbie friendly" so us with a lot less knowledge than you can install these improvements in our system?
 
Cool now rpints is becoming an even more wireless monitoring solution. Can't wait for this to all be cleaned up and hopefully added to the release. With my bluetooth pour monitor hack and something like this rpints could effectively be moved onto a vm and you can use any method available to view the tap list. Finally having the ability to use an external browser without having to use an auto refresh hack will make this a much cleaner solution.
 
Those are all killer improvements. Especially the not having to enter the damn pin number every time you tap a keg. Are you going to make this "newbie friendly" so us with a lot less knowledge than you can install these improvements in our system?

It depends a bit on how much you're willing to help ;)

I just updated the repository with a version that doesn't require mod_python anymore (which can be a bit of a pain to install), so now the only extra step is to install pyWebSockets.

So essentially, if you wanna give this a whirl, start with a fresh SD card in your Pi (or if you have an extra Raspberry Pi, even better) and start a new install. Make sure you got backups of your current stuff!

Just run thru the install procedure as explained on the RPints web site (the w/ flowmeters stuff). On step 7, instead of downloading from the RPints repository, you use this link: https://github.com/HentschelT/RaspberryPints/tree/Version2 and click on "Download Zip". Proceed as usual, just substitute the file name of the downloaded .zip file accordingly in the remaining procedure.

Just before you go to Step 8, lets install the pyWebSocket library. This link has the details: https://github.com/google/pywebsocket/wiki , the short version is like this (in your raspberry pi's terminal):
Code:
cd ~
sudo apt-get install git
git clone https://github.com/google/pywebsocket.git
cd pywebsocket
python setup.py build
sudo python setup.py install
(Each line is a command you type into your Pi's terminal).

Now just finish the rest of the install. If something goes wrong, let me know.

The only other difference is in step, 9, the line
Code:
ps aux | grep flow_monitor.py
now changes to
Code:
ps aux | grep PintDispatch.py
This command just checks if the RPints server process has started.

Let me know how it goes...

Cheers,
-Th
 
Cool now rpints is becoming an even more wireless monitoring solution. Can't wait for this to all be cleaned up and hopefully added to the release. With my bluetooth pour monitor hack and something like this rpints could effectively be moved onto a vm and you can use any method available to view the tap list. Finally having the ability to use an external browser without having to use an auto refresh hack will make this a much cleaner solution.

BTW, there always was a way for remote updates over the network (via X11 forwarding), its just kinda kludgy and requires root on the client - something I didn't have on mine (AFTV).

Just implementing another change I wanted: Basically, the current version of the Alamode program only updates the RPi once a pour is finished, which means I can't find out if someone left a tap open (well, not until the thing is completely empty). Got a friend of mine who's taps are outside and a storm knocked a branch down onto his taps - 75 Gallon of beer made their way into the pool.

Maybe with this change I can avoid that, and avoid meeting this little guys brother in my back yard...


Cheers,
-Th
 
Last edited by a moderator:
So, for anyone that tried to install this yesterday, pour updates may have not worked. I forgot to update one of the sql queries, mea culpa, sorry :(

I fixed that bug, and (hopefully as a consolation) added a couple other things:
  • you can change the counts per gallons for your flow meters (the one where you used to have to edit 'pours.php') from the tap config screen.
    (I may revisit this, since I'd like to be able to set this on a per flow meter/tap basis. This would help if there are different flow meters on individual taps, and it seems to help the accuracy for flow meters with less flow count per gallon)
  • if you got tap valves/solenoids installed, you now can set a value that is considered too much of a 'pour', and it shuts the tap off.
  • if you kick a keg, the tap valve gets shut off; if you tap a keg, the valve turns on

Some instructions to install in this post:
https://www.homebrewtalk.com/showpost.php?p=7130076&postcount=1387

For folks with the swissflow and other high-resolution meters, you may have to change the '200' in the following line
https://github.com/HentschelT/Raspb...arduino/raspberrypints/raspberrypints.ino#L84
in your 'raspberrypints.ino' file before uploading it to the alamode to something higher (probably around 2000?). Otherwise the alamode most likely won't be able to keep up and not report pours.

On that subject, I'd love to change this, such that the alamode could be configured directly from the Pi, including the pin count and the pin numbers. I just haven't figured how to programmatically reset the Alamode from the Pi (as in restart the sketch that does the counting). If anyone knows...

Cheers,
-Th

RPints-TapConfig02.png
 
I fixed that bug, and (hopefully as a consolation) added a couple other things:
  • you can change the counts per gallons for your flow meters (the one where you used to have to edit 'pours.php') from the tap config screen.
    (I may revisit this, since I'd like to be able to set this on a per flow meter/tap basis. This would help if there are different flow meters on individual taps, and it seems to help the accuracy for flow meters with less flow count per gallon)
  • if you got tap valves/solenoids installed, you now can set a value that is considered too much of a 'pour', and it shuts the tap off.
  • if you kick a keg, the tap valve gets shut off; if you tap a keg, the valve turns on
Thank you for the work you are doing and the helpful links and instructions. I plan on giving this a shot on a new install later this week (time permitting).

What type of solenoids are you using? I tried some but they created so much turbulence that it really messed up my pours.
 
Thank you for the work you are doing and the helpful links and instructions. I plan on giving this a shot on a new install later this week (time permitting).

What type of solenoids are you using? I tried some but they created so much turbulence that it really messed up my pours.

Yea, the jury is still out on that. I'm still missing a few essential pieces to finish up my kegerator, but I did do a test run with a Koelsch that I had handy.

I used solenoids that are normally used in espresso machines. Removing the little filtering screen on the intake helped quite a bit. I also mounted it directly before the flow counters, and used a piece of silicone tubing inside the connector between the two, to keep the inside line diameter between the solenoid and the flow counter about the same. Also, I have a pretty long beer line run (16 ft), which appears to help out. In the end, I still have to see this working in all cases...

BTW, did you see my reply in the other RPints thread?

Cheers,
-Th

KeezerSolenoid.jpg
 
So I did a fresh install using the standard RPints files and I still can't get my adafruit flow meters working. I took one of them and plugged in about 8" of solid core wire to each and then in to the alamode board and still nothing. I changed the pour counts in both files. I'm at a loss. I have tried several different flow meters since I bought 10 of them. I have to be missing something. I may try your software just to see if it makes any difference.
 
Can you get them to register using the flow meter code provided by adafruit?
 
So I did a fresh install using the standard RPints files and I still can't get my adafruit flow meters working. I took one of them and plugged in about 8" of solid core wire to each and then in to the alamode board and still nothing. I changed the pour counts in both files. I'm at a loss. I have tried several different flow meters since I bought 10 of them. I have to be missing something. I may try your software just to see if it makes any difference.

Just a heads-up: Don't use it right now, I made a change last nite which may not work for your system. I may get around to fully implementing this later tonite. Basically, I found a way to reset the Alamode and make it read config parameters from the RPi. Which means that you won't have to recompile and reinstall the Alamode program (the .ino file) every time you change your taps. I just didn't get it finished last nite, I'll give a heads-up here when its going again.

As far as your counter problems, I noticed a few things that may prevent them from working:
* If you happen to dabble with your Pi's GPIO, *don't* do anything with pin 18. That's the reset line for the alamode, and will reboot it which means it most likely will loose serial communication with the Pi (which means no updates)
* Not all input pins on the alamode are created equal. Pin 5, 6, 7, 9, and 10 work for me.
* Once I got my code updated (hopefully later today), I added a decent amount of logging to see what's going on with the communication to the Alamode. This should give us a better idea where things fail.

Anyways, no worries, unless your alamode got fried in some way, we'll get you going.

Cheers,
-Th
 
Hi folks,

So, I made my updates last nite, but didn't get around to testing with actual flow meters, since SWMBO was already in bed and the whistling of me blowing thru the flow meters would have driven her mad...

Got around to testing today, and also added a few things that should make dealing with the flow meter stuff a little easier.
  1. The RPints software now flashes the binary (the compiled arduino .ino file) to the alamode when it starts up. The hex file for this is included in the distribution.
  2. The alamode software (the one that was flashed) is now able to listen for configuration parameters. What they are is explained below.
This means that you won't have to fiddle with the arduino IDE anymore to change parameters (in fact they are no longer in the same form in the code). You still have to install the arduino software (RPints uses it internally), but no need to change anything in that anymore and upload it etc..

Now for the mentioned parameters:
When changing the tap config, the software now uploads the number of flow meters and their pin numbers.
It also uploads:
  1. the pour message delay: This is the time in milli-seconds that we wait for more counts to come in after the counter already stopped. It basically waits for that amount of time after the flow already stopped to see if it restarts again to be considered for the pour
  2. the pour trigger count: that's the minimum flow meter count that needs to be received before it is considered a pour. For high-resolution meters like the swissflow, this should probably be around 200 to 300 (the original value was 300). For low-resolution meters, this needs to be set lower to not miss smaller pours (I got it at 25 on mine)
  3. the kick trigger count: this is the count the flow meters need to issue within one millisecond to kick the keg. The original value was 30 for swissflow meters. This may not work too well on lower resolution meters, I set mine to 5 and it's not always triggering. If you don't want your keg to automatically be kicked when this counter trips, set this to a high value (500 should do for any counter)
  4. the pour update count: This is the count after which the alamode reports a flow update to RPints. This is currently only used for the automatic shutoff when large pours occur. For high-resolution meters, a good value is probably around 1500 or 2000. For low-resolution meters, I've set mine to 250. If this value is too low for your flow meters, it may make the alamode miss pour counts, so high is better than low.
As a note, all but the last parameter were already in the original .ino file, they ware just hardcoded values.

The screen shot attached below shows the tap config screen as it is now, and you can see the text fields to change the alamode parameters in the middle. When you hit "Update Alamode Config", or if you hit any "Save Tap Config" or if you reduce the number of taps, the alamode is reset, the parameters are uploaded, and the alamode is again ready to count with the new settings. This process takes about 2 seconds.

As far as installing: I already posted some instructions a few posts ago here:
https://www.homebrewtalk.com/showpost.php?p=7130076&postcount=1387.

Some additional notes on that:
Make sure you get the right Zip file from the github page, that page wants to switch on you to the master branch, but the changes are all in the 'Version2' branch. Here is a direct link to the zip file:
https://github.com/HentschelT/RaspberryPints/archive/Version2.zip

If you get thru the install, and the Pints web site shows up for the first time, in the admin panel go to the 'personalize' page (the little gear in the upper right corner), and enable everything but '4k monitor support' for now. Hit save.
With that you can set up your taps in the tap config panel by hitting "My tap config" on the left. You can set the valve pins even tho you don't have anything hooked up, it just doesn't do anything. You can use '0' for all valves, or use the valve pin values in the screen shot, they should be ok, but *don't* ever use pin 18, it resets the alamode.

If you get up and running, you can disable solenoids and fan support in the personalize page (it can always be turned on later).

To trouble shoot your (non-reading) flow meters: the flowmon service now logs what it has been up to to the file /var/log/rpints.log. This file gets overwritten when the service is restarted (just so it doesn't fill up your sd card over time). This also means that in case of trouble, you'll have to save that file *before* rebooting or restarting the flowmon service, so that we have a chance to see what went wrong.
You can look at this log via:
Code:
more /var/log/rpints.log
if you wanna see it update live in a terminal, use
Code:
tail -f /var/log/rpints.log

Good luck with the install, post any problems into the thread here. For a meaningful problem report, please include the following two files:
* /var/log/apache2/error.log
* /var/log/rpints.log
You can rename those to a .xml extension since the forum software doesn't allow you something with an extension with .log (silly stuff)...
Whatever you do, make sure to have good backups of your current stuff!

Have fun,
-Th

RPints-TapConfig03.png
 
WOOHOO! The wife is out of town this weekend...I know what I'll be doing. Thanks again for all the information and taking the time to explain it to those with less coding/RPI knowledge.
 
I'm working on this right now. Just a clarification. I have to install the arduino software, but I don't actually have to flash anything? I didn't flash anything yet. I entered some beers and kegs, and those worked fine. However, when I go to save taps, nothing saves. Also, when I go to save pin numbers, nothing saves.

I did not do step 9 at all in the original instructions other than plugging a couple meters in. In the software I was able to tell it 5 pins and that worked. It just won't let me save the pin numbers.

Thanks for all the work on this! I'm excited to get it up and running! These upgrades are awesome.
 
I'm working on this right now. Just a clarification. I have to install the arduino software, but I don't actually have to flash anything? I didn't flash anything yet.

Yes, that's correct. This is done automatically when the service starts.

I entered some beers and kegs, and those worked fine. However, when I go to save taps, nothing saves. Also, when I go to save pin numbers, nothing saves.

I did not do step 9 at all in the original instructions other than plugging a couple meters in. In the software I was able to tell it 5 pins and that worked. It just won't let me save the pin numbers.
Please attach or send me /var/log/apache2/error.log. This will tell me what the problem is.
Also, once I figure what's happening, we can probably fix this via phpmyadmin. If you don't have it installed, install via:
sudo apt-get install phpmyadmin

Good luck,
-Th
 
I did not do step 9 at all in the original instructions other than plugging a couple meters in.
You'd still have to do the stuff at the end of step 9, which starts with
Code:
sudo cp flowmon /etc/init.d

Remember, when checking if the service is running, you have to grep now for
'PintDispatch', and not for 'flow_monitor'.
Code:
sudo /etc/init.d/flowmon start
ps aux | grep PintDispatch

Then go ahead and install the service
Code:
sudo update-rc.d flowmon defaults

At this point, you can check the log output to see what's going on
Code:
more /var/log/rpints.log

If you need to restart, stop or start the service, the best way to do this is via the following commands
Code:
sudo service flowmon stop
sudo service flowmon start
sudo service flowmon restart

Remember, starting or restarting wipes out the /var/log/rpints.log file, so if there is something in there that would help debugging, save that file to some other place before restarting the service.

Cheers,
-Th
 
So I noticed that my printed copies of the instructions for RPints was out of date. That could be the start of my problems. Here is my rpints.log:

Traceback (most recent call last):
File "/var/www/python/PintDispatch.py", line 463, in <module>
dispatch = PintDispatch()
File "/var/www/python/PintDispatch.py", line 104, in __init__
self.updateValvePins()
File "/var/www/python/PintDispatch.py", line 415, in updateValvePins
taps = self.getTapConfig()
File "/var/www/python/PintDispatch.py", line 141, in getTapConfig
cursor.execute("SELECT tapNumber,flowPin,valvePin,valveOn FROM tapconfig ORDER BY tapNumber")
File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
self.errorhandler(self, exc, value)
File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.ProgrammingError: (1146, "Table 'raspberrypints.tapconfig' doesn't exist")

Obviously I have an issue with my tables. I am going to go back and make sure all the rest of the steps are up to date in my install instructions.
 
I'm gonna try to get this going over the weekend. Are you using the instructions from the Raspberry Pints website?

It was a bug on my part that created the problem. It's fixed now on github, and I sent 2kegger a mail with a fix it for his install.

It's basically the original instructions from the web site, substituting the zip file download, adding the pyWebSocket install, and then skipping over the steps that happen in the arduino IDE program. I guess if we could come up with a new set of instructions along the ways, I'll post it to the github wiki to help others out.

Cheers,
-Th
 
I guess if we could come up with a new set of instructions along the ways, I'll post it to the github wiki to help others out.

Cheers,
-Th

I plan on keeping good notes as I go through the install procedure and will post the entire procedure one step at a time after I get everything up and running.
 
About the auto hex uploading stuff. Will it break if it can't program the arduino? I use BT to communicate with an arduino nano inside the fridge. Once I have everything uploaded over usb I can power the nano directly and it connects and sends pour data flawlessly. But the only downside is that I cannot program over this connection. I want to add your updates but I don't know how upset the whole thing will get of it can't program everytime the rpi starts up. Maybe a way to disable the auto uploading?
 
About the auto hex uploading stuff. Will it break if it can't program the arduino? I use BT to communicate with an arduino nano inside the fridge. Once I have everything uploaded over usb I can power the nano directly and it connects and sends pour data flawlessly. But the only downside is that I cannot program over this connection. I want to add your updates but I don't know how upset the whole thing will get of it can't program everytime the rpi starts up. Maybe a way to disable the auto uploading?

Yes, as it currently stands, the flowmon service will still move on, even if the upload fails. So, it should take care of your scenario if the Alamode isn't connected to the serial port on the Pi.
I'm going to make this a bit more robust, and skip the upload/flashing altogether if the hex file is not present in the arduino/raspberrypints directory. This way, you could just remove that hex file, and it will never attempt to upload/flash the alamode. I'll probably add that later tonite.

I should also probably make the serial port that the RPi uses to talk to the Alamode a configurable option. Let me think about that (right now, you'll have to change a line of code in FlowMon.py).

Cheers,
-Th
 
Hi I'm new to the raspberry pints.It. I'm having a problem with step 9 installing flow meters. I followed all the instructions on the raspberry pints website. when I try to type sudo cp flowmon /etc/init.d I get no such file or directory. please help its driving me nuts lol thank you.
 
About the auto hex uploading stuff. Will it break if it can't program the arduino? I use BT to communicate with an arduino nano inside the fridge. Once I have everything uploaded over usb I can power the nano directly and it connects and sends pour data flawlessly. But the only downside is that I cannot program over this connection. I want to add your updates but I don't know how upset the whole thing will get of it can't program everytime the rpi starts up. Maybe a way to disable the auto uploading?

Oh, one other thing that you're gonna run into some trouble with on your setup: I use the Alamode reset line (pin 18) to kick the alamode into listening mode to upload the config parameters. Now, in your setup, since your nano is not connected, it cannot do that, and the flowmon service, after a reconfiguration of your taps, will now sit there and wait for your nano to wake up (which it never does, since it's not connected to the reset line). You'll have to reset your nano manually, whenever a new configuration is uploaded (basically when you remove taps, when you save a taps config, or change the alamode parameters). You can check whats going on via:
Code:
tail -f /var/log/rpints.log
Maybe I find a way to issue that reset over the serial connection, but this means some trickery in the arduino code...

-Th
 
Back
Top