[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.
When connecting flowmeters and PIR to the Alamode pins do you configure RP to reflect the GPIO or board pin numbers
 
flowmeters and PIR to the Alamode pins do you configure RP to reflect the GPIO or board pin numbers
Flowmeters go to the Alamode pins number after the D printed on the board. so D1 = pin 1

the PIR goes to the PI pins, that configuration uses the Board pin number
 
You can also see the configuration pin you can use through the admin screen -> Advanced hardware -> Hardware IO Pins, it gives a visual representation of your boards and what RPints is configured to use
1671111236174.png
 
Okay so I installed my flowMeters (YF-S401) at the beginning of the line (just after the keg) and now my beer glass gets filled with 80% foam and 20% liquid.

Is there anyway to fix this?
 
Is there anyway to fix this?
I use the same type of flow meters although with the 1/4" quick connect fittings. to make the connections i used john guest barbs to convert the female push in to male barb. At first i started with very small barbs (3/16th) then tried bigger ones (1/4) because of the foaming issue and that seemed to elevate it.
My meters are closer to the faucet then the keg, though i think there is mixed feelings over where to put them. I put them there for to make running the wires easier more than foaming.

Another thing that caused foam was the wheel inside got stuck (hop particles or something on the magnet) that cause turbulence in the flow. cleaning the wheel fix that.
 
I have your version of RPints running but cannot get the flowmeters Pins (GPIO D5-D13, 5v and gnd), Temp Probe on pin (GPIO 4, 3.3v and gnd (waterproof DS18B20)), or the PIR on pin (GPIO 17, 5v and gnd) to run. Completed a fresh install of Pi and RPints and fitted a new DS18B20 still no good. It appears as if the alamode board is not being recognised. Do I need to run all the code in the alamode user guide
 

Attachments

  • IMG_20221231_092904_365.jpg
    IMG_20221231_092904_365.jpg
    4.2 MB · Views: 0
It appears as if the alamode board is not being recognised
have you tried opening arduino/raspberrypints.ino in the arduino IDE on the PI and uploading it?

I found that bullseye (latest pi os) doesnt support the old method for the alamode board install. I doubt they will have an updated script for it, but the upload process at the start of RPints still works to get the arduino code on the board and working. Check /var/log/rpints.log to see if the upload was sucessfull. Also check /var/www/html/python/Config.py to confirm the last instance of config['flowmon.port'] is config['flowmon.port'] = '/dev/ttyS0' that indicate the serial port versus the USB port
 
Thanks - will look into it.
I did get the temp to read on pin 4 but it doesn't seem to be updating - temp seems to be right but the time is incorrect
 
I know it's good etiquette to read the whole thread, but at almost 8000 posts, with information scattered throughout, that would be pretty time-consuming (I have looked through the last few pages, and didn't see an answer); hopefully someone can point me a little more directly to an answer. I'd like to run something like "nts" ("nts": RaspberryPints Without The RaspberryPi), running the server on a Linux system (and I'm OS/distro-agnostic there), receiving MQTT from KegCop, and displaying on some other device (likely a tablet, at least at the outset). I can see there are multiple forks, but I don't know where they all are, or which is most up-to-date. Some clarification on this?

Edit: It's looking like the installer script at install.rpints.com (aka https://raw.githubusercontent.com/rtlindne/RaspberryPints/master/util/installRaspberryPints) is the most up-to-date, but it complains when running on Debian (Bullseye) rather than RaspberryPiOS. But even so, it seems to be installing. It requires manually editing /etc/apt/sources.list to include "contrib" for the main repos, and also manually installing python3-pip. It also seems that it installs a lot of packages related to a graphical environment that aren't necessary if the system's going to run headless (as mine is). But with that said, it does seem to install everything, I can browse to the page, log in as the admin user, change settings, etc.

So it's always the case that one finds the answer after one has already posted the question, but I'd still appreciate if there's further clarification to be had.
 
Last edited:
clarification to be had
it sounds like you got it to work on a non-PiOS. Probably not much more to add then good job and if you see any improvements that can be made (besides increasing the OS compatibility, im not looking to take that on for the installer) let me know.
 
As far as I've seen so far, the only change I might suggest to the script itself is to install python3-pip, because that isn't part of a stock Debian 11/Bullseye install and will cause the installation to fail.

But for the sake of posterity, here's all that needs to be done to run the install in that environment:
  • Edit /etc/apt/sources.list with your default editor. Add contrib to the first two http sources, like this:
    Code:
    deb http://deb.debian.org/debian/ bullseye main contrib
    deb-src http://deb.debian.org/debian/ bullseye main contrib
  • If you want to access the system by <hostname>.local, run sudo apt install avahi-daemon
  • sudo apt install python3-pip
  • curl -L install.rpints.com | sudo bash
I installed without flowmeters, so I can't say whether there might be missing dependencies for that. And as I noted, I'm running it headless, so I told it not to use a monitor. But I did have it install MQTT, and the whole thing proceeded swimmingly.

Now, how well it will work with KegCop sending data via MQTT needs to wait for the arrival of the kegerator itself as well as the flow meters, so... But it's all looking good so far.
 
When I installed RPints I did not select add Motion Sensors - is there a script I can download and add, or do I need to reinstall RPints and select the option t install Motion Detectors
 
is there a script I can download and add, or do I need to reinstall RPints and select the option t install Motion Detectors
rerun the install script it will detect Rpints is installed and prompt if you want to "Reconfigure Pi/Enable Features"

It then should prompt you to install flow meters, if it doesn't let me know so i can check the script
 
My fleet of RPIs have aged gracefully over the years, most of them still quite content to run Wheezy, but at this point it's impossible to ignore the passage of time - especially when it comes to updates of pretty much any kind. So I am setting out on the mission to create a whole new prototype system based on Bullseye. And now that I have the basic OS and desktop stuff installed, it's time for all the brewery stuff to be loaded. Starting with Raspberry Pints.

I ran the installer - twice as seems to be required (same thing happened on Buster) - and got the initial installation done. Then I configured in my six flowmeters (using Alamode GPIO 2 and 5 through 9). When I rebooted the system and brought up R'Pints in a Chrome browser on my workstation, this is what I saw:



While that was going on the LED I have connected to the Alamode GPIO 13 (which is the same GPIO that the Alamode's on-board "Blink LED" is wired to) was blinking once roughly every second. My original Arduino sketch mod made that LED blink at the end of a detected pour and was very handy for debugging. This behavior is different. Then, many minutes later, the screen finally stopped blinking, and the LED changed its blink pattern to a bursty pattern like this:



While the main page blinks I noticed the management pages did not. Even returning from a management page the Main page would blink again.

I went to test my flowmeter setup, walking a known-good meter through the used pins. The bursty LED blink pattern that happens once the screen blinking has stopped isn't interrupted if I blow through a flow meter. Otoh, while the screen is blinking and the LED is doing its one blink per second, it does pause while a flow meter is spinning.

This behavior repeats with every reboot. How long it takes for the screen to stop blinking varies - a lot. As I type this it's been at least ten minutes since a reboot and it's still blinking. Anyway, I pulled up the Pour List and here's what it's seeing: 0 amount pours on every tap pin. Explains why it's not deducting anything from the sample kegs!

1679257393898.png


As familiar with the original R'Pints as I am, now I am unsure where to look for this problem and thus basically stuck. Advise would be appreciated.


And as long as I'm here, some things I've noted so far:

- there are a max of 4 temperature sensors allowed. My current keezer tracks 5 sensors (floor level, lid level, keg, tower and room). I would enjoy seeing that 4 sensor limit increased to 5 :)

- also, wrt the temperature sensors, what is the "State Pin" shown in the template? My sensors are wired to RPi GPIO 4 (pin 7 ) and when I look at the Temperature History the temperature logging appears to be functional even with all "State Pins" left at "0".

1679252085788.png


- wrt the Motion Sensor setup: my PIR is on RPi GPIO 9 (pin 21) with its LED on RPi GPIO 10 (pin 19). My old R'Pints setup plays a short audio clip on wake-up and it appears this new setup could do that as well, but it isn't obvious how to input an audio file name and where the file has to be located. Also, what is the significance of "Priority" and how does one use that setting?

1679253068032.png


I disabled my own working python sketch that implements the PIR and LED with audio playback (via a system call to mpg321 passing the audio file name) and verified it's not running. While it then seemed like the new R'Pints installation is using the PIR to un-blank the display (good) it doesn't seem like it is using the LED (in fact the LED has a soft glow that suggests its IO pin was not configured properly).

And if I enter an audio file name in the "Sound File" box and put the file at the R'Pints root folder (/var/www/html/rpints) I don't get any sound. I tried providing the full path (/var/www/html/rpints.bubbles.mp3) with no joy. And what about the "LED Pin"? Should I be using the GPIO names instead of Pin Numbers"?

Then I looked at the Log page and holy cow!

DateProcessCategoryTextOccurances
2023-03-19 16:32:20PintDispatchIflowmonitor aborted, restarting...204
2023-03-19 16:32:22PintDispatchIserial connection stopped...174
2023-03-19 16:31:39FlowMonitorIUnable to run Motion Detection:Conflicting edge detection already enabled for this GPIO channel2
2023-03-19 16:31:24FlowMonitorI1Wire Temperature Thread 1 is Running2
2023-03-19 16:31:24FlowMonitorIMotion Detector MD-Motion is Running2
2023-03-19 16:31:08FlowMonitorIUnable to run Motion Detection:Conflicting edge detection already enabled for this GPIO channel2
2023-03-19 16:30:53FlowMonitorI1Wire Temperature Thread 1 is Running2
2023-03-19 16:30:53FlowMonitorIMotion Detector MD-Motion is Running2
2023-03-19 16:30:38FlowMonitorIUnable to run Motion Detection:Conflicting edge detection already enabled for this GPIO channel2
2023-03-19 16:30:36FlowMonitorIMotion Detector MD-Motion is Running2
2023-03-19 16:30:21FlowMonitorI1Wire Temperature Thread 1 is Running1

The counts for the two top entries are rising with each second. Woof.

- Ending this on a positive note, I looked through the super long primary "Configuration" page numerous times to see how to disable the Accolades column. With all the other customization settings I was surprised I couldn't find a switch and I was going to request that it be added (already typed it up here even :)) but then I stumbled onto the "Customize Tap Display" and there it was in all its glory! Thanks! :ban:

Otherwise...hmmm....no idea what's going on here now...

Cheers!

[edit/ps] After a reboot I checked the log file again and it looks "better"

Raspberry Pints Log​


DateProcessCategoryTextOccurances
2023-03-19 16:45:08FlowMonitorI1Wire Temperature Thread 1 is Running1
2023-03-19 16:45:08FlowMonitorIMotion Detector MD-Motion is Running1
2023-03-19 16:45:07PintDispatchINot Configured to run Fan1
2023-03-19 16:45:07PintDispatchIFan Control fanControl1 is Running1
2023-03-19 16:45:07PintDispatchIstarting fan control1
2023-03-19 16:45:07PintDispatchIstarting command server1
2023-03-19 16:45:07PintDispatchIstarting device monitors...1
2023-03-19 16:45:07PintDispatchIstarting WS server1
2023-03-19 16:44:59FlowMonitorICould not import RFID Reader, RFID disabled. Assuming SPI not installed/configured

...but the Pour List entries are still all "zero"...
 
Last edited:
Aw, crap. I just realized there is no default settings for the flow meter ticks vs volume - they're all set to zero by default!
Anyone remember what the ticks per gallon is for Swissflow meters? :D

Cheers!

[edit] The answer is 21888 ticks per gallon

And I managed to get one pour out before things blew up again:

Raspberry Pints Log​


DateProcessCategoryTextOccurances
2023-03-19 17:08:01PintDispatchIserial connection stopped...36
2023-03-19 17:08:00PintDispatchIflowmonitor aborted, restarting...40
2023-03-19 17:06:22FlowMonitorIMotion Detector MD-Motion is Running3
2023-03-19 17:06:22FlowMonitorIUnable to run Motion Detection:Conflicting edge detection already enabled for this GPIO channel4
2023-03-19 16:58:13FlowMonitorIMotion Detector MD-Motion is Running2
2023-03-19 16:45:08FlowMonitorI1Wire Temperature Thread 1 is Running1
2023-03-19 16:45:07PintDispatchINot Configured to run Fan1
2023-03-19 16:45:07PintDispatchIFan Control fanControl1 is Running1
2023-03-19 16:45:07PintDispatchIstarting fan control1
2023-03-19 16:45:07PintDispatchIstarting command server1
2023-03-19 16:45:07PintDispatchIstarting device monitors...1
2023-03-19 16:45:07PintDispatchIstarting WS server1
2023-03-19 16:44:59FlowMonitorICould not import RFID Reader, RFID disabled. Assuming SPI not installed/configured
 
