[Version 2 Release] RaspberryPints - Digital Taplist Solution

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

Help Support Homebrew Talk:

LBussy

A Cunning Linguist
HBT Supporter
Joined
Jan 19, 2013
Messages
3,230
Reaction score
1,237
Location
Kansas City
I am really considering load sensors instead, are the cheap ones with HX711 on Ebay acurate?
Even the expensive commercial ones (I have one within 5 feet of me right now) are not as accurate as a flowmeter. Yes, a flowmeter is a bit of a PIA, but load cells creep. Load cells are handy to be sure and may be the right choice for some applications, but I prefer flowmeters.
 
Last edited:

colsartoris

Member
Joined
May 2, 2020
Messages
10
Reaction score
0
File Under Low Priority
This is the sort of thing that drives me batty, so I thought I would let you know... The word "shield" is misspelled in the Shield Communication box. The text reads "Choose how Rpints communicates to the sheild." Not only is shield spelled incorrectly there, I believe this whole Connection box should be called "Arduino Integration" or "Arduino Communication" and should say, "Choose how Rpints communicates with the Arduino." The term "shield" is nice and generic, but I would have to believe that most people who are installing now are on Arduino Unos and not Alamodes or something else. (Maybe the #1 choice should also be USB? I ask too much!)

Screenshot from 2021-03-31 18-38-46.png
 

LBussy

A Cunning Linguist
HBT Supporter
Joined
Jan 19, 2013
Messages
3,230
Reaction score
1,237
Location
Kansas City
Hole Lee Cow...
LMGTFY is like a Rick Roll in IT. ;) However, the point is this is an open-source project and a developer should always appreciate even the smallest effort to make things better. I got dragged into Homebrew FOSS projects by doing just what I suggested: Writing some text. Without the community collaborating, these things die.
 

cripplecreek

Well-Known Member
Joined
Feb 16, 2010
Messages
178
Reaction score
3
Location
PA
I've been fiddling with RPints for a few days now and I'm wondering if anyone has a working wireless flow meter solution? I saw the older posts about the Photon, and I reached out to @bscuderi but never heard back. I see an older post from @day_trippr where he mentions ESP8266 devices, and links to an even older post, but that post only mentions Uno / Uno bluetooth. There are no instructions / code on how to get it to work on something that is wireless (WiFi). I'd be SUPER appreciative for any help!
 

day_trippr

Moderna Or Bust! :D
Joined
May 31, 2011
Messages
35,936
Reaction score
18,380
Location
Stow, MA
Years ago I set up RaspberryPints to use an esp8266 set up as a wifi to serial bridge between RaspberryPi and Arduino UNO. It was a follow-up to getting BrewPi working with the same bridge between RaspberryPi and UNO with a BrewPi shield. Both exercises worked fine, but were really just proof of concept things for me as I didn't have the need to put that kind of distance between host and slave agent. Bluetooth works just fine for my BrewPi minion needs, as does a USB connection for my RaspberryPints needs.

Anyway, did you come across this thread yet: Wireless Brewpi Via Wifi
While the discussion regards BrewPi the hardware and programming thereof is essentially the same. The real difference is configuring RaspberryPints to use an url instead of a communications port...

Cheers!
 

day_trippr

Moderna Or Bust! :D
Joined
May 31, 2011
Messages
35,936
Reaction score
18,380
Location
Stow, MA
fwiw...With the humongous assistance of Lee @LBussy and the grateful acknowledgement of @RandR+'s effort to keep this program alive I have begun the process to migrate from both "BrewPi Classic" and "RaspberryPints Classic" to "BrewPi Remix" and the @RandR+ RaspberryPints fork. The former is solidly good to go - I can run my keezer over a direct USB connection and my three brewery fridges over Bluetooth links to my minion collection. Done and done.

And I have an initial RandR+ R'Pints install up and mostly operational. Just a couple of issues to resolve, at least one of which is likely of my own making. More on that tomorrow.

I can definitely see some time mashing fonts though :)

My "classic" tap list:

1617509878599.png


Versus the next in line to the throne :D

1617509792210.png


Yup. Sample data or not, there's some work to do :)

But...I am grateful. I've been basically running the Linux equivalent of an utterly obsolete Windows 95 on my fleet of Raspberry Pi's and this is a metaphorical leap straight to Windows 10. Hasn't been pretty in a lot of cases, but this is the last leg of the trip...

Cheers!
 

Pkrd

