• Please visit and share your knowledge at our sister communities:
  • If you have not, please join our official Homebrewing Facebook Group!

    Homebrewing Facebook Group

[Version 2 Release] RaspberryPints - Digital Taplist Solution

Homebrew Talk

Help Support Homebrew Talk:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
"Command pin" and "Response pin" but the hx711 uses DT (data) and SCK (clock) so what goes where?
Data is the response from the load cell
SCK is the command pin

Second question is "Scale ratio", I'm guessing that it to tare or calibrate the load cells but I never found any information what to put there?
I had to look this up to remember, it was pointed out to me by another member that its needed. That value represents the number in the load cell that represents 1 unit (OZ/LB/MG/KG). So if you put 1 unit on the scale it is the number the scale will return when 1 of that unit is on the scale. This coverts the number the scale sends to a value with a unit.
for example the scale sends 672 when 1 oz is on the scale then you would put in 672 in which case the code would translate 672 to 1.
 
Data is the response from the load cell
SCK is the command pin

...

Sweet, thanks a million! Now I just need to wait for the printing to be done! :D
One last question, the pin numbers, is that the GPIO or the physical number? ie. should I use fill in (GPIO)17 or 11
pinout.jpg

Oh I was lying, one more thing... on arduino it's possible to use the same SCK for multiple connections, might not be your area of expertise but can I do that here to. ie. use pin 17 or 11 on all the scales?

btw, you should really get a patreon or atleast a Buy Me a Coffee so we can support all the great work you're doing!
 
One last question, the pin numbers, is that the GPIO or the physical number? ie. should I use fill in (GPIO)17 or 11
physical number

on arduino it's possible to use the same SCK for multiple connections, might not be your area of expertise but can I do that here to. ie. use pin 17 or 11 on all the scales?
in this case I would not use the same SCK for multiple connections. to be honest I got open source code to talk to the load cells and isnt setup to get data from multiple load cells at one time.
 
in this case I would not use the same SCK for multiple connections. to be honest I got open source code to talk to the load cells and isnt setup to get data from multiple load cells at one time.
Ok thanks! I'll hook up atleast 2 now and see how it goes :D
 
Finally back home in my apartment. Sadly the update you provided Randr+ didn't fix my issue :(.

I did a pour for 315 ml, however 1,2 litres was subtracted from the keg.... Yes i know my keg is on -162 litres 😅 But that is another bug.....

The other bug that drives my keg nuts is the fact that every time I reboot my raspberry pi the units get changed back to gallons.

Let's say my keg says 10 litres. If i reboot my raspberry pi it now says 10 gallons. If i change it back to metric again it says it changes to 38 litres.

Anyone know how I can get the version from August last year?
 

Attachments

  • IMG_20210226_230918.jpg
    IMG_20210226_230918.jpg
    5.1 MB
  • IMG_20210226_230955.jpg
    IMG_20210226_230955.jpg
    5.3 MB
About to fruit a lambic using blueberry, cherry and mandarin (separately). Do you know if there is any way to show an alternative color in rpints instead of just the spectrum of SRM ? I would love to show a blue color for the blueberry sour, for example
 
I did a pour for 315 ml, however 1,2 litres was subtracted from the keg
Can you verify admin\includes\managers\pour_manager.php has the following in it:
1614434665157.png


if so then i think we need to add logging to line 256
echo "Keg: " . $keg->get_id() . ", count: " . $PULSE_COUNT .
", conversion: " . $pourCountConversion . ", amount: " . $amount . ", amountUnit: " . $amountUnit .
", user: " . ($user?$user->get_id():'N/A') . ", Current Amount " . $keg->get_currentAmount() . ", Unit " . $keg->get_currentAmountUnit().
", subtract amount " . $kegAmount . "\n" ;
1614435025045.png


This will add the information to /var/log/rpints.log
1614435053760.png

