Quantcast

[Initial Release] RaspberryPints - Digital Taplist Solution

HomeBrewTalk.com - Beer, Wine, Mead, & Cider Brewing Discussion Community.

Help Support Homebrew Talk:

kerber

Well-Known Member
Joined
Aug 7, 2011
Messages
178
Reaction score
19
Location
Fargo
If and when you get that working, you have to share!

Would this work?...
I'm working on something that uses one of these for my kegerator, but there is no one-size-fits-all fix for a monitor. You could use a motion detector with an AC outlet to provide power to the monitor when motion is detected. The problem is that most monitors don't just turn on when you give them power. Any other solution would either have to be specialized for a specific monitor somehow capable of external control - OR - a hack to trigger the power button when motion is sensed.

Either way would be largely involved and not easy to reproduce.
 

DanH

Well-Known Member
Joined
Jun 11, 2012
Messages
1,020
Reaction score
83
I'm working on something that uses one of these for my kegerator, but there is no one-size-fits-all fix for a monitor. You could use a motion detector with an AC outlet to provide power to the monitor when motion is detected. The problem is that most monitors don't just turn on when you give them power. Any other solution would either have to be specialized for a specific monitor somehow capable of external control - OR - a hack to trigger the power button when motion is sensed.

Either way would be largely involved and not easy to reproduce.
I figure the sensor wires into the RPi and you program the screen to blank after an hour but then wake up when someone walks near. It's beyond me though.


Sent from my iPhone using Home Brew
 

day_trippr

"Now brewing exclusively with Hydrohydroxic Acid"
Joined
May 31, 2011
Messages
35,076
Reaction score
16,928
Location
Stow, MA
Good find, DanH! Ordered a two pack of them from eBay for $3.75 delivered (in a couple of weeks).

Not only are those PIR sensors cheap, they can be implemented as an interrupt source via a GPIO pin, meaning the RPi isn't tied up polling the sensor output. I've already located various Python code examples supporting the sensor, and a couple of potential ways to wake a sleeping screen.

If this works it's surely a lot cheaper/easier/requiring less RPi resources than using an optical sensor (read: webcam) just to wake a console.

I'll have plenty of time to do some more looking around while the sensors are on their cruise...

Cheers!
 

DanH

Well-Known Member
Joined
Jun 11, 2012
Messages
1,020
Reaction score
83
^^Sweet! This thing just keeps getting better.


Sent from my iPhone using Home Brew
 

mcangeli

Well-Known Member
Joined
Dec 26, 2012
Messages
374
Reaction score
58
Thanks to all the developers that put this out there. You guys are awesome. I got this loaded on a linux server. I managed to get my swiss flow sensor on my arduino talking to linux via python and populating the mysql table. You guys did 99 % of the lifting and made it easy for me to figure out how to write to your mysql table you already set up. I updated the index.php to show oz served and oz and gallons left in the keg. Can't wait till you come out with 2.0. Keep up the good work. Let me know if you are ever in the metro detroit area and I owe you guys a case of beer.
I'm curious to know how you got the flow meters updating the keg levels.

I have them dumping data to a table in the db at the moment, but I know Kerber and Jayunt are in the process of working out some table changes that would make it easier to update the information so the work I've done will be pointless anyways.