Supporting Member
HBT Supporter
Joined
Dec 27, 2012
Messages
2,839
Reaction score
3,049
Location
New Zealand
I think those little fonts are OK. If you're too drunk to read them it doesn't matter what you're about to drink anyway.
 

colsartoris

Member
Joined
May 2, 2020
Messages
10
Reaction score
0
Could I ask you guys who have flowmeters and use duotight fittings for some pics of the inside of your keezers?
 

day_trippr

Moderna Or Bust! :D
Joined
May 31, 2011
Messages
35,936
Reaction score
18,380
Location
Stow, MA
Ok, so I have a few issues with the brand new R'Pints installation, but fortunately I can fully test it using a desktop mule and can revert to pre-installation state repeatedly if necessary. so this is a good time to get things fixed.

- Motion detection is non-functional. I had my PIR running perfectly on GPIO 7 prior to installing R'Pints, using a Python script run out of LXDE-PI startup. I removed that script pre-install so it wouldn't be in the way. Post-install Xscreensaver blacks out the hdmi monitor, but the PIR won't wake it back up. A pointer on where the Motion Detection service resides/originates might help get me started on this one. In the hope /var/log/rpints.log sheds any light I've attached it below.

- Fan Control is running though not enabled? (see log)

Code:
2021-04-04 13:51:41 RPINTS: Could not import RFID Reader, RFID disabled. Assuming SPI not installed/configured
2021-04-04 13:51:50 RPINTS: starting WS server
2021-04-04 13:51:50 RPINTS: starting device monitors...
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/var/www/html/rpints/python/PintDispatch.py", line 472, in spawnWebSocketServer
    os.chdir(options.document_root)
OSError: [Errno 2] No such file or directory: '/var/www/html/python/ws'

2021-04-04 13:51:50 RPINTS: starting command server
2021-04-04 13:51:50 RPINTS: starting fan control
2021-04-04 13:51:50 RPINTS: Fan Control fanControl1 is Running
2021-04-04 13:51:50 RPINTS: Not Configured to run Fan
2021-04-04 13:51:51 RPINTS: Motion Detector MD-Primary PIR is Running
2021-04-04 13:51:51 RPINTS: 1Wire Temperature Thread 1 is Running
2021-04-04 13:51:51 RPINTS: Unable to run Motion Detection
- The nice Reboot, Shutdown and Restart Flow Monitor buttons on the management portal page do not work - I'm almost certain because of permissions. I may have caused that because there's not really any context given during installation as to what the "user" and "admin" names might need to be. I'm guessing I need to be running R'Pints with a sudoer account, but when I did the installation I used user and admin names that are not even associated with any actual login accounts.

Some guidance on this one would be helpful as it might be as simple as rerunning the installer with the proper names :)

- Something is using GPIO8 on the RPi. What would that be?

- Ghost pours on lines without meters connected? During initial configuration I associated 6 GPIO pins (2 & 5-9) with meter inputs via the GUI, and loaded the tap list with the sample data. I whittled the keg list down to 16 to match my situation, set up six kegs on taps, set varying initial amounts in all kegs, then I walked one meter across the six RPi GPIO pins last night and all responded appropriated. So far, awesome!

Left the system running overnight with the six "tapped kegs" at various volumes, this morning when I started playing again I noticed the kegs on Tap 1 and Tap 6 had been kicked and removed from the list leaving empty slots. I just checked the six RPi GPIO pins and they all clearly have pull-ups activated. These are the same pins I've been using on my system and its backup clone since 2014 so I'm pretty confident they should be solid. So that's a concern.

I think that's the list at this point...

Cheers!
 

day_trippr

Moderna Or Bust! :D
Joined
May 31, 2011
Messages
35,936
Reaction score
18,380
Location
Stow, MA
Ah, ok, good to know. My original PIR script uses GPIO8 for driving an LED that lights when the PIR fires.

I've found the "ioPins" table in the R'Pints database that appears to list all of the "UNO-centric" pins on the Alamode shield (as opposed to the passthrough RPi header) with their native schematic functions, and is apparently the basis for ioPins_list.php that populates the Alamode side of the gui's "Hardware IO Display" page.

I haven't found what populates the other side of that gui page for the RPi pins. And looking at the gui right now it sure looks like both the PIR and an RFID Reader are configured to use the same pin 26/gpio 7. Maybe that's why the Motion Detection can't run?


1617570933627.png



I'm gonna have to get up to speed on this package eventually so I'll keep digging :D

Cheers!
 

day_trippr