Last edited:
I just realized there is no default settings for the flow meter ticks vs volume - they're all set to zero by default
ya that was going to be my suggestion because it looks like it was always registering a pour causing the refresh. I will update the test data to put something in the count column
- there are a max of 4 temperature sensors allowed. My current keezer tracks 5 sensors (floor level, lid level, keg, tower and room). I would enjoy seeing that 4 sensor limit increased to 5
I dont have any hardcoded limit, the temperature thread just reads the folders like /sys/bus/w1/devices/28*/w1_slave and adds them to RPints

what is the "State Pin" shown in the template
there was a request to record a pin state when the temp was taken so external factors can be checked. Like if the condenser is running or if a fan is running. leaving it 0 is fine.

but it isn't obvious how to input an audio file name and where the file has to be located
I recommend using the full path to the file. Can you compare your python code to trigger the sound to mine? FlowMonitor.py line 703
os.system(mpg321 + self.soundFile)

I dont use motion detector outside of testing to make sure they worked in the new logic so it could be my code is wrong

what is the significance of "Priority" and how does one use that setting?
its just the order the motion detectors are loaded in. Really doesnt have any affect since they each are their own thread and wouldnt affect each other.
And what about the "LED Pin"?
All pins are accessed the same way, RPints used GPIO.BOARD pin numbering. In the admin screen you can go under advanced hardware -> Hardware IO Display, it shows you a graphical layout of the PI and the shields GPIO and whats configured to use each pin. the motion detector is called PIR Test Trigger
 
Wow, thanks for the quick response! Good news on the sensors, I do only have four ds18b20s on that system only because my desktop 1wire kluge only has four sockets.

And apparently I managed to properly make the pin assignments for the PIR and its LED - I am certain that the PIR is unblanking the monitor as I can manually blank it and have the PIR wake it back up. So aside from not lighting the LED and not playing the sound file it's basically working :)

My python code for the PIR:

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 = 7
STATUS_PIN = 8
GPIO.setup(PIR_PIN, GPIO.IN)
GPIO.setup(STATUS_PIN, GPIO.OUT)

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

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

except KeyboardInterrupt:
    GPIO.cleanup()

GPIO.cleanup()

So it looks like you covered pretty much everything I wondered about, except to speculate on what is causing the home page "blinking".
It appears to be a continuous screen refresh on 1~2 second period. Is it possible there is a screen refresh setting somewhere I haven't set that could explain that?

Thanks again for the reply!

Cheers!
 
not playing the sound file it's basically working
I think the issue is in my code, i think i need to make mpg321 a string. Code you replace line 703 of FlowMonitor.py with
os.system('mpg321 ' + self.soundFile)
and test.

For the LED, we should verify the pin is attempting to update. In PintDispatch.py uncomment line 705 then in Config.py set
config['dispatch.debug' ] = True
This we enable more logging then you test trigger the PIR we can review logs to see the pin was writen.

what is causing the home page "blinking"
I wonder if the python is triggering the refresh. the easiest way to know is to stop the python, then refresh the screen if it stops blinking, start the python and refresh to see if it starts blinking again.

There is a refresh timer option, but thats hardcoded to 60 seconds.
 
fwiw, I did try playing with the "refresh listeners automatically" and the "Refresh the tap list every 60 seconds" with no changes.

A bit more data (maybe) on the screen blinking: I was about to take the attached video because it looked interesting with the top right corner alternating between temperature display and the R'Pints logo with each blink (I had just enabled the latter to see where the logo would show up on the page). But just as I was about to hit the record button it stopped blinking.

I was going to reboot the machine using the management gui but saw the "Restart Flowmeter Service" and figured "Why not?" A couple of seconds after clicking it, this is what happened next:



Now, eventually it stopped blinking like that again, but nothing changed when I clicked the "Restart Flowmeter Service" this time. I also noticed now that the screen wasn't going nuts that it was slowly alternating between the temperature vs logo, and thought perhaps this is intentional (which is fine by me - it's actually kind of cool :))

Anyway...I was hoping there was some correlation between flowmeter functions and the screen blink thing but now I don't think so.

I will do the stuff you asked for and get back shortly.

Thanks!

Cheers!
 
Ok, more info:

- I reboot the system then pull up R'Pints on my workstation and the home screen blinks. SSH'd in and as soon as I stop the flowmon service the screen blink immediately halts and the home page goes into that looping between temperature and logo. Leaving the home page in the browser and starting the flowmon service via SSH did not inspire the screen blinking again.

Repeated the same process except this time I used the management gui to restart the flowmon service, and it didn't restart the home page blinking either.