(But I'd still love to see the code you came up with).
 

mcangeli

Well-Known Member
Joined
Dec 26, 2012
Messages
374
Reaction score
58
I've got things almost where I want them as far as the hardware and site go. I cannibalized an old laptop and found a board on ebay that will allow me to hook it up via hdmi. Made some tweaks to the site to make it fit on a 1280x720 screen.

Also have the untappd brewery feed, beer img and rating incorporated to it.

If anyone is interested let me know and I'll post the code to git.

20140315_171846.jpg


20140319_121032.jpg


20140319_121040.jpg
 

beinert

Well-Known Member
Joined
Nov 23, 2012
Messages
67
Reaction score
5
Location
Vancouver
I'm curious to know how you got the flow meters updating the keg levels.

I have them dumping data to a table in the db at the moment, but I know Kerber and Jayunt are in the process of working out some table changes that would make it easier to update the information so the work I've done will be pointless anyways.

(But I'd still love to see the code you came up with).
I'd like to see it too. :mug:
 

glacious

Well-Known Member
Joined
Jun 8, 2013
Messages
75
Reaction score
21
Just wanted to post a slightly updated couple of pics of the amazing tap setup you've helped create.

Sent from my SCH-I545 using Home Brew mobile app
Very cool looking... and even more importantly: Perfect use-case for the "On Deck" feature!

Maybe have 3 different settings per beverage (displayed in this order)

- Current Beverages per tap
- Next-Up / on-deck
- Past beverages (kegs kicked)
 

Adeering

Well-Known Member
Joined
Jan 25, 2012
Messages
662
Reaction score
48
Location
Sherwood
I'm out of town for the weekend. I will see if I can post something tomorrow. I will have to remote in and get the python file
Sweet, would be very interested in this also, already have the Alamode soldered and plugged in to my RPi, and flow meters are just sitting waiting to be installed so even if it changes with the release of V2, something temporary would be nice.
 
OP
thadius856

thadius856

Well-Known Member
Lifetime Supporter
Joined
Dec 17, 2012
Messages
2,265
Reaction score
798
Location
Marysville
Lots of good progress going on here, I see.

This is my first weekend of moderate "freedom" from the course I'm taking in the last 5 weeks.

However, the wife wants half of it (don't blame her), and I could really use some spin-down time.

Hope to be back working with the rest of the guys in a week or two.
 

rockytoptim

Supporting Member
HBT Supporter
Joined
May 2, 2009
Messages
766
Reaction score
95
Location
Livonia, MI
Here is the pyhton code that reads the serial data from the Arduino.

I'm no coder just a hack so please forgive my code form as this isn't cleaned up. Some of the includes are not necessary but I copied this from another project I have and was to lazy to remove the un-needed ones.

Let me know if you have any questions.



Python Code:
Code:
#!/usr/bin/env python
# coding: utf-8
import MySQLdb
import sys
import serial
import time
from datetime import datetime
import string
import csv
from urllib2 import *





ser = serial.Serial('/dev/ttyACM0', 57600)
con = MySQLdb.connect('localhost', 'Put User Here','Password Here', 'raspberrypints')



while 1:
	value = ser.readline();
	TapID, TapPoured = value.split(",")
	print value
	datenow = datetime.strftime(datetime.now(), "%Y-%m-%d %H:%M:%S")
	#timenow = datetime.strftime(datetime.now(), "%H:%M:%S")
	#now = time.mktime(time.localtime())
	try:	
		with con: 
			cur = con.cursor()
			cur.execute("""INSERT INTO `pours`(`tapId`, `amountPoured`, `modifiedDate`) VALUES (%s,%s,%s)""", (TapID, TapPoured, datenow))
			con.commit()
			print "MySQL updated"
	except MySQLdb.Error as e:
		print "Cannot connect to MySQL database to write pour data"
 

day_trippr

"Now brewing exclusively with Hydrohydroxic Acid"
Joined
May 31, 2011
Messages
35,076
Reaction score
16,928
Location
Stow, MA
After days of looking for a practical solution I finally figured out a way to have a "reactive kiosk" display mode for the taplist - that would blank the screen when nobody was around the keezer but wake the display up to the taplist when someone comes within range.

The "screensaver" built in to the RPi Debian/LXDE environment is one utterly recalcitrant bitch that best as I can tell is unresponsive to any user-level stimulus (sounds like someone's ex wife ;) ) so I finally gave up on poking at that and installed xscreensaver - which does provide a way for external user-level input to change state.

As proof of concept, right now my RPi's console is displaying my taplist in full-screen mode with xscreensaver kicking in after two minutes of idle time. Meanwhile a cron job on a five minute cycle is running a simple python script that sends xscreensaver a simulated keyboard event - which wakes xscreensaver back to the taplist display.

It's kinda cool catching the transitions as the two processes play ping-pong. Of course, the taplist web server and the temperature tracker are completely oblivious to all this and just keep doing their things.

Once I get my hands on those PIR sensors the rest should be a piece of cake.

Still elusive is a low-power "sleep" mode for DVI monitors. I'm pretty sure this has its roots in the actual display driver and is probably insurmountable. The burn-in avoidance I'm working on may be about all that can be accomplished...

Cheers!
 

DanH

Well-Known Member
Joined
Jun 11, 2012
Messages
1,020
Reaction score
83
After days of looking for a practical solution I finally figured out a way to have a "reactive kiosk" display mode for the taplist - that would blank the screen when nobody was around...
Sweet! I am seriously looking forward to stealing your work to use it on my own. You are awesome!
 

day_trippr

"Now brewing exclusively with Hydrohydroxic Acid"
Joined
May 31, 2011
Messages
35,076
Reaction score
16,928
Location
Stow, MA
Sweet! I am seriously looking forward to stealing your work to use it on my own. You are awesome!
Nah, the Internet is awesome, I'm just an old tech bozo who's too stubborn to take "Can't be done" for an answer ;)

PIRs shipped from China on Friday, agent's email says expect them between the 7th and the 23rd. I'm going to have to find something else to keep me busy for awhile...

Cheers!
 

kerber

Well-Known Member
Joined
Aug 7, 2011
Messages
178
Reaction score
19
Location
Fargo
After days of looking for a practical solution I finally figured out a way to have a "reactive kiosk" display mode for the taplist - that would blank the screen when nobody was around the keezer but wake the display up to the taplist when someone comes within range.

The "screensaver" built in to the RPi Debian/LXDE environment is one utterly recalcitrant bitch that best as I can tell is unresponsive to any user-level stimulus (sounds like someone's ex wife ;) ) so I finally gave up on poking at that and installed xscreensaver - which does provide a way for external user-level input to change state.

As proof of concept, right now my RPi's console is displaying my taplist in full-screen mode with xscreensaver kicking in after two minutes of idle time. Meanwhile a cron job on a five minute cycle is running a simple python script that sends xscreensaver a simulated keyboard event - which wakes xscreensaver back to the taplist display.

It's kinda cool catching the transitions as the two processes play ping-pong. Of course, the taplist web server and the temperature tracker are completely oblivious to all this and just keep doing their things.

Once I get my hands on those PIR sensors the rest should be a piece of cake.

Still elusive is a low-power "sleep" mode for DVI monitors. I'm pretty sure this has its roots in the actual display driver and is probably insurmountable. The burn-in avoidance I'm working on may be about all that can be accomplished...

Cheers!
Ahh! That makes much more sense! I had thought you were trying to turn the monitor OFF when not in use! Having the screen saver start up and having a motion sensor kill it is totally reasonable!

Let me know if you want any help getting it running with the PIR sensor. I've got a couple around home and I'd be all to happy to lend a hand.
 

day_trippr

"Now brewing exclusively with Hydrohydroxic Acid"
Joined
May 31, 2011
Messages
35,076
Reaction score
16,928
Location
Stow, MA
Ahh! That makes much more sense! I had thought you were trying to turn the monitor OFF when not in use! Having the screen saver start up and having a motion sensor kill it is totally reasonable!
Validation! One takes it whenever it's offered ;)

Let me know if you want any help getting it running with the PIR sensor. I've got a couple around home and I'd be all to happy to lend a hand.
Thanks for the offer! When DanH suggested the PIR I dug around and they look stupid simple to implement (hopefully I'm not setting myself up here ;) ) I came across a Python code fragment implementing essentially an interrupt service routine to react to the PIR output, and if that works as described the PIR should not tie the RPi up with polling/spinning between events. I saved the key links and tonight will go back through and gather up the chunks I need, then see if I can throw together a proof - I'm sure I can simulate a PIR event through a GPIO pin just fine.

I surely don't want to slow down your R2.0 efforts, I'm keen on the flow sensors and any other goodies that show up. If I get stuck I'll send up a flare! :)

Cheers!
 

ratsathome

Well-Known Member
Joined
May 20, 2012
Messages
109
Reaction score
11
Location
Meath
A question for the "coders".
I want to change the imperial settings to metric.(oz-g,gal-l and srm-ebc etc)
Is their an easy way or do I need to go through all the coding and change it one by one?
Thanks for all your hard work

rpint.jpg
 

abeasst

Well-Known Member
Joined
Dec 17, 2013
Messages
381
Reaction score
28
Location
Raleigh
This project is really starting to take off. I can't wait to see what 2.0 has.
 

kerber

Well-Known Member
Joined
Aug 7, 2011
Messages
178
Reaction score
19
Location
Fargo
Thanks for the offer! When DanH suggested the PIR I dug around and they look stupid simple to implement (hopefully I'm not setting myself up here ;) ) I came across a Python code fragment implementing essentially an interrupt service routine to react to the PIR output, and if that works as described the PIR should not tie the RPi up with polling/spinning between events. I saved the key links and tonight will go back through and gather up the chunks I need, then see if I can throw together a proof - I'm sure I can simulate a PIR event through a GPIO pin just fine.
Your research is spot on. The way most of them run is just by flipping a data line on when motion is detected, and off otherwise. The only issue is making sure that you're doing voltage level conversion if the PIR data line is 5v. Make sure to give the GPIO pins 3v3 or else you're going to have a very bad day. That doesn't increase the complexity a whole lot, but is essential.

Since it's just GPIO on/off, you're right - it would be really easy to mock up. I'd just enable the internal pull-up on the GPIO pin and short it with ground to get your pin high/low.
 

DrunkleJon

Objects in mirror are closer than they appear
Lifetime Supporter
Joined
Jan 18, 2011
Messages
8,191
Reaction score
2,567
Location
Alexandria
A question for the "coders".
I want to change the imperial settings to metric.(oz-g,gal-l and srm-ebc etc)
Is their an easy way or do I need to go through all the coding and change it one by one?
Thanks for all your hard work
Only slightly OT, but that ship background looks great.

No real answer to your question though.
 

boss13

Well-Known Member
Joined
Aug 18, 2011
Messages
45
Reaction score
0
Location
Minneapolis
I keep checking here like every day hoping for v. 2 to hit as well.

Any chance we could get a preliminary list of flow meters and other hardware that we might need when V 2 comes out? Or at least an idea how much will it cost to upgrade to V2 with flow meters? Thanks
 
Joined
Jan 12, 2014
Messages
13
Reaction score
3
Location
Birmingham
I keep checking here like every day hoping for v. 2 to hit as well.

Any chance we could get a preliminary list of flow meters and other hardware that we might need when V 2 comes out? Or at least an idea how much will it cost to upgrade to V2 with flow meters? Thanks
I'm interested in this as well
 

abeasst

Well-Known Member
Joined
Dec 17, 2013
Messages
381
Reaction score
28
Location
Raleigh
I wanna say that they just got the flow meters last week so might still be a little while.
 

kerber

Well-Known Member
Joined
Aug 7, 2011
Messages
178
Reaction score
19
Location
Fargo
I keep checking here like every day hoping for v. 2 to hit as well.

Any chance we could get a preliminary list of flow meters and other hardware that we might need when V 2 comes out? Or at least an idea how much will it cost to upgrade to V2 with flow meters? Thanks
V2 is under way, but the release date is still too far off for any official announcement. Right now our dev team is pretty small and we're all just working on it when we've got free time. It would be impossible to estimate at this point. That said, we're making good progress. We're currently working on moving the current site over to a new php MVC framework. Next will be adding in flow meter support.

Right now, the hardware is a moving target. The big problem is that there are so many different routes we could take for different setups, but each would require time to dev/implement/test. If someone only wants to monitor 3 kegs, they could probably do it with the Raspberry Pi and flow sensors alone. If someone wants more kegs, they would probably need additional hardware, and therefore, cost more. Both of these cases take different hardware and require largely different code to interface with RPints.

We don't have the time/resources to implement every solution, so we're looking for the optimal case. No matter what we do, some people are going to complain about it costing too much or about it not supporting enough hardware.

I could give you a list of the hardware that we're developing and testing with, but there's absolutely no guarantee that would be the hardware that V2 uses.
 

DrunkleJon

Objects in mirror are closer than they appear
Lifetime Supporter
Joined
Jan 18, 2011
Messages
8,191
Reaction score
2,567
Location
Alexandria
V2 is under way, but the release date is still too far off for any official announcement. Right now our dev team is pretty small and we're all just working on it when we've got free time. It would be impossible to estimate at this point. That said, we're making good progress. We're currently working on moving the current site over to a new php MVC framework. Next will be adding in flow meter support.

Right now, the hardware is a moving target. The big problem is that there are so many different routes we could take for different setups, but each would require time to dev/implement/test. If someone only wants to monitor 3 kegs, they could probably do it with the Raspberry Pi and flow sensors alone. If someone wants more kegs, they would probably need additional hardware, and therefore, cost more. Both of these cases take different hardware and require largely different code to interface with RPints.

We don't have the time/resources to implement every solution, so we're looking for the optimal case. No matter what we do, some people are going to complain about it costing too much or about it not supporting enough hardware.

I could give you a list of the hardware that we're developing and testing with, but there's absolutely no guarantee that would be the hardware that V2 uses.
I agree with Kerber. It is best to hold off a bit until they are announcing final testing and give another countdown like they did with V. 1. The feeler thread had some people who were angry for having bought flowmeters and such when they were mentioned as a possible solution. Contribute if you can, but otherwise I would definitely hold off on ordering or even considering ordering parts.
 

day_trippr

"Now brewing exclusively with Hydrohydroxic Acid"
Joined
May 31, 2011
Messages
35,076
Reaction score
16,928
Location
Stow, MA
[...]We don't have the time/resources to implement every solution, so we're looking for the optimal case.
The answer is "42".

No - wait, that's insane. The actual answer is "9".

No matter what we do, some people are going to complain about it costing too much or about it not supporting enough hardware.[...]
Aside from the choice of flow sensors, I would have a hard time listening to anyone bitching about the active platform costs - even if we have to strap an Arduino and a shield or two to the RPi to get 'er done. This is "toy" money, fer chrissakes...

Cheers! ;)
 

Arglesnaf

Active Member
Joined
Dec 30, 2013
Messages
31
Reaction score
8
Location
Cleveland
True enough.

I have one internal LAN port exposed to the outside world, tunneled through two layers of NAT. It lands on my wee RPi's html port. As the RPi has no access privs to any other LAN node, and has no information I'd deem a security risk, if bad guys want to have at that poor little thing, they're welcome to take their best shot...

Cheers!
I off ported my Pi due to similar paranoia. I haven't bothered to look into hardening the web service on this but I really want to so I can have an easily accessible URL. Maybe in the future.

I tweaked the CSS a bit to get a sans serif font, but the method sucks since it is loading it from google. I don't know enough to get the font to pull locally if available, though it is loaded. It looks nice now that I have all 5 taps on =)

RPints.jpg
 

BadNewsBrewery

Well-Known Member
Joined
Oct 22, 2012
Messages
1,260
Reaction score
147
Location
Annandale
On the discussion of turning your monitor on / off - why not use something like this? Would that not turn on / off the monitor? You would leave the Pi running the whole time, and once the monitor is powered back on it should switch right to the screen... Of course, most of this entire thread is over my head so if I'm missing the point here - sorry.
-Kevin
 
Last edited by a moderator:

DrunkleJon

Objects in mirror are closer than they appear
Lifetime Supporter
Joined
Jan 18, 2011
Messages
8,191
Reaction score
2,567
Location
Alexandria
On the discussion of turning your monitor on / off - why not use something like this? Would that not turn on / off the monitor? You would leave the Pi running the whole time, and once the monitor is powered back on it should switch right to the screen... Of course, most of this entire thread is over my head so if I'm missing the point here - sorry.
-Kevin
That could work. You would want to be sure that your monitor doesnt start up in the off mode when powered down and back up. Additionally some monitors really do not like to have AC power interrupted and restarted. Working in IT we have several monitors (cheapies yeah, but still) that always seem to require replacement or at the very least a change of diaper after a power outage.
 
Last edited by a moderator:

day_trippr

"Now brewing exclusively with Hydrohydroxic Acid"
Joined
May 31, 2011
Messages
35,076
Reaction score
16,928
Location
Stow, MA
On the discussion of turning your monitor on / off - why not use something like this? [...]
In my specific case, the LCD monitor powers up in the "off" state, so an external switch wouldn't work.

Besides, even if it would work, $17 plus shipping versus an under-$2 sensor added to the RPi I already have running the Tap List monitor, plus a bit more coding, would make this a no-brainer for me, never mind the fun factor of making this all work...

Cheers! :)
 

day_trippr

"Now brewing exclusively with Hydrohydroxic Acid"
Joined
May 31, 2011
Messages
35,076
Reaction score
16,928
Location
Stow, MA
As I expected, the code that will allow a PIR to send a "wake up" command to xscreensaver was dead simple to put together.

I'll definitely be verifying this with a DVM once I have one in hand - and before hooking one up to my RPi - but the "specs" for the PIRs say they provide a Low-High transition when motion is detected, using a TTL 0-3.3V output. If it turns out to be more like "0-VCC", I'll add a voltage divider to bring "VCC" down to a max of 3V, as I'll likely be running the PIR from the 5V rail.

For now I'm assuming the information is correct, and I should expect to see a 0 to "high" transition when the PIR detects motion.

So for my proof I used GPIO.setup to configure pin 26 for GPIO7 as an input with a pull up and attached a rising edge triggered callback to it. Then I jumpered in an NC pushbutton switch between pin 26 and GND.

With xscreensaver running and this piece of python executing in an x window, when I press the pushbutton switch it snaps the RPi right back to the desktop - or the full-windowed Tap List.

Once the PIRs show up and I verify them with this set up, I'll add the script to the system startup list so it'll just happen.

Piece o' cake.

I could see someone using this to not only wake up their display, but to turn on their keezer lighting, when someone approaches. Easy enough to plumb a GPIO as an output to control a relay driver and turn it on and off with the same code.

Aaaanyway...what to do next while waiting for the mailman...

Cheers!
 

DanH

Well-Known Member
Joined
Jun 11, 2012
Messages
1,020
Reaction score
83
^^so awesome. I'll be needing more step by step instructions when it's done... (Please!!)


Sent from my iPhone using Home Brew
 

day_trippr

"Now brewing exclusively with Hydrohydroxic Acid"
Joined
May 31, 2011
Messages
35,076
Reaction score
16,928
Location
Stow, MA
No problem, soon as I have this running with the actual PIR I'll write it all up.

I want to see how the real device behaves, particularly when someone is near the sensor for awhile. If it continuously fires edges due to movement then this thing is pretty much done, but if after the initial "movement detected" event it continues to hold its output high while a person is near, there might be some tweaking needed to keep the screen saver from kicking in - although the easy fall-back will be to just tune the screen saver delay to something that would cover most keezer visits.

My wee RPi is sprouting wires like a hop plant sprouts bines, and there's not a flow sensor in sight yet. I can see the need to cobble up a breakout board in the not too distant future...

Cheers!
 

mcangeli

Well-Known Member
Joined
Dec 26, 2012
Messages
374
Reaction score
58
Here is the pyhton code that reads the serial data from the Arduino.

I'm no coder just a hack so please forgive my code form as this isn't cleaned up. Some of the includes are not necessary but I copied this from another project I have and was to lazy to remove the un-needed ones.

Let me know if you have any questions.



Python Code:
Code:
#!/usr/bin/env python
# coding: utf-8
import MySQLdb
import sys
import serial
import time
from datetime import datetime
import string
import csv
from urllib2 import *





ser = serial.Serial('/dev/ttyACM0', 57600)
con = MySQLdb.connect('localhost', 'Put User Here','Password Here', 'raspberrypints')



while 1:
	value = ser.readline();
	TapID, TapPoured = value.split(",")
	print value
	datenow = datetime.strftime(datetime.now(), "%Y-%m-%d %H:%M:%S")
	#timenow = datetime.strftime(datetime.now(), "%H:%M:%S")
	#now = time.mktime(time.localtime())
	try:	
		with con: 
			cur = con.cursor()
			cur.execute("""INSERT INTO `pours`(`tapId`, `amountPoured`, `modifiedDate`) VALUES (%s,%s,%s)""", (TapID, TapPoured, datenow))
			con.commit()
			print "MySQL updated"
	except MySQLdb.Error as e:
		print "Cannot connect to MySQL database to write pour data"

Ok. That's similar to how I've got it working at the moment.

There have been some major db changes for the next version. I've got the python script pushing the pin and pulse count to a php script that then updates the pours table and posts to my untappd feed for me.
 

mcangeli

Well-Known Member
Joined
Dec 26, 2012
Messages
374
Reaction score
58
A question for the "coders".
I want to change the imperial settings to metric.(oz-g,gal-l and srm-ebc etc)
Is their an easy way or do I need to go through all the coding and change it one by one?
Thanks for all your hard work
I don't know if anyone answered it but the next version will have the metric system and the ability to choose between the two.
 
Top