Moderna Or Bust! :D
Joined
May 31, 2011
Messages
35,936
Reaction score
18,380
Location
Stow, MA
That's actually an image with a transparent background :) tacked on the end of my index.php - literally the very last line - and it looks like this:

<img class="size" src="img/tap_numbers.png" alt="">

Cheers!
fwiw, there was more to getting that "Tap Number" image on the "classic" RaspberryPints page than I showed (it's been over 7 years since I put that tweak in). The entirety of the original inclusion actually is:

Code:
<style type="text/css">
<!--
img.size{
    width:100%;
    height:auto;
}
-->
</style>

<img class="size" src="img/tap_numbers.png" alt="">
which stuck that png at the bottom of the page and allowed it to span the width.

I haven't figured out how to make that work with this new version...yet :)

Cheers!
 

garzlok

Well-Known Member
Joined
Aug 19, 2012
Messages
408
Reaction score
272
Location
Dacula
Ah, ok, good to know. My original PIR script uses GPIO8 for driving an LED that lights when the PIR fires.

I'm gonna have to get up to speed on this package eventually so I'll keep digging :D
I'll be honest, I thought RandR had this all configurable in the Admin. If you go to Admin->Advanced Hardware ->Motion Detectors...You should be able to save the motion detector to an appropriate Pi Pin.

In my case, I have my RFID associated to Pi Pin 24, which I believe is GPIO8. (I'm not certain if RFID has to be married to the Pin. It's just the Pin used in all the tutorials)

Admin->Advance Hardware->Hardware IO Display should show you the Uno and Pi Pin Layout.
 
Last edited:

day_trippr

Moderna Or Bust! :D
Joined
May 31, 2011
Messages
35,936
Reaction score
18,380
Location
Stow, MA
Done all that, found that page (see my post above). Played with the wiring and the assignments.
Doesn't matter, Motion Detection refuses to run regardless of which pin I assign the PIR to.

When I try forcing my pir_run.py on the system (which is where this all came from to begin with) the system states it's unable to enable edge detection for that pin, which is probably the original problem. So I'm thinking there's some conflict inside R'Pints...

Cheers!
 

day_trippr

Moderna Or Bust! :D
Joined
May 31, 2011
Messages
35,936
Reaction score
18,380
Location
Stow, MA
Stumbled across /var/www/html/rpints/python/PintDispatch.py. Intense.
That one script has pretty much every function under the R'Pints hood running through it :)
It's gonna take me some time just to understand it all...

Cheers!
 

RandR+

Supporting Member
HBT Supporter
Joined
Oct 5, 2015
Messages
790
Reaction score
245
2021-04-04 13:51:51 RPINTS: Unable to run Motion Detection
Yes there is an issue with something in the motion detection logic from the RPints.log unfortunately it looks like debug is turned off (which it is by default)
in python/Config.py change all
config['xxx.debug' ] = False#True
to
config['xxx.debug' ] = True

(specfically config['flowmon.debug' ] = True)
and restart Rpints.

Fan Control is running though not enabled?
ya that is confusing, but its so the system doesnt need to restart if the user enables the fan control, essentially its a thread that runs to check if it gets enabled or disabled. Could be better like a specific message to recheck the fan control instead of a loop.

The nice Reboot, Shutdown and Restart Flow Monitor buttons
Check RPints.log after press to see if anything is logged out. Those buttons rely on the flowmeter script to work and hence log into the file.

Something is using GPIO8 on the RPi. What would that be?
Sounds like you found the hardware IO page to help figure it out. the page just looks at all known/possible equipment and puts it in the correct cell based if it needs to be on the pi or shield

- Ghost pours on lines without meters connected?
The difference between my FlowMonitor.py (responsible for getting the pulses) is that my has interrupts for when the pin changes vs the original which just check the state in a loop. i use the same logic to count pulses (slightly different syntax). Both versions check if the pin state changed and if its now high count the pulse as a kicked or a pour based on how fast it changed from its last state.
If the log show that there was only 1 pour that kicked the keg then you may want to disabling kicking kegs until this is figured out
1617635409547.png

After refreshing my memory on interrupts i realized that getting the time may be the part of the problem because the millis function doesnt increment inside of interrupts, which means pulses milliseconds apart may count has kicked instead of pour and since pours need more pulses to record the few rogue high states are more likely to trigger a kick then a pour.

I haven't figured out how to make that work with this new version...yet
Im thinking around line 314 of index.php, after the first printBeerList as that is what prints the tap list.
1617638794788.png

Otherwise at the end of includes\beerListTable.php and includes\beerListTableVerticle.php
(both print the tap list but changes if the tap numbers are top to bottom (horizontal data display) or left to right (vertical data display)
you may want to try vertical display since that will match your information to your taps layout
1617638942215.png


That one script has pretty much every function under the R'Pints hood running through it
Python directory has all the functions in it they are broken out into
PintDistpatch.py - Main python, database access, logging logic, run FlowMonitor and Fan Control
HX711.py - load cell logic
FlowMonitor.py - Communicate with the Arduino/MQTT, start threads for Motion Detection, One Wire Temperature, RFID checking, and Load Cells.
 

day_trippr

Moderna Or Bust! :D
Joined
May 31, 2011
Messages
35,936
Reaction score
18,380
Location
Stow, MA
Thanks very much for the follow-up, @RandR+, I appreciate it.

Ghost pours:
There's a possibility the mystery keg kicks were caused by an idiot user :) I had found two of the sample data keg entries had 1/2 barrel kegs shown when they were all supposed to be 5 gallon corny kegs. Check out the Super Champion vs Challenger IV - the latter appears as a 1/2 barrel on the tap list. I deleted them but may have forgotten to tap two different kegs to take their places. And before I went to bed this morning I set all six kegs to full, and when I checked them this morning they were all still full. So let's table that for now.


Reboot, Shutdown and Restart Flow Monitor buttons and Motion Detection
I enabled all of the available debug switches in config, restarted the system, and noticed R'Pints re-flashed the Alamode. That was interesting - first time I had seen that since the initial installation :) It did succeed so that's good.

So then I tried banging on the Reboot & Shutdown & Restart Flowmeter buttons, collected a copy of the rpints.log file, renamed it and attached it here. There are a couple of potential leads to follow therein.

I did another round of banging the buttons and checked the rpints.log file and there was nothing appended since the snapshot provided here, so whatever's going on it's not making it into the log file.

One thing I notice is the instant I click any of the buttons the page vertical scroll bar "grows" for a second than returns - so there is some reaction but whatever it is is out of view at the bottom end of the page.


How To Append Image Footer:
Thanks for the pointers, I'll check that all out this afternoon.

------------------------------------------------------------------------------------------------------------------------------------------------------------------
New issue (with fix):
typo error in /etc/udev/rules.d/80-alamode.rules

I went through user.log and syslog (and daemon.log and boot.log) to see if anything shows up during boot or R'Pints start-up that could explain the motion sensor issue or in reaction to banging on the buttons. Not really seeing much of anything on either count, aside from this one syslog message during boot:

Code:
[Apr  5 14:15:32 RASPI9 systemd-udevd[155]: /etc/udev/rules.d/80-alamode.rules:1: Invalid key/value pair, starting at character 52 (',')
fwiw, this is the entirety of /etc/udev/rules.d/80-alamode.rules:
Code:
KERNEL=="ttyAMA0", SYMLINK+="ttyS0",GROUP="dialout",MODE:=0666
KERNEL=="ttyACM0", SYMLINK+="ttyS1",GROUP="dialout",MODE:=0666
I'm sure that pair should look like this: ,MODE="0666"
And I'm pretty sure this bug goes WAAAAY back through numerous Alamode support package versions as I found the same error on the Wheezy machine running my brewery right now :)

I just fixed my rules file and those errors are gone.

So, that's something accomplished even if it doesn't actually fix anything important :D

------------------------------------------------------------------------------------------------------------------------------------------------------------------
New issue:
raspberrypints database vs phpmyadmin:

I noticed today if I open the database using phpmyadmin any time I browse a data table I get an error that looks generally like this.
This was browsing the 'pours' table:

Warning in ./libraries/sql.lib.php#613
count(): Parameter must be an array or an object that implements Countable

Backtrace

./libraries/sql.lib.php#2128: PMA_isRememberSortingOrder(array)
./libraries/sql.lib.php#2062: PMA_executeQueryAndGetQueryResponse(
array,
boolean true,
string 'raspberrypints',
string 'pours',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
NULL,
string 'SELECT * FROM `pours`',
NULL,
NULL,
)
./sql.php#221: PMA_executeQueryAndSendQueryResponse(
array,
boolean true,
string 'raspberrypints',
string 'pours',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
NULL,
string 'SELECT * FROM `pours`',
NULL,
NULL,
)

And this was browsing the 'kegs' table.

Warning in ./libraries/sql.lib.php#613
count(): Parameter must be an array or an object that implements Countable

Backtrace

./libraries/sql.lib.php#2128: PMA_isRememberSortingOrder(array)
./libraries/sql.lib.php#2062: PMA_executeQueryAndGetQueryResponse(
array,
boolean true,
string 'raspberrypints',
string 'kegs',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
NULL,
string 'SELECT * FROM `kegs`',
NULL,
NULL,
)
./sql.php#221: PMA_executeQueryAndSendQueryResponse(
array,
boolean true,
string 'raspberrypints',
string 'kegs',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
NULL,
string 'SELECT * FROM `kegs`',
NULL,
NULL,
)

