[Initial 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.
For those using my motion sensor script with their R'Pints tap list display who might be interested in having the 'Pi play an audio track when the screen wakes up, it doesn't take much to do.

Basically install/update the sound drivers, install an mp3 player, add a couple of lines to the python script that runs the motion sensor, plug in a speaker and you're done.


First, install the alsa audio drivers and MP3 Player:

$ sudo apt-get install alsa-utils
$ sudo apt-get install mpg321


Reboot the system

Set the system to load the sound drivers on startup, configured for the 3.5mm jack output:

$ sudo modprobe snd_bcm2835
$ sudo amixer cset numid=3 1


Plug a cheap speaker into the audio jack. I dug up a pair of ancient Labtec peecee speakers (with the original wall wart!) and they work just peachy.


Note: for those using an HDMI display with integrated sound, use this amixer setting instead to send sound through the HDMI port:

$ sudo amixer cset numid=3 2


Now you can play an mp3 file using mpg321 to verify the sound is working.

$ mpg321 filename.mp3



To have the motion sensor script play sound when triggered, edit pir_run.py (should be in /home/pi) and add the two bolded lines, noting you want to provide the file name of your intended mp3 file (put it in /home/pi and all you need to change is the 'filename' string).

[And don't try to copy the code in its entirety from this, the formatting is fubar and you'll just get python parsing errors up the wazoo. Do the edits!]


$ sudo nano pir_run.py

#!/usr/bin/env python

import os
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)

cmd = 'xscreensaver-command -deactivate'
playsound = 'mpg321 /home/pi/filename.mp3'

PIR_PIN = 7
GPIO.setup(PIR_PIN, GPIO.IN)

def MOTION(PIR_PIN):
os.system(cmd)
os.system(playsound)

try:
GPIO.add_event_detect(PIR_PIN, GPIO.RISING, callback=MOTION)
while 1:
time.sleep(100)

except KeyboardInterrupt:
GPIO.cleanup()

GPIO.cleanup()


Save the file (ctrl-o ctrl-x) and you should be good to go...

Cheers!
 
Does RPints have it's own forum somewhere? Seems to me that having threads with specific topics that people can refer to would be far better than a single long running thread that covers from initial release to who knows what and everything else in between. Just makes it slightly difficult to have to search a single thread for a specific issue/resolution. :)
 
Does RPints have it's own forum somewhere? Seems to me that having threads with specific topics that people can refer to would be far better than a single long running thread that covers from initial release to who knows what and everything else in between. Just makes it slightly difficult to have to search a single thread for a specific issue/resolution. :)

Each release has its own thread https://www.homebrewtalk.com/f51/version-2-release-raspberrypints-digital-taplist-solution-487694/ is the new thread and has a link on every thread on RaspberryPints. We dont have a forum yet for users but that is a good idea. We will look into it.
 
I just installed a new wireless router and have to change IP address on Pints/Pi, and now I'm trying to get to the desktop on my RaspberryPi and get out of the Chromium so I can open LXTerminal and WIFI setup.

Can anyone tell me how to do this? If I can get out of RaspberryPints, I'll be fine.
 
Yes...I just bought a NEW wireless router and the IP address are .0.XXX and the old one was .1.XXX, so I need to go to my Pi and change the IP addresses.

However, I can't get out of Pints to the desktop. Will try Alt-F11.

Thanks.
 
Alt-F4 is close program, just like in Winders. F-11 usually is the toggle from full screen to windowed mode (works in both as well). Sometimes you have to alt-F11 for it to work. I think alt tab will work to switch programs on the pi as well, and I know that the windows key (most keyboards have that or the apple key) will work to bring up the pi equivalent to the start menu.

Hope this helps.
 
Love my Raspberry Pints setup, however I was wondering if anyone knew how to insert text or a header say after tap #4?
I have 2 keezers and wanted to differentiate them by inserting text that says something like "Garage Keezer" say after tap #4.
Would this be an easy thing to do? I'm pretty comfortable editing html and css, but havn't been able to find the place to make this change.
Thanks!
 
Love my Raspberry Pints setup, however I was wondering if anyone knew how to insert text or a header say after tap #4?
I have 2 keezers and wanted to differentiate them by inserting text that says something like "Garage Keezer" say after tap #4.
Would this be an easy thing to do? I'm pretty comfortable editing html and css, but havn't been able to find the place to make this change.
Thanks!

The only suggestion I have is to set up tap #5's name as "Garage Keezer" instead of Nothing on Tap. Then continue with your other Keezers beers after that.

I've made a copy of my RPints html and have been trying to modify the html look with a html editor. I'm wanting to add in beer labels in front of the beer name and have had minor success.

p.s. I'm just learning html.
 