Finally, I repeated the reboot, stopped the blinking with an SSH flowmon stop, start the flowmon again via SSH, then execute one pour. Nothing happens on the home page until I refresh the page and then the blinking starts. This is repeatable - I went through it three times straight - the last time waiting like 30 seconds to see if the display showed the pour (it didn't) - and the exact same things happen.

- I made the edit to line 703 of FlowMonitor.py. Rebooted the machine, got to where motion should work, then checked if sound came out via either hdmi or analog jack. But neither one makes a peep when the screen wakes back up.

Btw - it seemed that stopping the flowmon service also stopped the motion detection function. Is that correct?

- Made the edits to PintDispatch.py and Config.py.

Here's the rpints.log file after a restart, edited for brevity...

Code:
2023-03-20 14:49:05 RPINTS: Could not import RFID Reader, RFID disabled. Assuming SPI not installed/configured
2023-03-20 14:49:07 RPINTS: starting setup...
2023-03-20 14:49:07 RPINTS: update pin 12 from 1 to 0
2023-03-20 14:49:07 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 14:49:08 RPINTS: update pin 12 from 0 to 1
2023-03-20 14:49:08 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 14:49:14 RPINTS: starting WS server
2023-03-20 14:49:14 RPINTS: starting device monitors...
2023-03-20 14:49:14 RPINTS: starting command server
2023-03-20 14:49:14 RPINTS: starting fan control
2023-03-20 14:49:14 RPINTS: Fan Control fanControl1 is Running
2023-03-20 14:49:14 RPINTS: update pin 12 from 1 to 0
2023-03-20 14:49:14 RPINTS: Not Configured to run Fan
2023-03-20 14:49:14 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 14:49:15 RPINTS: update pin 12 from 0 to 1
2023-03-20 14:49:15 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 14:49:15 RPINTS: Motion Detector MD-Motion is Running
2023-03-20 14:49:15 RPINTS: 1Wire Temperature Thread 1 is Running
2023-03-20 14:49:17 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 14:49:17 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 14:49:17 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 14:49:17 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 14:49:17 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 14:49:17 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 14:49:17 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 14:49:18 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 14:49:18 RPINTS: valve update: RPU:VALVE:-1=1

[roughly 250 more entries like these - removed]

2023-03-20 14:51:29 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 14:51:30 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 14:51:33 RPINTS: valve update: RPU:VALVE:-1=0
 Pourpour on pin: 2, count: 331, conversion: 21888, amount: 0.015122441520468, amountUnit: oz, user: N/A
2023-03-20 14:51:34 RPINTS: restarting fan timer after pour
2023-03-20 14:51:34 RPINTS: count update: RPU:FLOW:2=331:-1
 PourIgnoring Kick Keg from 1
2023-03-20 14:51:34 RPINTS: Kicking Keg: RPU:KICK:2
2023-03-20 14:51:34 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 14:51:37 RPINTS: valve update: RPU:VALVE:-1=0
 Pourpour on pin: 2, count: 501, conversion: 21888, amount: 0.022889254385965, amountUnit: oz, user: N/A
2023-03-20 14:51:37 RPINTS: count update: RPU:FLOW:2=501:-1
 PourIgnoring Kick Keg from 1
2023-03-20 14:51:38 RPINTS: Kicking Keg: RPU:KICK:2
2023-03-20 14:51:38 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 14:51:41 RPINTS: valve update: RPU:VALVE:-1=0
 Pourpour on pin: 2, count: 727, conversion: 21888, amount: 0.033214546783626, amountUnit: oz, user: N/A
2023-03-20 14:51:41 RPINTS: count update: RPU:FLOW:2=727:-1
 PourIgnoring Kick Keg from 1
2023-03-20 14:51:42 RPINTS: Kicking Keg: RPU:KICK:2
2023-03-20 14:51:42 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 14:51:45 RPINTS: valve update: RPU:VALVE:-1=0
 Pourpour on pin: 2, count: 837, conversion: 21888, amount: 0.038240131578947, amountUnit: oz, user: N/A
2023-03-20 14:51:45 RPINTS: count update: RPU:FLOW:2=837:-1
 PourIgnoring Kick Keg from 1
2023-03-20 14:51:46 RPINTS: Kicking Keg: RPU:KICK:2
2023-03-20 14:51:46 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 14:51:49 RPINTS: valve update: RPU:VALVE:-1=0
 Pourpour on pin: 2, count: 960, conversion: 21888, amount: 0.043859649122807, amountUnit: oz, user: N/A
2023-03-20 14:51:50 RPINTS: count update: RPU:FLOW:2=960:-1
 PourIgnoring Kick Keg from 1
2023-03-20 14:51:51 RPINTS: Kicking Keg: RPU:KICK:2
2023-03-20 14:51:51 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 14:51:54 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 14:51:57 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 14:52:00 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 14:52:03 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 14:52:07 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 14:52:10 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 14:52:13 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 14:52:16 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 14:52:19 RPINTS: valve update: RPU:VALVE:-1=0
 Pourpour on pin: 2, count: 17182, conversion: 21888, amount: 0.78499634502924, amountUnit: oz, user: N/A
2023-03-20 14:52:20 RPINTS: count update: RPU:FLOW:2=17182:-1
 PourIgnoring Kick Keg from 1
2023-03-20 14:52:20 RPINTS: Kicking Keg: RPU:KICK:2
2023-03-20 14:52:20 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 14:52:23 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 14:52:24 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 14:52:24 RPINTS: valve update: RPU:VALVE:-1=0

[roughly another 80 more entries like these - removed]

R'Pints adds those "valve update" messages one line for each screen blink :)

Cheers!
 
Another thing wrt main page blink: assuming a fresh start and the main page is blinking, if I SSH in and stop flowmon service, then go into the management gui and immediately exit back to the main page, the blinking starts again. 100% repeatable, which seems weird.

Also, I have "keg kicks" disabled. Seeing those "2023-03-20 14:52:20 RPINTS: Kicking Keg: RPU:KICK:2" sure looks like flowmon wants kegs kicked for some reason but I guess the "PourIgnoring Kick Keg from 1" messages mean the "no keg kicks" setting works? I'm definitely not losing kegs off the six I have "tapped".

And then there's the hundreds of "valve update" messages when none of the "Use...Valves" settings are checked that's a curiosity to me, knowing nothing about how all this works :)

Cheers!
 
Ah, more data to share: not sure what triggered this but now the rpints.log file is full of them.
Also captured a Motion Detector event...

Code:
2023-03-20 15:24:31 RPINTS: flowmonitor aborted, restarting...
2023-03-20 15:24:31 RPINTS: update pin 12 from 1 to 0
2023-03-20 15:24:31 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 15:24:32 RPINTS: update pin 12 from 0 to 1
2023-03-20 15:24:32 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 15:24:32 RPINTS: Motion Detector MD-Motion is Running
2023-03-20 15:24:32 RPINTS: Unable to run Motion Detection:Conflicting edge detection already enabled for this GPIO channel
2023-03-20 15:24:32 RPINTS: serial connection stopped...
2023-03-20 15:24:32 RPINTS: can't start new thread
2023-03-20 15:24:32 RPINTS: Traceback (most recent call last):
  File "/var/www/html/rpints/python/PintDispatch.py", line 592, in spawn_flowmonitor
    self.flowmonitor.monitor(self.useOption("useFlowMeter"))
  File "/var/www/html/rpints/python/FlowMonitor.py", line 315, in monitor
    self.reconfigTempProbes()
  File "/var/www/html/rpints/python/FlowMonitor.py", line 533, in reconfigTempProbes
    self.tempProbeThread.start()
  File "/usr/lib/python3.9/threading.py", line 874, in start
    _start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
 
slowly alternating between the temperature vs logo, and thought perhaps this is intentional
Yep i designated the right header location to be flexible and rotate information there automatically, it switches on each refresh which is why it was changing during the blinking. It has a lot of information it could display (fermenters/gas tanks/clock) but it should not be causing the full page refresh.
Leaving the home page in the browser and starting the flowmon service via SSH did not inspire the screen blinking again.
the home page losses connection to the python when the python stops and it does not automatically retry. So this points to something in the python triggering the refresh. I think what is happening is the LED is trying to update the database that its on or off. That is why you see the
valve update: RPU:VALVE:-1
in the logs over and over, the way to be sure is to add this line in FlowMonitor.py line 368
log(msg)
this should add new line like UP;<1 or 0?;<pin>;<Text>
that Text part will be the function that updated the pins.
I know there isnt logic to exclude the LED from triggering a refresh so its logical that is whats happening.
I dont use the LED as its the same pin for the SPI for my RFID reader.