It gets past it with a dismissal of the error pop-up, but that can't be right.
------------------------------------------------------------------------------------------------------------------------------------------------------------------

Let me know if there's anything I can do to figure any of these issues out. And as I did with Lee B, if you need to poke around on my mule let me know - the ports are actually still open :)

Cheers!
 

Attachments

RandR+

Supporting Member
HBT Supporter
Joined
Oct 5, 2015
Messages
790
Reaction score
245
One thing I notice is the instant I click any of the buttons the page vertical scroll bar "grows" for a second than returns - so there is some reaction but whatever it is is out of view at the bottom end of the page.
The button loads a new page that sends the command to the python through the webserver socket, then redirects back to the admin page which starts with the left bar menu fully expanded then collapses some menus, that is why it grows then shrinks.
from the log i see this
File "/var/www/html/rpints/python/PintDispatch.py", line 472, in spawnWebSocketServer
os.chdir(options.document_root)
OSError: [Errno 2] No such file or directory: '/var/www/html/python/ws'

Which Im thinking is why the buttons are not working. Can you check and make sure config['pints.dir' ] is set to the correct path for you setup (/var/www/html/rpints/) in python/Config.py? The install script should automatically change it, but I found line 533 in python/PintDispatch.py doesnt use that value and that would explain why the web server socket failed to spawn.
Im going to change that line to
args = ["-p", "8081", "-d", PYTHON_WSH_DIR]
1617654076687.png