If i reboot my raspberry pi it now says 10 gallons. If i change it back to metric again it says it changes to 38 litres.
That certainly sounds like there is a database update happening to just update the unit of measure of the keg to gallons along with switching to gallons volume unit of measure.
Not sure if its a code issue or a script issue. Do you do an update after a restart?
Also does it happen if you restart apache
Run
/etc/init.d/apache restart

and let me know

Anyone know how I can get the version from August last year?
in git hub you can view history
1614435293834.png

find the version you want and it the <> button on the right then you can download the code and place it in the installation location for your pi
1614435312391.png
 

Attachments

  • 1614434657162.png
    1614434657162.png
    9.5 KB
I would love to show a blue color for the blueberry sour, for example
from the terminal run
sudo mysql
use <DATABASE NAME> (replace with your database name default is raspberrypints)
insert into srmRgb (srm, rgb ) VALUES(99,'0,0,255');
exit

this will add blue at the end of hte SRM list, you can change the order by changing 99 to -1 to get it on top
you can change 0,0,255 to whatever RGB color you want
 
Thanks very much for the response. I missed the semi colon off the first time. After that worked like a treat...

Now to decide if I like it that way after all that :) Again thanks...

1614438460419.png
 
Me again with the bloody pins... Tried adding a fan now using a mosfet connected to my proto-hat. The blue wire on GPIO16
1614518795953.png

So I've tried both using the GPIO pin (16) and also the physical pin (36) but it never seems to turn on. No voltage is going to the output on the mosfet. so have I missed anything. Do I need to restart raspipints after changing it?

1614518756454.png
 
Thanks very much for the response. I missed the semi colon off the first time. After that worked like a treat...

Now to decide if I like it that way after all that :) Again thanks...

Looks like a treat, and then you wont get a surprise what comes out of your tap! :D
 
So I've tried both using the GPIO pin (16) and also the physical pin (36) but it never seems to turn on. No voltage is going to the output on the mosfet. so have I missed anything. Do I need to restart raspipints after changing it?
it should be 16, look at /var/log/rpints.log and search for Fan. You should only see Fan Control ... is running. if you see Not Configured to run fan than that is the issue.

Also try setting the interval to run to more than 0. I know the comment says 0 should always run but looking at the code that doesnt seem to be the case. I will look at a change to make 0 always run the fan
 
it should be 16, look at /var/log/rpints.log and search for Fan. You should only see Fan Control ... is running. if you see Not Configured to run fan than that is the issue.

Also try setting the interval to run to more than 0. I know the comment says 0 should always run but looking at the code that doesnt seem to be the case. I will look at a change to make 0 always run the fan

It actually works with 36 and not the GPIO number after a restart so guess it's just a typo. Set it to run 10 minutes every hour now!
 
It actually works with 36 and not the GPIO number
sorry, yes you are correct. Board/Pin number vs GPIO number

This is the code that setups the numbering scheme
GPIO.setmode(GPIO.BOARD) # Broadcom pin-numbering scheme
 
Anyone set it up to work with hx711, just wondering if I should see any results in the log or if I'm missing something.
DT goes to green, SCK is yellow and then ofc power+/-
1614625093847.png

I've beeped it all the way to the pi and the proto-hat where the DT is on GPIO17(pin 11) and SCK on GPIO27(pin13)
1614625176631.png

When I put the pins in the load cell config not much more happens...
1614625416700.png

I've tried adding a weight but the "current weight" never changes?
 
just wondering if I should see any results in the log or if I'm missing something.
in /var/log/rpints.log or the log web page you should see towards the start Load Cell Checker ... is Running.

if you see Unable to run load cell checker after that or dont see that at all then there is a problem


I've tried adding a weight but the "current weight" never changes?
Try putting 1 for the scale ratio and 0 for the offset. you will also need to refresh the page after changing the weight, i dont have it setup to provide real time feedback
 
in /var/log/rpints.log or the log web page you should see towards the start Load Cell Checker ... is Running.