flowmon service also stopped the motion detection function. I
Yes i put all functionality into one service so it all starts/stops together.
 
Ok, I'll make that file change to FlowMonitor.py line 368 adding log(msg)

While I do that I came to post this log fragment. This looks a little different than the previous one.
Not sure if I caused it - I didn't make any changes since the prior log...

Code:
2023-03-20 15:11:33 RPINTS: Could not import RFID Reader, RFID disabled. Assuming SPI not installed/configured
2023-03-20 15:11:35 RPINTS: starting setup...
2023-03-20 15:11:35 RPINTS: update pin 12 from 1 to 0
2023-03-20 15:11:35 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 15:11:36 RPINTS: update pin 12 from 0 to 1
2023-03-20 15:11:36 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 15:11:42 RPINTS: starting WS server
2023-03-20 15:11:42 RPINTS: starting device monitors...
2023-03-20 15:11:42 RPINTS: starting command server
2023-03-20 15:11:42 RPINTS: starting fan control
2023-03-20 15:11:42 RPINTS: Fan Control fanControl1 is Running
2023-03-20 15:11:42 RPINTS: update pin 12 from 1 to 0
2023-03-20 15:11:42 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 15:11:42 RPINTS: Not Configured to run Fan
2023-03-20 15:11:43 RPINTS: update pin 12 from 0 to 1
2023-03-20 15:11:43 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 15:11:43 RPINTS: Motion Detector MD-Motion is Running
2023-03-20 15:11:43 RPINTS: 1Wire Temperature Thread 1 is Running
2023-03-20 15:11:45 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 15:11:45 RPINTS: valve update: RPU:VALVE:-1=1

            [roughly 400 more lines like these - removed]

2023-03-20 15:15:48 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 15:15:48 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 15:15:49 RPINTS: valve update: RPU:VALVE:-1=1
Unexpected error: <class 'RuntimeError'>
Traceback (most recent call last):
  File "/var/www/html/rpints/python/FlowMonitor.py", line 332, in monitor
    if not self.processMsg(msg):
  File "/var/www/html/rpints/python/FlowMonitor.py", line 451, in processMsg
    UpdatePinsThread("UP", reading, self.dispatch).start()
  File "/usr/lib/python3.9/threading.py", line 874, in start
    _start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
2023-03-20 15:15:50 RPINTS: flowmonitor aborted, restarting...
2023-03-20 15:15:50 RPINTS: update pin 12 from 1 to 0
2023-03-20 15:15:50 RPINTS: valve update: RPU:VALVE:-1=0
Traceback (most recent call last):
  File "/usr/lib/python3.9/socketserver.py", line 316, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python3.9/socketserver.py", line 665, in process_request
    t.start()
  File "/usr/lib/python3.9/threading.py", line 874, in start
    _start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
[2023-03-20 15:15:51,683] [ERROR] mod_pywebsocket.standalone.WebSocketServer: Exception in processing request from: ('::ffff:192.168.1.1', 50970, 0, 0)
None
2023-03-20 15:15:51 RPINTS: update pin 12 from 0 to 1
2023-03-20 15:15:51 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 15:15:52 RPINTS: serial connection stopped...
2023-03-20 15:15:52 RPINTS: can't start new thread
2023-03-20 15:15:52 RPINTS: Traceback (most recent call last):
  File "/var/www/html/rpints/python/PintDispatch.py", line 592, in spawn_flowmonitor
    self.flowmonitor.monitor(self.useOption("useFlowMeter"))
  File "/var/www/html/rpints/python/FlowMonitor.py", line 277, in monitor
    detector.start()
  File "/usr/lib/python3.9/threading.py", line 874, in start
    _start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread

2023-03-20 15:15:53 RPINTS: flowmonitor aborted, restarting...
2023-03-20 15:15:53 RPINTS: update pin 12 from 1 to 0
2023-03-20 15:15:53 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 15:15:54 RPINTS: update pin 12 from 0 to 1
2023-03-20 15:15:54 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 15:15:54 RPINTS: serial connection stopped...
2023-03-20 15:15:54 RPINTS: can't start new thread
2023-03-20 15:15:54 RPINTS: Traceback (most recent call last):
  File "/var/www/html/rpints/python/PintDispatch.py", line 592, in spawn_flowmonitor
    self.flowmonitor.monitor(self.useOption("useFlowMeter"))
  File "/var/www/html/rpints/python/FlowMonitor.py", line 277, in monitor
    detector.start()
  File "/usr/lib/python3.9/threading.py", line 874, in start
    _start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread

2023-03-20 15:15:55 RPINTS: flowmonitor aborted, restarting...

Cheers!
 
Umm...I'm not sure where you wanted that edit to be.
Do I insert 'log(msg)' as a new line before 'reading...', append it to the existing line, or do I replace line 368?

367 def processMsg(self, msg):
368 reading = msg.split(";")
369 if reading[0] == "alive" :
370 debug(msg)

Thanks!
 
Do I insert 'log(msg)' as a new line before 'reading...', append it to the existing line, or do I replace line 368?
sorry, insert log(msg) before reading
1679341793597.png


as for the other exceptions that are occurring i think it may be trying to spawn too many threads which means there are threads not exiting like they should. i will dig into on my side
 
Arrgh. If I indent exactly as shown above and then restart the flowmon service the process abends with an indent error not matching.
I tried using tabs, tried using spaces. No joy. What is that new line supposed to line up with?

Code:
Traceback (most recent call last):
  File "/var/www/html/rpints/python/PintDispatch.py", line 25, in <module>
    from FlowMonitor import FlowMonitor
  File "/var/www/html/rpints/python/FlowMonitor.py", line 369
    reading = msg.split(";")
                            ^
IndentationError: unindent does not match any outer indentation level


This fails:

1679343429415.png
 
Got it working. The problem apparently was the next lines used all leading spaces/no tabs. Grrr!

