[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.
By chance see the notes in flow_monitor.py? (in the python folder).

#The following line is for serial over GPIO
port = '/dev/ttyS0'
#The following line is for serial over USB
#port = '/dev/ttyACM0'

# Edit this line to point to where your rpints install is
poursdir = '/var/www' <-- THIS is wrong as a normal install is /var/www/html

Following might provide debugging help
#Uncomment next for lines for debugging
#print "Pour:"
#print " - Addr : "+hex(MCP_ADDR)
#print " - Pin : "+str(MCP_PIN)
#print " - Count: "+str(POUR_COUNT)
#print " - Ounces: "+str(POUR_COUNT / 165)
#print " - Mliters: "+str(MLITERS)

Also comments in the python\flowmon file
# Change the next 3 lines to suit where you install your script and what you want to call it
DIR=/var/www/python <-- once again normal RPints install is /var/www/html so this line is /var/www/html/python
DAEMON=$DIR/flow_monitor.py
DAEMON_NAME=RPFlowMon

# The process ID of the script when it runs is stored here:
PIDFILE=/var/run/$DAEMON_NAME.pid
Excellent, thanks for this. I have some parallel builds going on so will try this on one of them when I get a chance. I ended up downloading an old version of wheezy and managed to get things working and got my code across to the Alamode board. If I move this board to my other pi running Jessie I assume I don't need to reprogram it as it is already on the board?
 
Do you have Raspbian Stretch installed? If not follow https://www.raspberrypi.org/documentation/installation/installing-images/ to install

After that Try running this Script on the pi:
https://raw.githubusercontent.com/rtlindne/RaspberryPints/master/util/installRaspberryPints
simply download it to the pi and run the following commands from Bash
chmod +x installRaspberryPints
sudo ./installRaspberryPints

it will prompt you what you want to install, like flowmeters.

If you have trouble, PM me and I will help you out the best I can


Just an FYI...for some reason, when using your script, I needed to modify /var/www/html/sql/schema.sql on line 567 just before the DB was updated.

something about MarianDB's new code.

`loadCellTareDate` TIMESTAMP DEFAULT NULL,

`loadCellTareDate` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,

It didn't like the NULL part.
 
Last edited:
Correct. The sketch travels with the board...

Cheers!
I thought so, so should be able to get Jessie going now even with my IDE issues a long as I don't add any taps I am good to go, but I could keep the Wheezy SD card in case. Quick question, will blowing gently through my SF800 be sufficient to trigger a pour? Also has anyone thought about additionally controlling solenoid valves in their tap lines? ie a way to keep teens out of my kegs?
 
Just an FYI...for some reason, when using your script, I needed to modify /var/www/html/sql/schema.sql on line 567 just before the DB was updated

It didn't like the NULL part.

Thank you, I do my testing on true MySQL, small syntax things like that don't work in MariaDB.

I will have the fix committed as soon as I can.
 
Quick question, will blowing gently through my SF800 be sufficient to trigger a pour? Also has anyone thought about additionally controlling solenoid valves in their tap lines? ie a way to keep teens out of my kegs?

Someone else laid the ground work for solenoids, and I took that as a good starting point, so far I can control the valves through my admin page. I am working with RFID to unlock them also, though it stops working after a few days.

As for testing the flow sensors, I cant say for the SF800 (as I dont have them) but blowing through mine registered just fine.
 
So...now that I have a working Taplist...I would like to get flow meters working...if I am using RandR+ code on RPi3+, then I think some things are missing/wrong as I can't find /var/www/html/python/flow_monitor.py to allow an UNO board to work instead of AlaMode (too cheap to buy)

There is a /var/www/html/python/FlowMonitor.py , but it's completely different code...any quick fix to get an UNO working?
 
So...now that I have a working Taplist...I would like to get flow meters working...if I am using RandR+ code on RPi3+, then I think some things are missing/wrong as I can't find /var/www/html/python/flow_monitor.py

I think flow_monitor.py was the original name I change to FlowMonitor.py to match other files and yes its heavily modified.

I think what you are looking for is in Config.py in my version. Remove the # infront of this line should enable the USB part to talk to UNO.
#The following line is for serial over USB
config['flowmon.port' ] = '/dev/ttyACM0'
 
@day_trippr, I thought I seen that you use a single image that runs on multiple rpi, can you outline what needs to change on the individual cards to keep them working correctly.

I tried just moving the sd card to a different rpi figuring I might just need to modify the ip address but it seems the raspberrypints and or OS knew the sdcard belonged to a different rpi.
 
I am running the jessi raspberrypints on a 3B rpi and it seem the on-board wifi goes to sleep or stops working. It is a somewhat random thing it has gone as long as 24hrs without it happening but it has also happened a couple time in an hour. The unit is running just not connection to the wifi. I first had a static IP then switched to dynamic and it still happens.

Anyone have this issue?

I created a cron task to check for internet access by pinging the router and reboot the rpi if it fails. I tried just bringing the wifi down and back up again but that did work when it was truly sleeping. It seems to work but it is a bit of a hack, hoping there is a config fix.
 
@day_trippr, I thought I seen that you use a single image that runs on multiple rpi, can you outline what needs to change on the individual cards to keep them working correctly.

I tried just moving the sd card to a different rpi figuring I might just need to modify the ip address but it seems the raspberrypints and or OS knew the sdcard belonged to a different rpi.

Aside from having to change a whole plethora of per-machine parameters almost all unrelated to RaspberryPints I don't have to do anything special to get the tap list displayed. The things that do apply are my tap list customizations that aren't present in the out-of-the-box R'Pints kit.

That said I can find complaints in mysql logs on machines that were cloned that the database and log files aren't in sync. I've read that can probably be fixed by going through a table dump exercise but as it hasn't affected the operation on any of the machines I've ignored it...

Cheers!
 
Aside from having to change a whole plethora of per-machine parameters almost all unrelated to RaspberryPints I don't have to do anything special to get the tap list displayed. The things that do apply are my tap list customizations that aren't present in the out-of-the-box R'Pints kit.

That said I can find complaints in mysql logs on machines that were cloned that the database and log files aren't in sync. I've read that can probably be fixed by going through a table dump exercise but as it hasn't affected the operation on any of the machines I've ignored it...

Cheers!
Thanks for clarifying. I had seen one of your posts that you have the same code running on all of your rpi and wishful thinking on my part expanded that to mean a single sdcard that could be used in any one.


Thanks again for all of the information you provided to this thread.
 
Yeah, I wish. While I've had to sneaker-port cloned SD cards between machines often enough that adjusting the customizations has become almost rote, it'd be nice to have a "master card" that would self-configure to the node.

There might be a way to do it by using the enet MAC to choose between things like node names, static IP addresses, url pointers, etc. That'd work for all but my wee Pi Zero W. But given I'm beating my brains out over a simple Arduino + RTC daytime alarm function that effort is not likely to bubble up to the top of my work queue anytime soon ;)