Love my Raspberry Pints setup, however I was wondering if anyone knew how to insert text or a header say after tap #4?
I have 2 keezers and wanted to differentiate them by inserting text that says something like "Garage Keezer" say after tap #4.
Would this be an easy thing to do? I'm pretty comfortable editing html and css, but havn't been able to find the place to make this change.
Thanks!

You need to edit the index.php file. Currently, the drawing of the tap data is handled by a loop that goes from tap #1 to the total number of taps you have. I modified mine so it was setup in two columns for a landscape view and to give me taps 1-4 in the first column and 5-8 in the second column. A setup similar to this might be good for you if you wanted to give custom headers for each set of taps.

Here's a link to the mods I made: http://www.surfcitybrewing.com/download/rpi-jonw-mods.zip
Note that I use pool ball images for the tap numbers as I have pool ball tap handles, and those images are not included here.

beerboard1.jpg
 
Excellent!!! I'm going to switch my display back to horizontal like you have it Jon. That'll work great to separate my 2 keezers.
Thanks for sharing your code too.
 
I would like to use a separate image for each tap. How tough was it to change the default images?

It's a pretty easy change to make.

The original code line just wrote the tap number:
Code:
     <span class="tapcircle"><?php echo $i; ?></span>

I added extra code as an image tag to use the tap number plus additional characters to make up the file names (e.g. 1-Ball.png, 2-Ball.png, etc):
Code:
<img src="img/<?php echo $i; ?>-Ball.png" alt="">
 
i added extra code as an image tag to use the tap number plus additional characters to make up the file names (e.g. 1-Ball.png, 2-Ball.png, etc):

Code:
<img src="img/<?php echo $i; ?>-Ball.png" alt="">


Thank you for sharing this as well as the rest of your code. Your display looks great.


Sent from my iPad using Home Brew
 
Any thoughts or ideas on how to get wifi back up and running. I get different messages.
One is "Association request to the driver failed".
I have also gotten "could not get status from wpa_supplicant".

Been Googling all night and day.
 
Not sure what was going on there. I ended up taking all of the hardware to work and tried to get things hooked up to the wifi at work on Sunday. I could see it was connected, but it would not load the accept terms and conditions page. When I got back home on Monday and hooked everything back up it magically worked.
 
I have day_trippr's PIR and sound worked in now. The only thing is the sound goes off every time the PIR senses motion. It does not wait for the xscreensaver to have the screen go blank before playing the sound. I have the time set for 15 minutes. Every time the PIR senses motion the mp3 file will play. I tested it at one minute and when the sound was done which was less than a minute it would start playing the sound aginan.

I have the following file in /home/pi. I added the following lines where it says to add them.

pir_run.py

#!/usr/bin/env python

import os
import RPi.GPIO as GPIO
import time

cmd = 'xscreensaver-command -deactivate'
playsound = 'mpg321 /home/pi/my_mp3_file.mp3
GPIO.setmode(GPIO.BCM)
PIR_PIN=7
GPIO.setup(PIR_PIN, GPIO.IN)

def MOTION(PIR_PIN):
os.system(cmd)
os.system(playsound)
time.sleep(1)

time.sleep(2)

try:
GPIO.add_event_detect(PIR_PIN, GPIO.RISING, callback=MOTION)
while 1:
time.sleep(100)

except KeyboardInterrupt:
GPIO.cleanup()
 
Does your PIR have two potentiometers? If it does, one of them sets the duration of a non-interruptable one-shot that prevents the sensor from firing until it expires. I turned that until the sensor wouldn't fire again before the screensaver clicked in.

But you could certainly change that sleep(1) to something much larger and it should do the same thing...

Cheers!
 
Does your PIR have two potentiometers? If it does, one of them sets the duration of a non-interruptable one-shot that prevents the sensor from firing until it expires. I turned that until the sensor wouldn't fire again before the screensaver clicked in.

But you could certainly change that sleep(1) to something much larger and it should do the same thing...

Cheers!

It looks like the one in your picture. I'll adjust both of them. I'll change the sleep to sleep(20) and change the potentiometer too.

Thanks...

p.s. I looked at the PDF file link for the HC SR501 and the time delays are from 0.3 seconds to 5 minutes. I'm going to have to find a shorter mp3 file. The one I have is 36 seconds.
 
It looks like the one in your picture. I'll adjust both of them. I'll change the sleep to sleep(20) and change the potentiometer too.

Thanks...

p.s. I looked at the PDF file link for the HC SR501 and the time delays are from 0.3 seconds to 5 minutes. I'm going to have to find a shorter mp3 file. The one I have is 36 seconds.

Did you ever get this figured out? I am playing with the same thing at the moment, and I was wondering if you ended up adjusting the sleep value.
 
Did you ever get this figured out? I am playing with the same thing at the moment, and I was wondering if you ended up adjusting the sleep value.

With the longest time setting for the PIR being 5 minutes I just set everything at 5 minutes, so the screen will blank at 5 minutes. That way they will both come on at the same time.
 