if you could do the same and let me know if that error goes away.

Motion Detection
it is something with attaching to the pin, it seems you have it defined as Pin 26 (GPIO7), RFID readers need that pin for their clock but i see from your log RFID is disabled so no RPints should be connecting to that pin (the IO page shows it just as a means to know that RFID will use that pin if you enable it) do you have anything else configured to use that pin on your system? could you try a different Pin just to see if it works

2021-04-05 14:15:55 RPINTS: Traceback (most recent call last):
File "/var/www/html/rpints/python/FlowMonitor.py", line 593, in run
GPIO.add_event_detect(self.pirPin, GPIO.RISING, callback=self.MOTION)
RuntimeError: Failed to add edge detection

typo error in /etc/udev/rules.d/80-alamode.rules
Thanks for the heads up, really that file is managed by the Alamode team, the installer just downloads it like the manual instruction say to do.
The file can be found here wyolum/alamode
I will have my install script fix the error so others dont have to worry about it.

raspberrypints database vs phpmyadmin:
it seems a common issue in phpmyadmin, looks like it was fixed in newer versions, not sure what version was installed on your Pi (also PHP version might make a difference)

Im tried with my test system and it doesnt give that error, but it has the same bug in the code, I am going to include the quick fix for this issue in my installer script
sed -i "s/|\s*\((count(\$analyzed_sql_results\['select_expr'\]\)/| (\1)/g" /usr/share/phpmyadmin/libraries/sql.lib.php
 

garzlok

Well-Known Member
Joined
Aug 19, 2012
Messages
408
Reaction score
272
Location
Dacula
sed -i "s/|\s*\((count(\$analyzed_sql_results\['select_expr'\]\)/| (\1)/g" /usr/share/phpmyadmin/libraries/sql.lib.php
OMGosh! I just sudo'd this command in terminal, and it got rid of that annoying pink error pop-up in phpmyadmin!
 

day_trippr

Moderna Or Bust! :D
Joined
May 31, 2011
Messages
35,936
Reaction score
18,380
Location
Stow, MA
Again, my thanks for hanging in there with me on this :)

So, here is the entirety of my config.cfg. It seems legit, but if you spot anything amiss let me know :)

Code:
config = {}

# the dir everything lives in
config['pints.dir'] = '/var/www/html/rpints/'
#the serial port to the alamode
#config['flowmon.port'] = '/dev/ttyS0'
#The following line is for serial over USB
##config['flowmon.port' ] = '/dev/ttyACM0'
#The following line is for serial over bluetooth
##config['flowmon.port'] = '/dev/rfcomm0'