Cheers!
 
Anyone have a parts list and instructions for adding a motion sensor? I keep finding info on trouble shooting for the sensor, but cant find the initial instructions.

Thanks!
 
I think flow_monitor.py was the original name I change to FlowMonitor.py to match other files and yes its heavily modified.

I think what you are looking for is in Config.py in my version. Remove the # infront of this line should enable the USB part to talk to UNO.
#The following line is for serial over USB
config['flowmon.port' ] = '/dev/ttyACM0'


Thanks for the help...it was quite obvious once you said it.o_O..now...I am trying to assign a "flow pin" and it's saying "Cannot Execute Query"....Any ideas?

I'm wondering if changing the Schema.sql when it first ran maybe broke something. I can't perform a number of different updates.
 
Last edited:
I am running the jessi raspberrypints on a 3B rpi and it seem the on-board wifi goes to sleep or stops working. It is a somewhat random thing it has gone as long as 24hrs without it happening but it has also happened a couple time in an hour. The unit is running just not connection to the wifi. I first had a static IP then switched to dynamic and it still happens.

Anyone have this issue?

I created a cron task to check for internet access by pinging the router and reboot the rpi if it fails. I tried just bringing the wifi down and back up again but that did work when it was truly sleeping. It seems to work but it is a bit of a hack, hoping there is a config fix.
I also have the same problem and Ive gone as far as starting over and have the same results.. Ive found a few posts out there about this and it sounds mainly like some sort of power management issue.. Ive tried disabling power management creating a script that constantly pings my router in the background I've tried changing power supplies I ve tried updating the pi firmware... all of my hardwired ethernet pis work fine and this pi has excellent signal where its at when its responsive. Its just very bizare behavior if i reboot the pi the apache page is accesable but for how long who knows.. strange thing is it shows on my routers active connections table and sometimes i cant get my computer to ssh in via putty but sometimes i can ssh into the problem pi from sshing into another pi on my network and then sshing into the problem pi from that... its very bizare behavior
 