Code:
2023-03-20 16:25:00 RPINTS: Could not import RFID Reader, RFID disabled. Assuming SPI not installed/configured
2023-03-20 16:25:02 RPINTS: starting setup...
2023-03-20 16:25:02 RPINTS: update pin 12 from 0 to 1
2023-03-20 16:25:02 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 16:25:03 RPINTS: update pin 12 from 1 to 0
2023-03-20 16:25:03 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 16:25:09 RPINTS: starting WS server
2023-03-20 16:25:09 RPINTS: starting device monitors...
2023-03-20 16:25:09 RPINTS: starting command server
2023-03-20 16:25:09 RPINTS: starting fan control
2023-03-20 16:25:09 RPINTS: Fan Control fanControl1 is Running
2023-03-20 16:25:09 RPINTS: update pin 12 from 1 to 0
2023-03-20 16:25:09 RPINTS: Not Configured to run Fan
2023-03-20 16:25:09 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 16:25:10 RPINTS: update pin 12 from 0 to 1
2023-03-20 16:25:10 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 16:25:10 RPINTS: Motion Detector MD-Motion is Running
2023-03-20 16:25:10 RPINTS: 1Wire Temperature Thread 1 is Running
2023-03-20 16:25:12 RPINTS: UP;1;1;2;setup
2023-03-20 16:25:12 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 16:25:12 RPINTS: UP;1;1;5;setup
2023-03-20 16:25:12 RPINTS: UP;1;1;6;setup
2023-03-20 16:25:12 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 16:25:12 RPINTS: UP;1;1;7;setup
2023-03-20 16:25:12 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 16:25:12 RPINTS: UP;1;1;8;setup
2023-03-20 16:25:12 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 16:25:12 RPINTS: UP;1;1;9;setup
2023-03-20 16:25:12 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 16:25:12 RPINTS: StatusCheck;
2023-03-20 16:25:12 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 16:25:12 RPINTS: UP;1;1;13;LED
2023-03-20 16:25:12 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 16:25:12 RPINTS: StatusCheck;
2023-03-20 16:25:13 RPINTS: UP;0;1;13;LED
2023-03-20 16:25:13 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 16:25:13 RPINTS: StatusCheck;
2023-03-20 16:25:13 RPINTS: UP;1;1;13;LED
2023-03-20 16:25:13 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 16:25:13 RPINTS: StatusCheck;
2023-03-20 16:25:14 RPINTS: UP;0;1;13;LED
2023-03-20 16:25:14 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 16:25:14 RPINTS: StatusCheck;
2023-03-20 16:25:14 RPINTS: UP;1;1;13;LED
2023-03-20 16:25:14 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 16:25:15 RPINTS: StatusCheck;
2023-03-20 16:25:15 RPINTS: UP;0;1;13;LED
2023-03-20 16:25:15 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 16:25:15 RPINTS: StatusCheck;
2023-03-20 16:25:15 RPINTS: UP;1;1;13;LED
2023-03-20 16:25:15 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 16:25:16 RPINTS: StatusCheck;
2023-03-20 16:25:16 RPINTS: UP;0;1;13;LED
2023-03-20 16:25:16 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 16:25:17 RPINTS: UP;1;1;13;LED
2023-03-20 16:25:17 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 16:25:17 RPINTS: StatusCheck;
2023-03-20 16:25:17 RPINTS: UP;0;1;13;LED
2023-03-20 16:25:17 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 16:25:17 RPINTS: StatusCheck;
2023-03-20 16:25:18 RPINTS: UP;1;1;13;LED
2023-03-20 16:25:18 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 16:25:18 RPINTS: UP;0;1;13;LED
2023-03-20 16:25:18 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 16:25:19 RPINTS: StatusCheck;
2023-03-20 16:25:19 RPINTS: UP;1;1;13;LED
2023-03-20 16:25:19 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 16:25:19 RPINTS: StatusCheck;

Bunch more of those valve related messages deleted...

Cheers!
 
Bunch more of those valve related messages deleted
Thats good, I can see that it is in fact the LED flashing causing the issue.

I just committed a change to the Arduino logic to stop sending update when for the LED. The update was for when values are on the arduino pins so Rpints home page can show if they are open or not and i never accounted for the LED.
 
What's the best way to grab that update?
in the admin's Install page there is an Get Latest RPints option. it will download the latest from GitHub, or you can rerun the installer and do the update option. The Installer will automatically backup your files then run kompare so if you have customization you can see them and put them back in.

Otherwise just go to RaspberryPints/arduino/raspberrypints at master · rtlindne/RaspberryPints and download those 2 files and put them in your arduino/raspberrypints/ folder on the pi, then restart the service. Unless you modified the flowmonitor.py it will automatically upload the hex to the alamode on startup.
 
Ok, I had to resurrect my Github account to grab those two files. Stuck them where they belonged, restarted the flowmon service, and observed what appeared to be an upload. The LED behavior is now quite different - once the upload completes the LED doesn't light up again even when a pour is happening. Unfortunately, it didn't stop the screen blinking. All of the previously noted behavior remains.

Here are a couple of chunks of rpints.log. First one is after a fresh boot:

Code:
2023-03-20 17:15:26 RPINTS: Could not import RFID Reader, RFID disabled. Assuming SPI not installed/configured
2023-03-20 17:15:28 RPINTS: starting setup...
2023-03-20 17:15:28 RPINTS: update pin 12 from 0 to 1
2023-03-20 17:15:28 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 17:15:29 RPINTS: update pin 12 from 1 to 0
2023-03-20 17:15:29 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 17:15:35 RPINTS: starting WS server
2023-03-20 17:15:35 RPINTS: starting device monitors...
2023-03-20 17:15:35 RPINTS: starting command server
2023-03-20 17:15:35 RPINTS: starting fan control
2023-03-20 17:15:35 RPINTS: Fan Control fanControl1 is Running
2023-03-20 17:15:35 RPINTS: update pin 12 from 1 to 0
2023-03-20 17:15:35 RPINTS: Not Configured to run Fan
2023-03-20 17:15:35 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 17:15:36 RPINTS: update pin 12 from 0 to 1
2023-03-20 17:15:36 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 17:15:36 RPINTS: Motion Detector MD-Motion is Running
2023-03-20 17:15:36 RPINTS: 1Wire Temperature Thread 1 is Running
2023-03-20 17:15:38 RPINTS: UP;1;1;2;setup
2023-03-20 17:15:38 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 17:15:38 RPINTS: UP;1;1;5;setup
2023-03-20 17:15:38 RPINTS: UP;1;1;6;setup
2023-03-20 17:15:38 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 17:15:38 RPINTS: UP;1;1;7;setup
2023-03-20 17:15:38 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 17:15:38 RPINTS: UP;1;1;8;setup
2023-03-20 17:15:38 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 17:15:38 RPINTS: UP;1;1;9;setup
2023-03-20 17:15:38 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 17:15:38 RPINTS: StatusCheck;
2023-03-20 17:15:38 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 17:15:38 RPINTS: UP;0;1;13;LED
2023-03-20 17:15:38 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 17:15:38 RPINTS: StatusCheck;
2023-03-20 17:15:39 RPINTS: UP;0;1;13;LED
2023-03-20 17:15:39 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 17:15:39 RPINTS: StatusCheck;
2023-03-20 17:15:39 RPINTS: UP;0;1;13;LED
2023-03-20 17:15:39 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 17:15:39 RPINTS: StatusCheck;
2023-03-20 17:15:40 RPINTS: UP;0;1;13;LED
2023-03-20 17:15:40 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 17:15:40 RPINTS: StatusCheck;
2023-03-20 17:15:40 RPINTS: UP;0;1;13;LED
2023-03-20 17:15:40 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 17:15:40 RPINTS: StatusCheck;
2023-03-20 17:15:41 RPINTS: UP;0;1;13;LED
2023-03-20 17:15:41 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 17:15:41 RPINTS: StatusCheck;
2023-03-20 17:15:41 RPINTS: UP;0;1;13;LED
2023-03-20 17:15:41 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 17:15:42 RPINTS: StatusCheck;
2023-03-20 17:15:42 RPINTS: UP;0;1;13;LED
2023-03-20 17:15:42 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 17:15:42 RPINTS: UP;0;1;13;LED
2023-03-20 17:15:42 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 17:15:43 RPINTS: StatusCheck;
2023-03-20 17:15:43 RPINTS: UP;0;1;13;LED
2023-03-20 17:15:43 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 17:15:43 RPINTS: StatusCheck;
2023-03-20 17:15:43 RPINTS: UP;0;1;13;LED
2023-03-20 17:15:43 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 17:15:44 RPINTS: StatusCheck;
2023-03-20 17:15:44 RPINTS: UP;0;1;13;LED
2023-03-20 17:15:44 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 17:15:45 RPINTS: UP;0;1;13;LED
2023-03-20 17:15:45 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 17:15:45 RPINTS: StatusCheck;
2023-03-20 17:15:45 RPINTS: UP;0;1;13;LED
2023-03-20 17:15:45 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 17:15:45 RPINTS: StatusCheck;
2023-03-20 17:15:46 RPINTS: UP;0;1;13;LED
2023-03-20 17:15:46 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 17:15:46 RPINTS: UP;0;1;13;LED
2023-03-20 17:15:46 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 17:15:47 RPINTS: StatusCheck;
2023-03-20 17:15:47 RPINTS: UP;0;1;13;LED
2023-03-20 17:15:47 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 17:15:47 RPINTS: StatusCheck;
2023-03-20 17:15:47 RPINTS: U;-1;2;251
2023-03-20 17:15:47 RPINTS: StatusCheck;
2023-03-20 17:15:48 RPINTS: U;-1;2;514
2023-03-20 17:15:48 RPINTS: StatusCheck;
2023-03-20 17:15:48 RPINTS: U;-1;2;777
2023-03-20 17:15:48 RPINTS: StatusCheck;
2023-03-20 17:15:48 RPINTS: U;-1;2;1040
2023-03-20 17:15:48 RPINTS: StatusCheck;
2023-03-20 17:15:49 RPINTS: U;-1;2;1302
2023-03-20 17:15:49 RPINTS: StatusCheck;
2023-03-20 17:15:49 RPINTS: U;-1;2;1566
2023-03-20 17:15:49 RPINTS: StatusCheck;
2023-03-20 17:15:50 RPINTS: UP;0;1;13;LED
2023-03-20 17:15:50 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 17:15:50 RPINTS: StatusCheck;
2023-03-20 17:15:50 RPINTS: P;-1;2;1669
 Pourpour on pin: 2, count: 1669, conversion: 21888, amount: 0.07625182748538, amountUnit: oz, user: N/A
2023-03-20 17:15:51 RPINTS: restarting fan timer after pour
2023-03-20 17:15:51 RPINTS: count update: RPU:FLOW:2=1669:-1
2023-03-20 17:15:51 RPINTS: K;-1;2
 PourIgnoring Kick Keg from 1
2023-03-20 17:15:51 RPINTS: Kicking Keg: RPU:KICK:2
2023-03-20 17:15:51 RPINTS: Debug;RT L 2 0 12699 12398 301 300 1669 200
2023-03-20 17:15:51 RPINTS: UP;0;1;13;LED

There were a whole lot of "valve update" and "Status Check" and "UP...LED" messages. The LED messages are always the same as the one already shown and the single LED blinks don't happen anymore.


This one shows something bad happened later and the system didn't recover. The LED blinked like it was repeatedly uploading the sketch and I eventually stopped it just in case it really was trying to write the Arduino program store over and over.

Code:
2023-03-20 17:19:28 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 17:19:29 RPINTS: StatusCheck;
2023-03-20 17:19:29 RPINTS: UP;0;1;13;LED
Unexpected error: <class 'RuntimeError'>
Traceback (most recent call last):
  File "/var/www/html/rpints/python/FlowMonitor.py", line 332, in monitor
    if not self.processMsg(msg):
  File "/var/www/html/rpints/python/FlowMonitor.py", line 452, in processMsg
    UpdatePinsThread("UP", reading, self.dispatch).start()
  File "/usr/lib/python3.9/threading.py", line 874, in start
    _start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
2023-03-20 17:19:30 RPINTS: flowmonitor aborted, restarting...
2023-03-20 17:19:30 RPINTS: update pin 12 from 1 to 0
2023-03-20 17:19:30 RPINTS: valve update: RPU:VALVE:-1=0
Traceback (most recent call last):
  File "/usr/lib/python3.9/socketserver.py", line 316, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python3.9/socketserver.py", line 665, in process_request
    t.start()
  File "/usr/lib/python3.9/threading.py", line 874, in start
    _start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
[2023-03-20 17:19:31,004] [ERROR] mod_pywebsocket.standalone.WebSocketServer: Exception in processing request from: ('::ffff:192.168.1.1', 56524, 0, 0)
None
2023-03-20 17:19:31 RPINTS: update pin 12 from 0 to 1
2023-03-20 17:19:31 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 17:19:31 RPINTS: serial connection stopped...
2023-03-20 17:19:31 RPINTS: can't start new thread
2023-03-20 17:19:31 RPINTS: Traceback (most recent call last):
  File "/var/www/html/rpints/python/PintDispatch.py", line 592, in spawn_flowmonitor
    self.flowmonitor.monitor(self.useOption("useFlowMeter"))
  File "/var/www/html/rpints/python/FlowMonitor.py", line 277, in monitor
    detector.start()
  File "/usr/lib/python3.9/threading.py", line 874, in start
    _start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread

2023-03-20 17:19:32 RPINTS: flowmonitor aborted, restarting...
2023-03-20 17:19:32 RPINTS: update pin 12 from 1 to 0
2023-03-20 17:19:32 RPINTS: valve update: RPU:VALVE:-1=0
2023-03-20 17:19:33 RPINTS: update pin 12 from 0 to 1
2023-03-20 17:19:33 RPINTS: valve update: RPU:VALVE:-1=1
2023-03-20 17:19:34 RPINTS: serial connection stopped...
2023-03-20 17:19:34 RPINTS: can't start new thread
2023-03-20 17:19:34 RPINTS: Traceback (most recent call last):
  File "/var/www/html/rpints/python/PintDispatch.py", line 592, in spawn_flowmonitor
    self.flowmonitor.monitor(self.useOption("useFlowMeter"))
  File "/var/www/html/rpints/python/FlowMonitor.py", line 277, in monitor
    detector.start()
  File "/usr/lib/python3.9/threading.py", line 874, in start
    _start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread

Bottom line, problem remains. I'm wondering if the "update pin 12" lines are causing this?

Cheers!
 
I forgot to mention that I tried clicking the "update" button in the management gui and it said it had done something but when I restarted the flowmon service LED 13 was doing the same stuff it had done prior. That's when I pulled the entire kit over and pushed the two files to my R'Pints tree.

Anyway, I just wanted to add that there is no real urgency and I don't expect to have you on blast :D
Get to it at your leisure, please!

Cheers!
 
The LED messages are always the same as the one already shown and the single LED blinks don't happen anymore.
i see a bug i fixed on my test system but didnt pull back to my main system to check in. It was always keeping the LED off. I comitted the correct code and hex file now.
I'm wondering if the "update pin 12" lines are causing this?
Looking at the trace i dont think so. In the log I see:
2023-03-20 17:19:29 RPINTS: UP;0;1;13;LED
and
UpdatePinsThread("UP", reading, self.dispatch).start()

which tells me its trying to create a thread to update the database based on the LED. Removing the update for hte LED should solve this but there is also an underlying question of why is there too many threads running? I did a test locally by printing out the number of threads running with the LED update Msg and it never really changed.
What version of python are you using now? I thought I was running python 3 but it looks like im only running python 2
 
I did a "bullseye from scratch" build for this try and updated until there were no more packages to update.
So:

pi@raspi9:~ $ python --version
Python 3.9.2

fwiw, there are nuances with Python 3 v 2 that caught me up, mostly punctuation stuff - but then my Python efforts hardly test the language :)
If V3 was a problem there should be fingerprints in some log file, yes?

Anyway, I'm nearly in my cups at this time and the better part of valor is to wait 'til tomorrow to check in your update.
But thank you! It'll be the second thing I do in the morning :)

Cheers!
 
btw, I could install (the last?) Python V2 if that would help.
It might require editing a few "shebangs" but there aren't that many Python files involved here :)

Cheers!
 
If V3 was a problem there should be fingerprints in some log file, yes
not if its just a new limit of threads.

I was able to get a test system with python 3 and forced the threads to last longer then they are supposed to. It recreated the exception but not the root cause as to why the threads would not exit when they are done you were seeing.
But I was able to confirm that there isnt anything wrong with the code that needs to be done to clean up the threads. I did make a change to catch that exception and ignore it since its just updating the database and i suspect threads will eventually clean themselves up. This will keep RPints running.

No need to go back to python 2.

Let me know when you test the fix for the LED and if that stops the spamming.
 
Ok, after pulling the updated cpp and hex files over and restarting the flowmon service....IT IS WORKING! Woohoo! :ban:
No more flashing screen AND the remaining volumes on the main page update immediately (that wasn't happening before).
Awesome! Thanks for working through all that! :mug:

Just an FYI because it's not a show-stopper: Here's a fragment from the log file from a pair of pours back to back. It has one of those "kick" messages that get suppressed as I disabled keg kicks. I was trying to find the threshold that triggers the kicks as it is way too low for Swissflow meters. I finally got a "pour" that didn't trigger the kick and it was only 1.84 ounces, while the triggered pour was just 2.97 ounces.

2023-03-21 11:14:26 RPINTS: P;-1;2;508
Pourpour on pin: 2, count: 508, conversion: 21888, amount: 0.023209064327485, amountUnit: oz, user: N/A
2023-03-21 11:14:26 RPINTS: count update: RPU:FLOW:2=508:-1
2023-03-21 11:14:26 RPINTS: K;-1;2
PourIgnoring Kick Keg from 1
2023-03-21 11:14:26 RPINTS: Kicking Keg: RPU:KICK:2
2023-03-21 11:14:26 RPINTS: Debug;RT L 2 0 929516 929215 301 300 508 200
2023-03-21 11:14:26 RPINTS: StatusCheck;
2023-03-21 11:15:01 RPINTS: U;-1;2;251
2023-03-21 11:15:01 RPINTS: StatusCheck;
2023-03-21 11:15:02 RPINTS: P;-1;2;314
Pourpour on pin: 2, count: 314, conversion: 21888, amount: 0.014345760233918, amountUnit: oz, user: N/A
2023-03-21 11:15:03 RPINTS: count update: RPU:FLOW:2=314:-1
2023-03-21 11:15:03 RPINTS: Debug;RT L 2 0 966115 965814 301 300 314 200
2023-03-21 11:15:03 RPINTS: StatusCheck;

Anyway, I'm going to see if there are any hints regarding the Motion detection and not playing an audio file.
This might mean something but maybe not as Motion still unblanks the screen...

2023-03-21 11:45:02 RPINTS: Motion Detector MD-Motion is Running
2023-03-21 11:45:02 RPINTS: Unable to run Motion Detection:Conflicting edge detection already enabled for this GPIO channel

Cheers!
 
Last edited:
Update: had to run a bunch of errands but am back home and at this again :)

I decided to try moving both the PIR pin and its LED pin to RPi pins 15 and 13, respectively. After committing the changes in the gui after the flowmon service restarted there are now "Motion is Running" without the "Conflicting edge detection" messages. But, still no sound is played and the "Motion LED" never lights, but at least it's not due to a conflict now.

Stumbled across a curiosity just making sure my sound drivers are working:
'mpg321 tada.mp3' plays through the hdmi port to my tv
'sudo mpg321 tada.mp3' plays through the analog jack to my headphones

What the heck?

Cheers!
 
Back
Top