#logging settings for flowmon
config['flowmon.debug' ] = True

#logging settings for pintdispatch
config['dispatch.debug' ] = True

#logging settings for load cells
config['loadcell.debug' ] = True
#Use fake monitoring to report flow
config['dispatch.debugMonitoring' ] = False

config['flowmon.port'] = '/dev/ttyS0'
----------------------------------------------------------------------------------------

As for PintDispatch.py...the lines you're interested in appear around line 463 in my version of the file(?)
I've attached it, just in case. And I went ahead and changed my file:

463 def spawnWebSocketServer(self):
464 args = ["-p", "8081", "-d", PYTHON_WSH_DIR]

and restarted to see what happens: still doesn't react to any "button" clicks, but something definitely changed.

Code:
2021-04-05 18:16:53 RPINTS: starting WS server
2021-04-05 18:16:53 RPINTS: starting device monitors...
2021-04-05 18:16:53 RPINTS: starting command server
2021-04-05 18:16:53 RPINTS: resetting Arduino
[2021-04-05 18:16:53,591] [CRITICAL] mod_pywebsocket.standalone.WebSocketServer: No sockets activated. Use info log level to see the reason.
2021-04-05 18:16:53 RPINTS: starting fan control
2021-04-05 18:16:53 RPINTS: Creating Serial Listener
2021-04-05 18:16:53 RPINTS: Fan Control fanControl1 is Running
2021-04-05 18:16:53 RPINTS: Not Configured to run Fan
2021-04-05 18:16:54 RPINTS: Motion Detector MD-Primary PIR is Running
2021-04-05 18:16:54 RPINTS: 1Wire Temperature Thread 1 is Running
2021-04-05 18:16:54 RPINTS: waiting for Arduino to come alive
2021-04-05 18:16:54 RPINTS: Unable to run Motion Detection
2021-04-05 18:16:54 RPINTS: Traceback (most recent call last):
  File "/var/www/html/rpints/python/FlowMonitor.py", line 593, in run
    GPIO.add_event_detect(self.pirPin, GPIO.RISING, callback=self.MOTION)
RuntimeError: Failed to add edge detection

----------------------------------------------------------------------------------------

it is something with attaching to the pin, it seems you have it defined as Pin 26 (GPIO7), RFID readers need that pin for their clock but i see from your log RFID is disabled so no RPints should be connecting to that pin (the IO page shows it just as a means to know that RFID will use that pin if you enable it) do you have anything else configured to use that pin on your system? could you try a different Pin just to see if it works
I also tried using GPIO08 yesterday with no change. In the gui Hardware IO Display table, when I moved the PIR to that pin (24), both the "RFID" and the "PIR Primary Trigger" moved to that pin together, according to the Hardware IO Display table. I was actually wondering if the table entry really is "RFID PIR Primary Trigger" because they don't seem to be separable :)

I don't think I have anything trying to set GPIO 07 or 08 but it is possible, so I will comb through the system to check. As I mentioned aways back I had my original PIR "unblanking" construct running on GPIO07 the same as it's been on my other systems for years just to check out the PIR itself, etc, and thought I had disabled/deleted the stuff that made that work before the R'Pints installation so it wouldn't conflict. But it's possible I missed something. I'll also try using another, different GPIO pin and see what happens.

----------------------------------------------------------------------------------------

Wrt phpmyadmin: this is a brand new build this week, and the system has been repeatedly "apt update upgrade" 'ed, so I'd hope I have the latest version. That said, this is *nix :D Lemme check...here's what the gui says:

1617660808941.png


Did you mean for me to execute this command? If so, is focus important or can it be executed from anywhere?

sed -i "s/|\s*\((count(\$analyzed_sql_results\['select_expr'\]\)/| (\1)/g" /usr/share/phpmyadmin/libraries/sql.lib.php

Cheers! :mug:
 

Attachments

day_trippr

Moderna Or Bust! :D
Joined
May 31, 2011
Messages
35,936
Reaction score
18,380
Location
Stow, MA
fwiw, when I try clicking on any of the "three buttons" then refresh and scan /var/log there are literally zero files changed.
Somehow, whatever machinations there are behind the buttons, they are getting sucked into oblivion.
Weird...
 

day_trippr

Moderna Or Bust! :D
Joined
May 31, 2011
Messages
35,936
Reaction score
18,380
Location
Stow, MA
Seems ok from here? This was after I moved the PIR to pin 21 / GPIO09.
Which may be working - can't tell yet...
[edit] PIR is working now!