if you see Unable to run load cell checker after that or dont see that at all then there is a problem

Nope, nothing like that in the log at all just this, then the last part repeats
Code:
2021-03-01 21:11:45 RPINTS: No such device - Sleeping to try again
2021-03-01 21:11:50 RPINTS: No such device - Sleeping to try again
RPINTS: reflashing Arduino failed, moving on anyways, error was:  Command '/usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -patmega328p -calamode -P/dev/ttyS0 -b115200 -D -Uflash:w:/var/www/html//arduino/raspberrypints/raspberrypints.cpp.hex:i' returned non-zero exit status 1
2021-03-01 21:12:06 RPINTS: starting WS server
2021-03-01 21:12:06 RPINTS: starting device monitors...
2021-03-01 21:12:06 RPINTS: starting command server
2021-03-01 21:12:06 RPINTS: starting fan control
2021-03-01 21:12:06 RPINTS: Fan Control fanControl1 is Running
2021-03-01 21:12:19 RPINTS: serial connection stopped...
2021-03-01 21:12:20 RPINTS: flowmonitor aborted, restarting...
2021-03-01 21:12:21 RPINTS: serial connection stopped...

I uninstalled everything and reinstalled it again with a blank config, just added some kegs, beers and the load cells. Installed without flowmeters and just temp probes.

So is the problem with my load cells or with my config?
 
Last edited:
nothing like that in the log at all just this, then the last part repeats
Ah i see whats going the part of the code that runs the weight check is failing but the log wont tell why unless debuging is enabled.

In python/Config.py
make sure flowmon.debug ,dispatch.debug , and loadcell.debug are true, then restart the service (sudo /etc/init.d/flowmon restart)
1614630408002.png
 
Ok did that and restarted flowmon and now the Log shows this, but just keeps repeating the last 3 rows over and over
Code:
2021-03-01 21:35:43 RPINTS: valve update: RPU:VALVE:0=0
2021-03-01 21:35:43 RPINTS: valve update: RPU:VALVE:1=0
2021-03-01 21:35:43 RPINTS: valve update: RPU:VALVE:2=0
2021-03-01 21:35:44 RPINTS: valve update: RPU:VALVE:3=0
2021-03-01 21:35:46 RPINTS: starting setup...
2021-03-01 21:35:46 RPINTS: resetting alamode to try to force it to listen to us...
2021-03-01 21:35:47 RPINTS: giving it a short break to wake up again...
2021-03-01 21:35:49 RPINTS: reflashing Arduino via:
/usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -patmega328p -calamode -P/dev/ttyS0 -b115200 -D -Uflash:w:/var/www/html//arduino/raspberrypints/raspberrypints.cpp.hex:i
RPINTS: reflashing Arduino failed, moving on anyways, error was:  Command '/usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -patmega328p -calamode -P/dev/ttyS0 -b115200 -D -Uflash:w:/var/www/html//arduino/raspberrypints/raspberrypints.cpp.hex:i' returned non-zero exit status 1
2021-03-01 21:35:55 RPINTS: 
2021-03-01 21:35:55 RPINTS: starting WS server
2021-03-01 21:35:55 RPINTS: starting device monitors...
2021-03-01 21:35:55 RPINTS: starting command server
2021-03-01 21:35:55 RPINTS: serial connection stopped...
2021-03-01 21:35:55 RPINTS: starting fan control
2021-03-01 21:35:55 RPINTS: global name 'logger' is not defined
2021-03-01 21:35:55 RPINTS: Fan Control fanControl1 is Running
2021-03-01 21:35:55 RPINTS: fan update: RPU:FAN:36=1
2021-03-01 21:35:56 RPINTS: flowmonitor aborted, restarting...
2021-03-01 21:35:56 RPINTS: serial connection stopped...
2021-03-01 21:35:56 RPINTS: global name 'logger' is not defined
2021-03-01 21:35:57 RPINTS: flowmonitor aborted, restarting...
2021-03-01 21:35:57 RPINTS: serial connection stopped...
 