By chance see the notes in flow_monitor.py? (in the python folder).

#The following line is for serial over GPIO
port = '/dev/ttyS0'
#The following line is for serial over USB
#port = '/dev/ttyACM0'

# Edit this line to point to where your rpints install is
poursdir = '/var/www' <-- THIS is wrong as a normal install is /var/www/html

Following might provide debugging help
#Uncomment next for lines for debugging
#print "Pour:"
#print " - Addr : "+hex(MCP_ADDR)
#print " - Pin : "+str(MCP_PIN)
#print " - Count: "+str(POUR_COUNT)
#print " - Ounces: "+str(POUR_COUNT / 165)
#print " - Mliters: "+str(MLITERS)

Also comments in the python\flowmon file
# Change the next 3 lines to suit where you install your script and what you want to call it
DIR=/var/www/python <-- once again normal RPints install is /var/www/html so this line is /var/www/html/python
DAEMON=$DIR/flow_monitor.py
DAEMON_NAME=RPFlowMon

# The process ID of the script when it runs is stored here:
PIDFILE=/var/run/$DAEMON_NAME.pid

Ok tried all these and no luck. In the flow_monitor.py file I also changed 'var/www/includes/pours.php' to include html in the path.

I had this fully working and recording pours using wheezy but cannot get it to work on jessie with identical hardware and sketch already on alamode board.

If I do the following then the following displays in terminal.
cd /var/www/python
python flow_monitor.py