1617663241685.png


Cheers!
 

day_trippr

Moderna Or Bust! :D
Joined
May 31, 2011
Messages
35,936
Reaction score
18,380
Location
Stow, MA
Ok, as I mentioned above, moving the PIR to use GPIO09 / pin 21 has allowed that feature to work: screen blanks then wakes once the PIR picks up movement. I have not been able to find any conflicts [edit: with the attempts to use GPIO 07 and 08,] though it seems clear there must be one hiding somewhere, but it's ok for now.

And also as noted, that edit command has totally cleaned out all the massive pink-paged errors in phpmyadmin, so that's two issues off the books already!

The impact of that PintDispatch.py change is curious...

Cheers!
 
Last edited:

garzlok

Well-Known Member
Joined
Aug 19, 2012
Messages
408
Reaction score
272
Location
Dacula
650EF408-DCFF-4435-B641-8753A9C21A86.png

I love keg kicks too...mine was within 2 pints. To my flowmeters defense...this was tapped moving from a 2-tap system to a 3-tap system and I had to chase a shank leak. Also, I don’t take an exact measurement of what goes in the keg and I do a close transfer fill. 😂
 

day_trippr

Moderna Or Bust! :D
Joined
May 31, 2011
Messages
35,936
Reaction score
18,380
Location
Stow, MA
Love the format of your tap list! Aspirational :D
But your tower looks toasty. Do you not have a chiller?

btw: do any of the Reboot/Shutdown/Restart Flowmeter Service buttons work for you?

Cheers!
 

day_trippr

Moderna Or Bust! :D
Joined
May 31, 2011
Messages
35,936
Reaction score
18,380
Location
Stow, MA
Looking back at motion detection...

Question: can R'Pints' Motion Detection thing truly be disabled if I wanted that mission to exist outside of R'Pints?

I ask because my current keezer will wake up the display, turn on an LED indicator and play a chosen song - and eventually I was going to use it to trigger a remote light control for my brew space where the keezer lives. All that was easy to do with my original method but I'm not sure I could hook all that functionality to what's inside R'Pints now :)


Anyway...

This is from /var/www/html/rpints/python/FlowMonitor.py, and I am wondering it there is a conflict here wrt GPIO 07 and 08 assignments. Even after moving my PIR over to GPIO 09 successfully I noticed that GPIO 08 is still doing something and I'm assuming GPIO 07 is also and was all along.

#Following is based on code from day_trippr (coverted to thread and allow configurable pin)
class MotionDetectionPIRThread (threading.Thread):
def __init__(self, threadID, pirPin = 7):
threading.Thread.__init__(self)
self.threadID = threadID
self.pirPin = pirPin
self.shutdown_required = False

def exit(self):
self.shutdown_required = True

def MOTION(self, PIR_PIN):
debug("Motion Detector " + self.threadID + " Detected Motion")
#Wake up every users monitor, need to loop through the users otherwise the command wont know who is currently logged in
#To see full command replace ;'s with new lines
os.system('export DISPLAY=":0.0"; for dir in /home/*/; do export XAUTHORITY=$dir.Xauthority; xscreensaver-command -deactivate > /dev/null 2>&1; done;')
time.sleep(1)

def run(self):
log("Motion Detector " + self.threadID + " is Running")
try:
GPIO.setup(self.pirPin, GPIO.IN)
GPIO.add_event_detect(self.pirPin, GPIO.RISING, callback=self.MOTION)
while not self.shutdown_required:
time.sleep(100)
except:
log("Unable to run Motion Detection")
debug(traceback.format_exc())
return


class LoadCellCheckThread (threading.Thread):
def __init__(self, threadID, dispatch, updateDir, tapId = 1, commandPin = 7, responsePin = 8, delay=1,
updateVariance=.01, unit="lb", logger=None, scaleRatio=1, tareOffset=0):
threading.Thread.__init__(self)
self.threadID = threadID
self.dispatch = dispatch
self.updateDir = updateDir
self.tapId = tapId
self.commandPin = commandPin
self.responsePin = responsePin
self.delay = delay
self.updateVariance = updateVariance
self.unit = unit
self.checkTare = False
self.shutdown_required = False
self.hx711 = HX711(name=threadID, dout_pin=responsePin, pd_sck_pin=commandPin, logger=logger,scale_ratio=scaleRatio,tare_offset=tareOffset)

def exit(self):
self.shutdown_required = True

def setCheckTare(self, checkTare):
self.checkTare = checkTare