Greetings. I'm trying Raspberry Pints (V2) for the first time, and I have run into a problem that the previous hundred and fifty pages or the great and powerful google weren't able to solve.

I can't tap a keg.

On initial setup, I loaded the sample data to see how it "should" look. Looks great.

Deleted the sample data: Kicked and deleted all kegs. Deleted all beers except skeeter pee, because, well, it will be on tap again soon. Added fresh kegs, set to clean, and added the first beer. Set the number of taps to 2.

Here is what happens when I try to tap a keg.

  1. Go to "My Kegs" and confirm that the kegs are set to CLEAN
  2. Go to "My Taps" and click on "Tap a Keg"
  3. Select the Beer from the dropdown and the data populates
  4. Select the Keg from the dropdown and the volume populates
  5. Click "Save"
  6. I am returned to the "My Taps" page. No beer information is shown against the tap. No name, no data. "Tap a Keg" is still available for the tap.
  7. Check "My Kegs". The keg I selected is set to SERVING
  8. Check the taplist. It says "Nothing on Tap".
  9. I weep in frustration

I have tried this from Chromium on the Pi, Safari on iOS, and Chrome on Win7 (javascript blocker disabled). Same. I have tried setting the keg to CONDITIONING instead of clean. Same. I have tried a new (third) keg and new (third) tap. Same. Tried the skeeter pee from the sample data instead of the beer. Same.

I get no errors. It. Just. Doesn't. Work.

What am I missing?

Edit - Somehow missed the V2 thread. Found out that I somehow had installed the version with flowmeters and needed to enable them, then put in a 'dummy' pin number. Went with 4 and 5 for each tap. Works solidly now. See https://www.homebrewtalk.com/f51/ve...list-solution-487694/index16.html#post6343392
 
Install xscreensaver from an LXDE terminal:

apt-get install xscreensaver

Cheers!

Mr. Tripper - your work is much appreciated. I was able to set this up the first time and it worked great. I can't believe how much fun a $4 sensor has added to my life. Perhaps that's a comment on an empty life?

Anyway, I had to add "sudo" before the above command in order to get and install the xscreensaver. Without it, the command gave me errors about not being the root user. I'm a Linux idiot, so it took me a few tries to figure out what was going on. I added sudo before and everything was smooth sailing from there. Is that an edit for your instructable for other dolts who follow, or is that by design and I had a problem with my directory rights, etc.?

Thanks again for your work.
 
Mr. Tripper - your work is much appreciated. I was able to set this up the first time and it worked great. I can't believe how much fun a $4 sensor has added to my life. Perhaps that's a comment on an empty life?

Anyway, I had to add "sudo" before the above command in order to get and install the xscreensaver. Without it, the command gave me errors about not being the root user. I'm a Linux idiot, so it took me a few tries to figure out what was going on. I added sudo before and everything was smooth sailing from there. Is that an edit for your instructable for other dolts who follow, or is that by design and I had a problem with my directory rights, etc.?

Thanks again for your work.

Glad you're having fun with it! :mug:

Sorry 'bout the missing 'sudo' but a few months ago that post became "uneditable" by me and I haven't been able to do any tweaking since. One of these days I may clone that sub-thread to its own topic; something to do when the snow flies I guess.

Cheers!
 
Going to go down this path too, along with my now functional BrewPi. I have ordered my flow units and will collect the balance of hardware over this month. I will be building the unit to handle 8 taps on my Keezer (eventually to become an Irish Coffin Keezer). I will start going back through all of the previous threads. I am only currently concerned over the compatability with a RPi B+ that has 4 USB ports. I am concerned over the plug in capability of the AlaMode board.
 
Sorry I just thought of a follow up query. How close to my tap shanks can I mount the flow sensors without increasing the foam output? I currently have 10 feet of 3/16 " beer line, but I do not want the sensors and wiring hanging too far away from the beer shank mount point.
Thanks in advance.
Mike
 
I had them at about 2 feet off. It didn't increase foam too much. I now have them about 2 feet off the keg end and it is better yet. Hope that helps.
 
[...]I am only currently concerned over the compatability with a RPi B+ that has 4 USB ports. I am concerned over the plug in capability of the AlaMode board.

It's probably in the other R'Pints thread, but I posted a picture of an AlaMode atop a B+. It fits fine...

Cheers!
 
Sorry I just thought of a follow up query. How close to my tap shanks can I mount the flow sensors without increasing the foam output? I currently have 10 feet of 3/16 " beer line, but I do not want the sensors and wiring hanging too far away from the beer shank mount point.
Thanks in advance.
Mike

fwiw, I have mine in the middle of 12' runs and sitting atop my kegs (pic below). I'll be doing a major overhaul of my keezer soon and will be replacing the tubing so the meters are within a running foot of the Out posts...

Cheers!

flow_meter_install_08_sm.jpg
 
Back
Top