Traceback (most recent call last):
File "flow_monitor.py, line 13, in <module>
arduino = serial.Serial(port,9600,timeout=2)
File "usr/lib/python2.7/dist-packages/serial/serialutil.py", line 261, in __init__
self.open()
File 'usr/lib/python2.7/dist-packages/serial/serialposix.py", line 278, in open
raise SerialException('could not open port %s: %s" % (self._port, msg))
serial.serialutil.SerialException: could not open port /dev/ttySO: [Errno 2] No such file or directory: '/dev/ttySO'
 
I'm going to assume "cd /var/www/python" is a typo as it should be "cd /var/www/html/python" if your R'Pints root has /html/ in the path.

Did you run the jessie-setup file from the Alamode support package? While you don't need that kit to reflash the Alamode, the setup script sets up a persistent relationship between the physical ttyama0 and ttys0.

And don't forget to run the jessie-setup script through dos2unix first...

Cheers!
 
I'm going to assume "cd /var/www/python" is a typo as it should be "cd /var/www/html/python" if your R'Pints root has /html/ in the path.

Did you run the jessie-setup file from the Alamode support package? While you don't need that kit to reflash the Alamode, the setup script sets up a persistent relationship between the physical ttyama0 and ttys0.

And don't forget to run the jessie-setup script through dos2unix first...

Cheers!
Yes a typo sorry, and yes to using the jessie-setup after running the dos2unix on it.
 
I also have the same problem and Ive gone as far as starting over and have the same results.. Ive found a few posts out there about this and it sounds mainly like some sort of power management issue.. Ive tried disabling power management creating a script that constantly pings my router in the background I've tried changing power supplies I ve tried updating the pi firmware... all of my hardwired ethernet pis work fine and this pi has excellent signal where its at when its responsive. Its just very bizare behavior if i reboot the pi the apache page is accesable but for how long who knows.. strange thing is it shows on my routers active connections table and sometimes i cant get my computer to ssh in via putty but sometimes i can ssh into the problem pi from sshing into another pi on my network and then sshing into the problem pi from that... its very bizare behavior
Sorry to hear you have the same or similar problem, but also good to know I am not alone. It is weird you can reach the stuck unit from a second rpi. Mine also shows up on the router but does not respond to a ping. Supposedly some people can wake up the wifi by plugging in a ethernet cable. Plugging in an ethernet cable brings the ethernet port up and accessible but the wifi is still down for me.

I have a second one now so I am letting that one run for a while to see if also does the same thing. If is doesn't I will return the first one. Since I got the second one running the first one has not needed rebooting. If both of my units do the same thing I will try an external usb wifi module to see if that works any better.
 
Sorry to hear you have the same or similar problem, but also good to know I am not alone. It is weird you can reach the stuck unit from a second rpi. Mine also shows up on the router but does not respond to a ping. Supposedly some people can wake up the wifi by plugging in a ethernet cable. Plugging in an ethernet cable brings the ethernet port up and accessible but the wifi is still down for me.

I have a second one now so I am letting that one run for a while to see if also does the same thing. If is doesn't I will return the first one. Since I got the second one running the first one has not needed rebooting. If both of my units do the same thing I will try an external usb wifi module to see if that works any better.
i was going to do an external usb wifi as my next move as i have good luck with one of those on another pi that is in a poor signal spot so it acts as like an external antenna. Good news is tonight on a hunch I took my pi off the keggerator hooked an hdmi tv to my pi and to my surprise lightning bolts on the display meaning low supply power.... i changed to a different micro usb cable and it went away and so far ive stayed connected... fingers crossed i found the culprit as it might have been a bad cable even though i changed to a more powerful 3 amp power supply.
 
I'm going to assume "cd /var/www/python" is a typo as it should be "cd /var/www/html/python" if your R'Pints root has /html/ in the path.

Did you run the jessie-setup file from the Alamode support package? While you don't need that kit to reflash the Alamode, the setup script sets up a persistent relationship between the physical ttyama0 and ttys0.

And don't forget to run the jessie-setup script through dos2unix first...

Cheers!
I am so close with my jessie installation but not quite there.

I fixed my serial port greyed out issue using the following

enable_uart=1

$ sudo systemctl stop [email protected]e
$ sudo systemctl disable [email protected]


$ sudo nano /boot/cmdline.txt

delete "console=serial0,15200"

Now if I go to cd /var/www/html/python
python flow_monitor.py

and then blow in my flow meter and refresh the browser I am recording pours.

My autostart file at /home/pi/.config/lxsession/LXDE-pi/autostart has the last line as @usr/bin/python /var/www/html/python/flow_monitor.py so all looks good there. Any ideas?
 
I am so close with my jessie installation but not quite there.

I fixed my serial port greyed out issue using the following

enable_uart=1

$ sudo systemctl stop [email protected]e
$ sudo systemctl disable [email protected]


$ sudo nano /boot/cmdline.txt

delete "console=serial0,15200"

Now if I go to cd /var/www/html/python
python flow_monitor.py

and then blow in my flow meter and refresh the browser I am recording pours.

My autostart file at /home/pi/.config/lxsession/LXDE-pi/autostart has the last line as @usr/bin/python /var/www/html/python/flow_monitor.py so all looks good there. Any ideas?
I assume you are saying the script isn’t autostarting on boot? I just redid my setup and for some reason I couldn’t get the script to auto start that way anymore either. I think a lot of those methods of autostarting scripts has been depreciated by systemd or something. I had to do this with my brewpi too recently the good news is getting a script to start on boot with systemd is super easy you can find directions here if that helps you. Otherwise the experts here probably know what’s going on.
https://www.raspberrypi-spy.co.uk/2015/10/how-to-autorun-a-python-script-on-boot-using-systemd/
 
We went away from using the LXDE autostart process quite a while ago. Somehow I didn't include it in my list of changes.
And I know this procedure is buried somewhere in this thread but failing to find tonight it I'll repost the gist of it here.

Here's a script that will be installed in /etc/init.d and linked through /etc/init.rc
On boot it will auto-launch flow_monitor.py from its home as user 'pi'

Save the following as file named 'flowmon' and put a copy in /etc/init.d/
Change the value of 'DIR' to match your R'Pints installation root (for Jessie and Stretch it should likely be /var/www/html/python)

Code:
-------------------
#!/bin/sh
### BEGIN INIT INFO
# Provides:          RaspberryPints flow Monitoring
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Put a short description of the service here
# Description:       Put a long description of the service here
### END INIT INFO
# Change the next 3 lines to suit where you install your script and what you want to call it
DIR=/var/www/python
DAEMON=$DIR/flow_monitor.py
DAEMON_NAME=RPFlowMon
# This next line determines what user the script runs as.
# Root generally not recommended but necessary if you are using the Raspberry Pi GPIO from Python.
DAEMON_USER=pi
# The process ID of the script when it runs is stored here:
PIDFILE=/var/run/$DAEMON_NAME.pid
. /lib/lsb/init-functions
do_start () {
    log_daemon_msg "Starting system $DAEMON_NAME daemon"
    start-stop-daemon --start --background --pidfile $PIDFILE --make-pidfile --user $DAEMON_USER --chuid $DAEMON_USER --startas $DAEMON
    log_end_msg $?
}
do_stop () {
    log_daemon_msg "Stopping system $DAEMON_NAME daemon"
    start-stop-daemon --stop --pidfile $PIDFILE --retry 10
    log_end_msg $?
}
case "$1" in
    start|stop)
        do_${1}
        ;;
    restart|reload|force-reload)
        do_stop
        do_start
        ;;
    status)
        status_of_proc "$DAEMON_NAME" "$DAEMON" && exit 0 || exit $?
        ;;
    *)
        echo "Usage: /etc/init.d/$DAEMON_NAME {start|stop|restart|status}"
        exit 1
        ;;