def tare(self):
self.hx711.zero()
self.dispatch.setLoadCellTareOffset(self.hx711.get_offset())
return

def getWeight(self):
return self.hx711.get_weight_mean(20)

def run(self):
log("Load Cell Checker " + self.threadID + " is Running")
lastWeight = -1
try:
while not self.shutdown_required:
if self.checkTare:
if self.dispatch.getTareRequest(self.tapId):
self.tare()
self.dispatch.setTareRequest(self.tapId, False)
self.setCheckTare(False)

weight = self.getWeight()
#if weight is valid and the difference between the last read is significant enough to update
if weight > 0 and abs(lastWeight - weight) > self.updateVariance :
#The following 2 lines passes the PIN and WEIGHT to the php script
subprocess.call(["php", self.updateDir + '/admin/updateKeg.php', str(self.tapId), str(weight), self.unit])
lastWeight = weight
time.sleep(self.delay)
except Exception as ex:
log("Unable to run Load Cell Checker")
debug(str(ex))
debug(traceback.format_exc())
return

Cheers!
 

day_trippr

Moderna Or Bust! :D
Joined
May 31, 2011
Messages
35,936
Reaction score
18,380
Location
Stow, MA
In answer to my question: yes, Motion Detection can be not enabled allowing an alternate scheme to be used.
So I have that path available if needed, which is good :)

One thing that seems weird: where did that "RFID" thing go? All I did was turn off the Motion Detection (and add an entry to the LXDE startup file for the classic pir_run.py).

Unless "RFID Primary PIR Trigger" really was the name for the PIR?

1617671087695.png




Otherwise...right now I think the only thing still sticking out unresolved are those three system control buttons...

Cheers!
 

day_trippr

Moderna Or Bust! :D
Joined
May 31, 2011
Messages
35,936
Reaction score
18,380
Location
Stow, MA
fwiw, this is what I do with my PIR trigger, exploiting the os.system(cmd) function.
The STATUS_PIN drives an LED, and I've used various brief sound mp3s including "What are you doing, Dave?" (2001 A Space Odyssey) to Windows "Tada!" :)
Lately I've been using a "bubbles" clip.

My eventually intention is to link this to a network command to a turn on a smart switch for the brew space lights.
I'm sure the same functions could be added to R'Pints if there was a call for either/both...

Cheers!

Code:
#!/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/tada.mp3'

PIR_PIN = 9
STATUS_PIN = 10
GPIO.setup(PIR_PIN, GPIO.IN)
GPIO.setup(STATUS_PIN, GPIO.OUT)

def MOTION(PIR_PIN):
    os.system(cmd)
    GPIO.output(STATUS_PIN,True)
    os.system(playsound)
    GPIO.output(STATUS_PIN,False)

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

except KeyboardInterrupt:
    GPIO.cleanup()

GPIO.cleanup()
 

garzlok

Well-Known Member
Joined
Aug 19, 2012
Messages
408
Reaction score
272
Location
Dacula
Unless "RFID Primary PIR Trigger" really was the name for the PIR?

But your tower looks toasty. Do you not have a chiller?

btw: do any of the Reboot/Shutdown/Restart Flowmeter Service buttons work for you?
I don’t run motion sensors, but I do utilize RFID:
28240E94-8E9A-4808-BB51-1BAED7F40967.jpeg


Yeah....my tower temp is a pain in my ass. I have a fan with a foam tube that directs air movement to the tower, but I think I’m fighting two issues. One, with the tower insulation and 3 beer lines going through the tower, there’s not a lot of space for air movement. Two, again with lack of space, the warm air is stuck in the tower and there is no recirculating happening.

As far as my 3-buttons....I know Restart Flowmeter Service works, but I don’t recall ever trying the other two buttons.

Love the format of your tap list! Aspirational
Thanks! Unfortunately it's so much tweaking...I had to fork off of @RandR+ 's version. 😖 Thank goodness he's such a nice guy because I usually ask for his help every other update when I merge the branches. 🤣
 
Last edited:

day_trippr

Moderna Or Bust! :D
Joined
May 31, 2011
Messages
35,936
Reaction score
18,380
Location
Stow, MA
Ah - very interesting! We'll see what the author thinks of all this :)

As for the buttons...now that you mention it I may not have actually tried the Restart Flow Meter button.
I suppose of the three that one might be easiest to implement as I doubt it needs sudo privs whereas shutdown definitely does.

I'm in the middle of cloning SD cards but will try that in a while...

Cheers!
 
Top