2021-03-01 21:35:56 RPINTS: global name 'logger' is not defined
that is part of the issue

Can you change logger to log.logger of line 23 of python/hx711.py
Left is what it should be right is what it was
1614632822948.png


then restart and let me know if the log changes
 
that is part of the issue

Can you change logger to log.logger of line 23 of python/hx711.py

Done, it now looks like this:
Python:
def log(msg, process="HX711", isDebug=False):
    if ("RFIDCheck" not in msg and "Status" not in msg) or log.lastMsg != msg:
        if log.logger is not none :
            log.logger.log(msg, process, isDebug)
        log.lastMsg = msg
    else:
        log.logger.logDB(msg, process, isDebug)
log.lastMsg = ""

But I'm sorry to tell you that the log still doesn't say anything about the load cells:
Code:
2021-03-02 06:35:31 RPINTS: No such device - Sleeping to try again
2021-03-02 06:35:37 RPINTS: valve update: RPU:VALVE:0=0
2021-03-02 06:35:37 RPINTS: valve update: RPU:VALVE:1=0
2021-03-02 06:35:37 RPINTS: valve update: RPU:VALVE:2=0
2021-03-02 06:35:37 RPINTS: valve update: RPU:VALVE:3=0
2021-03-02 06:35:39 RPINTS: starting setup...
2021-03-02 06:35:39 RPINTS: resetting alamode to try to force it to listen to us...
2021-03-02 06:35:40 RPINTS: giving it a short break to wake up again...
2021-03-02 06:35:42 RPINTS: reflashing Arduino via:
/usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -patmega328p -calamode -P/dev/ttyS0 -b115200 -D -Uflash:w:/var/www/html//arduino/raspberrypints/raspberrypints.cpp.hex:i
RPINTS: reflashing Arduino failed, moving on anyways, error was:  Command '/usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -patmega328p -calamode -P/dev/ttyS0 -b115200 -D -Uflash:w:/var/www/html//arduino/raspberrypints/raspberrypints.cpp.hex:i' returned non-zero exit status 1
2021-03-02 06:35:48 RPINTS:
2021-03-02 06:35:48 RPINTS: starting WS server
2021-03-02 06:35:48 RPINTS: starting device monitors...
2021-03-02 06:35:48 RPINTS: starting command server
2021-03-02 06:35:48 RPINTS: serial connection stopped...
2021-03-02 06:35:48 RPINTS: starting fan control
2021-03-02 06:35:48 RPINTS: global name 'none' is not defined
2021-03-02 06:35:49 RPINTS: Fan Control fanControl1 is Running
2021-03-02 06:35:49 RPINTS: fan update: RPU:FAN:36=1
2021-03-02 06:35:50 RPINTS: flowmonitor aborted, restarting...
2021-03-02 06:35:50 RPINTS: serial connection stopped...
2021-03-02 06:35:50 RPINTS: global name 'none' is not defined
2021-03-02 06:35:51 RPINTS: flowmonitor aborted, restarting...
2021-03-02 06:35:51 RPINTS: serial connection stopped...
So it just changed from global name 'logger' is not defined to global name 'none' is not defined
 
But I'm sorry to tell you that the log still doesn't say anything about the load cells:
Im really questioning what i did when i added load cell logging....

Anyways none on line 23 should be None
1614691620099.png


I found time to run this locally and found a few other changes that need to be made, if you update to the latest (specifically /python/hx711.py) it should at least look like its trying to communicate with the load cells
 
Im really questioning what i did when i added load cell logging....

Probably taking a well deserved break with a beer and cursing about people like me who keep annoying you :bigmug:
Uploaded the logs here (log) since I honestly don't have a clue what I'm looking for :D, it seems to be getting data tough?
 
it seems to be getting data tough
Yes its getting data but there is one more exceptions in the log i see.