esac
exit 0

With the flowmon file in place, execute the following command to install the flowmon service:

Code:
sudo update-rc.d flowmon defaults

From the command line you can now:
Check the service: $ sudo /etc/init.d/flowmon status
Stop the service: $ sudo /etc/init.d/flowmon stop
Start the service: $ sudo /etc/init.d/flowmon start

Cheers!
 
We went away from using the LXDE autostart process quite a while ago. Somehow I didn't include it in my list of changes.
And I know this procedure is buried somewhere in this thread but failing to find tonight it I'll repost the gist of it here.

Here's a script that will be installed in /etc/init.d and linked through /etc/init.rc
On boot it will auto-launch flow_monitor.py from its home as user 'pi'

Save the following as file named 'flowmon' and put a copy in /etc/init.d/
Change the value of 'DIR' to match your R'Pints installation root (for Jessie and Stretch it should likely be /var/www/html/python)

Code:
-------------------
#!/bin/sh
### BEGIN INIT INFO
# Provides:          RaspberryPints flow Monitoring
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Put a short description of the service here
# Description:       Put a long description of the service here
### END INIT INFO
# Change the next 3 lines to suit where you install your script and what you want to call it
DIR=/var/www/python
DAEMON=$DIR/flow_monitor.py
DAEMON_NAME=RPFlowMon
# This next line determines what user the script runs as.
# Root generally not recommended but necessary if you are using the Raspberry Pi GPIO from Python.
DAEMON_USER=pi
# The process ID of the script when it runs is stored here:
PIDFILE=/var/run/$DAEMON_NAME.pid
. /lib/lsb/init-functions
do_start () {
    log_daemon_msg "Starting system $DAEMON_NAME daemon"
    start-stop-daemon --start --background --pidfile $PIDFILE --make-pidfile --user $DAEMON_USER --chuid $DAEMON_USER --startas $DAEMON
    log_end_msg $?
}
do_stop () {
    log_daemon_msg "Stopping system $DAEMON_NAME daemon"
    start-stop-daemon --stop --pidfile $PIDFILE --retry 10
    log_end_msg $?
}
case "$1" in
    start|stop)
        do_${1}
        ;;
    restart|reload|force-reload)
        do_stop
        do_start
        ;;
    status)
        status_of_proc "$DAEMON_NAME" "$DAEMON" && exit 0 || exit $?
        ;;
    *)
        echo "Usage: /etc/init.d/$DAEMON_NAME {start|stop|restart|status}"
        exit 1
        ;;
esac
exit 0

With the flowmon file in place, execute the following command to install the flowmon service:

Code:
sudo update-rc.d flowmon defaults

From the command line you can now:
Check the service: $ sudo /etc/init.d/flowmon status
Stop the service: $ sudo /etc/init.d/flowmon stop
Start the service: $ sudo /etc/init.d/flowmon start

Cheers!
This is awesome, damn I was closer than I realized as I copied flowmon from /var/www/html/python folder earlier but saw no change so undid it so didn’t include in my earlier post. I didn’t think to open the file and check paths, working finally, thanks everyone for your help! Now need to add my motion sensor but didn’t realise when I added to cart that it was a 3 pack, any suggestions on a use for 2 additional motion sensors? :) seriously though thanks all, i came so close to giving up on the alamode and buying an uno,
 
Excellent_Frog.jpg


Anyone else out there with issues?

Cheers!
 
The only thing I'm aware of is the need to use the autostart file located at /home/pi/.config/lxsession/LXDE-pi/autostart
Among the plethora of LXDE session autostart locations that's the one that seems to actually work under Jessie (and Stretch, I believe).

Add the line

sudo python pir_run.py

at the bottom and you should be in business...

Cheers!
 
The only thing I'm aware of is the need to use the autostart file located at /home/pi/.config/lxsession/LXDE-pi/autostart
Among the plethora of LXDE session autostart locations that's the one that seems to actually work under Jessie (and Stretch, I believe).

Add the line

sudo python pir_run.py

at the bottom and you should be in business...

Cheers!
On Stretch it does work, but you need to create the directory/file first, eg:
Code:
sudo mkdir /home/pi/.config/lxsession
sudo mkdir /home/pi/.config/lxsession/LXDE-pi
sudo nano /home/pi/.config/lxsession/LXDE-pi/autostart
Then add your autostart commands, eg:
Code:
@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash
@point-rpi
@xset s off
@xset -dpms
@xset s noblank
@chromium-browser --incognito --start-fullscreen localhost
Cheers,

Kal
 
Hey guys! Long time reader of this thread.

I've recently been built a keezer and doing something similar to rpints but instead combining with a few other interfaces out there and making a custom sort of solution. I've got a RPi 3+ (stretch distro) and currently struggling with communicating with/to the Alamode. I've followed the wyolum, rpints guides etc., plus a few other pages on the net. I can select the Alamode board and can see ttyS0 within the serial port but continuously get the error below whenever I try and upload a sketch to it..

Error inside Serial.serialEvent()
java.io.IOException: Inappropriate ioctl for device in nativeavailable
at gnu.io.RXTXPort.nativeavailable(Native Method)
at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1598)
at processing.app.Serial.serialEvent(Serial.java:258)
at gnu.io.RXTXPort.sendEvent(RXTXPort.java:774)
at gnu.io.RXTXPort.eventLoop(Native Method)​

I've seen a few people post this exact code earlier on but couldn't find the exact solution. I've tested the obvious voltage/ground pins to test the soldering and seems fine. Any ideas?
 
Back
Top