You also need to surround tare_offset with int() on line 93
1614699863721.png


I updated my dev environment earlier this year and am still trying to get used to the new way of committing changes. So my latest doesnt actually have that change in it yet
 
Then I get the error int() argument must be a string or a number, not 'NoneType' in the log
ok i just added a None check to line 91 (might be 92 for your version)
1614701189986.png


I think i also think i finally got my changes committed to github for you to take
 
ok i just added a None check to line 91 (might be 92 for your version)
View attachment 720652

I think i also think i finally got my changes committed to github for you to take

Super great! Did the change and now that error is gone from the log
It even seemed to change values on the load cell page, then I pressed the "Tare" button and it seems to be stuck at the same value even if I put weights on it
 
It even seemed to change values on the load cell page, then I pressed the "Tare" button and it seems to be stuck at the same value even if I put weights on it
Do you have all the taps setup for load cells? are all the pin number > 0? I see "The channel sent is invalid on a Raspberry Pi" in the log which i believe is the code trying to setup an invalid pin. the code checks for null pin numbers but doesnt check for 0 pin number.

Also i dont think the Tare was caused the issue because the log stops recording values well before the tare.
What i do see in the log is " Not enough fast while reading data" which happens if the code takes more than 6 microseconds to turn the clock on and off. It looks like if its over 60 microseconds then the load cell powers down.
Did you take my latest from github or just make the changes i recommended? if its my latest i see a few changes i can make to slightly improve speed.

You may need to repower the load cell to get it to report the weight again.
 
Do you have all the taps setup for load cells? are all the pin number > 0? I see "The channel sent is invalid on a Raspberry Pi" in the log which i believe is the code trying to setup an invalid pin. the code checks for null pin numbers but doesnt check for 0 pin number.
No I've only completed 2 load cells yet, but those taps are empty so far... should I enter some placeholder random pins in them?
1614713378639.png


Also i dont think the Tare was caused the issue because the log stops recording values well before the tare.
What i do see in the log is " Not enough fast while reading data" which happens if the code takes more than 6 microseconds to turn the clock on and off. It looks like if its over 60 microseconds then the load cell powers down.
Did you take my latest from github or just make the changes i recommended? if its my latest i see a few changes i can make to slightly improve speed.

You may need to repower the load cell to get it to report the weight again.
I updated again, this time from the shell and it takes almost a full minute before I start getting those "Not enough fast..." in the log but before that it also spits out a new error:
Code:
2021-03-02 20:23:04 RPINTS: Unable to run Load Cell Checker
2021-03-02 20:23:04 RPINTS: Converted 2's complement value: 0
2021-03-02 20:23:04 RPINTS: unsupported operand type(s) for /: 'int' and 'NoneType'
2021-03-02 20:23:04 RPINTS: Traceback (most recent call last):
  File "/var/www/html/python/FlowMonitor.py", line 644, in run
    weight = self.getWeight()
  File "/var/www/html/python/FlowMonitor.py", line 631, in getWeight
    return self.hx711.get_weight_mean(20)
  File "/var/www/html/python/hx711.py", line 499, in get_weight_mean
    (result - self._offset_A_128) / self._scale_ratio_A_128)
TypeError: unsupported operand type(s) for /: 'int' and 'NoneType'

It's a 3b+ so should be able to handle it or do I need to order a 4?
 
those taps are empty so far... should I enter some placeholder random pins in them?
i think its caused by you having pin 6 defined for tap 2 which i believe is ground.

I updated again, this time from the shell and it takes almost a full minute before I start getting those "Not enough fast..." in the log but before that it also spits out a new error:
I restructured my changes from today to reduce the likelihood of them having affect on the execution time. I dont think they were the issue but they will help.
Getting the latest again would be a good test of it,

3b+ should be enough for this. the one thing I can think of is loading an example code outside of Rpints and see if you get a different result. If you do then there is something slowing down the pin writing in Rpints
 
Back
Top