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

    Homebrewing Facebook Group

BrewPi Remix – What’s Old is New Again

Homebrew Talk

Help Support Homebrew Talk:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
OK, pull request is in. Just tested it with the procedure I used to trigger the bug the first time and it looks good.

@LBussy you needs both this patch and the original one to fix the int() bug. I just realized that I based this pull request on your main branch, not the tiltfix branch. GitHub should be able to merge this on top with no conflict, but if not, let me know.
 
OK, I couldn't let this go... I blame this for giving me nightmares when I was a kid about not fixing things properly...



The last bug was in the parsing of HWVer. The code was doing nested if loops to check the hardware version. The way it was implemented was:

Code:
if ( key1 exists ):
    if ( key1 is true ):
        hw version equals value for key1
elif ( key2 exists ):
    if ( key2 is true ):
        hw version equals value for key2
else:
    hw version equals zero

The problem is that if key1 exists, the code never looks for the existence of key2 (regardless of whether key1 is true or false) so it can never set that hardware version. If key1 exists, but is false, then the code defaults to the existing value. This is either None, causing the code to crash on int(None), or zero which screws up the parsing the data for a newer tilt resulting in the NAN values. The way to do this is

Code:
if ( key1 exists and key1 is true ):
    hw version equals value for key1
elif ( key2 exists and key2 is true ):
    hw version equals value for key2
else:
    hw version equals zero

I added this fix to Expire the correct tilt color by duncan-brown · Pull Request #198 · brewpi-remix/brewpi-script-rmx and rebased against the tilt fix branch, so it should be good now.

I think that's it, so I'm going to call it a night and celebrate by putting a rug on a polished floor...
 
Last edited:
Okay @athistle:

Bash:
cd /home/brewpi/
sudo git pull
sudo systemctl restart brewpi

Don't break it this time. ;)
Wooo Hoooo! It works like a champ, however while it now displays TiltBridge info in the banner it is not logging or plotting tilt SG in the chart.
1652187790493.png
 
There's still something wrong - I thought I had the Tilt color in the header. I mean good it's not crashing, and yes it should be plotting the SG.

I wish I could explain how much this sucks living in an RV - at least when it comes to things like this.
 
There's still something wrong - I thought I had the Tilt color in the header. I mean good it's not crashing, and yes it should be plotting the SG.

I wish I could explain how much this sucks living in an RV - at least when it comes to things like this.
No worries, the work you and @duncan.brown have put into this issue is simply amazing.
 
I'm having trouble with my temp sensors. They will after x amount of time start reading null. The amount of time is varied, it can read fine for days, but eventually it will go null. I have tried changing the USB wire from the Pi to the Aurdino, which "fixed" it for a little while but it eventually started reading null again. Googling this I came across a few threads on the Brewpi forumn where Elco says if they read null it is probably a wiring issue because that means the 5V wire is disconnected. I have redone the wiring which again "fixes" the issue for a short duration but I eventually get back to null.

I am running the Glycol firmware on the Aurdino and was initially running two Temperature probes. When the sensors go null if I unplug the 5V wire from the Aurdino or unplug the USB cable from the Pi it fixes it. One thing I notice is the temperature sensors read high initially and take ~5 minutes to come back down to normal temperature. Once they hit expected temperature they seem to be very stable in reading temperature. This led me to believe I had a bad sensor, so I unplugged one of them and again it fixed it long enough that I thought it was safe to brew but now is going null within hours.

Logs really don't show anything, but one thing I do notice is that I have 3 temperature sensors in Device Configuration. All three read the same temperature, but one has a different OneWire Address.

Any help would be appreciated, trying to keep this brew alive at least for the first three days.

Code:
cat stderr.txt
2022-05-21 19:26:49 [E] Starting BrewPi.
Terminating due to fatal serial error
2022-05-21 23:17:15 [E] Starting BrewPi.


cat stdout.txt
2022-05-21 23:17:15 [N] 0.8.1 (main) [c16adae]
2022-05-21 23:17:15 [N] Starting 'NE IPA.'
2022-05-21 23:17:15 [N] Opening serial port.
2022-05-21 23:17:17 [N] Waiting 10 seconds for board to restart.
2022-05-21 23:17:27 [N] Checking software version on controller.
2022-05-21 23:17:27 [N] Found BrewPi v0.2.13 build da7e14a9, running on an Arduino Uno with a Glycol shield on port /dev/glycol1.
2022-05-21 23:17:28 [N] New JSON received from controller.
2022-05-21 23:17:50 [N] New JSON received from controller.
2022-05-21 23:19:46 [N] New JSON received from controller.
2022-05-21 23:19:52 [N] New JSON received from controller.
2022-05-21 23:20:16 [N] New JSON received from controller.
2022-05-21 23:22:17 [N] New JSON received from controller.
2022-05-21 23:22:47 [N] New JSON received from controller.
2022-05-21 23:24:47 [N] New JSON received from controller.
2022-05-21 23:26:49 [N] New JSON received from controller.
2022-05-21 23:28:49 [N] New JSON received from controller.
2022-05-21 23:30:50 [N] New JSON received from controller.
2022-05-21 23:31:53 [N] Installed devices received: [{"i": 0, "t": 3, "c": 1, "b": 0, "f": 2, "h": 1, "d": 0, "p": 5, "v": 1, "x": 1}, {"i": 1, "t": 3, "c": 1, "b": 0, "f": 3, "h": 1, "d": 0, "p": 6, "v": 0, "x": 1}, {"i": 2, "t": 1, "c": 1, "b": 1, "f": 9, "h": 2, "d": 0, "p": 14, "v": 66.986, "a": "28EFB2D73C19013D", "j": 0.0}, {"i": 3, "t": 1, "c": 1, "b": 0, "f": 5, "h": 2, "d": 0, "p": 14, "v": 66.986, "a": "28EFB2D73C19013D", "j": 0.0}, {"i": 4, "t": 1, "c": 1, "b": 1, "f": 9, "h": 2, "d": 0, "p": 14, "v": 66.986, "a": "28FF5DD93C1901C6", "j": 0.0}]
2022-05-21 23:31:53 [N] Available devices received: [{"i": -1, "t": 0, "c": 1, "b": 0, "f": 0, "h": 1, "d": 0, "p": 2, "x": 1}, {"i": -1, "t": 0, "c": 1, "b": 0, "f": 0, "h": 1, "d": 0, "p": 10, "x": 1}]
2022-05-21 23:32:51 [N] New JSON received from controller.

Screenshot from 2022-05-21 23-36-51.png
 
@thestraw0039 - what you describe is generally attributable to a good, clean power source for the sensors. Secondarily we have seen where a stronger pull-down helps, especially with longer lead lengths. The two things I would try:

Get a good 9v power supply and use that to power the Arduino.

https://support.arduino.cc said:
The AC adapters are commonly available in retail stores for use with consumer products are often suitable, but make sure that it has the proper connector for plugging into the power socket on your Arduino board: 5.5mm diameter cylindrical plug with 2.1mm pin hole, and that provides Positive voltage on the inside pin hole and Negative (or common/ground) voltage on the outside cylindrical sleeve of the connector plug.

Something like this one from Amazon should work well:
https://smile.amazon.com/110-240V-Elliptical-Exercise-Turntable-5-5x2-1mm/dp/B09HPG9K8T/
I recommend that one over a few that are a couple of dollars less because it is rated for 2A. What that means in Chinese specifications is maybe 1A which is more than enough for you.

Secondarily, if that doesn't work, try a stronger pull-up resistor. If you are using a 4k7, use a 2k2. If you don't have one handy you can use a second 4k7 in parallel to get close to a 2k2 value (2350k.)
 
Thanks LBussy, I currently don't have any power for the Aurdino, just what it pulls off the USB from the Pi. I ordered what you recommended and it should be here tomorrow so I will report back. I did add longer wires for my temp sensors so it makes sense it is a power issue.

I also don't believe I have a 2k2 resistor on hand, but have plenty of 4k7 (if that is what I put in originally). I had to order about a hundred for the one I needed so I'll add a second and see if it helps.
 
Secondarily, if that doesn't work, try a stronger pull-up resistor. If you are using a 4k7, use a 2k2. If you don't have one handy you can use a second 4k7 in parallel to get close to a 2k2 value (2350k.)

Ah, cheers @LBussy a lower resistance pull-up has fixed the intermittent problems I have with the temp probe on my mash tun and HTL!
 
Back in January, I decided to put Brewpi Remix through its paces and programed in a fermentation profile I got from Bierstadt Lagerhaus in Denver, CO. A full 40 days in the fermenter, followed by three months of lagering. Damn this beer is good! Crystal clear and drinkable by the liter! Cheers!

Screen Shot 2022-05-22 at 3.07.39 PM.png


IMG_2046.jpeg
 
Then there's something amiss. I'm betting the eeprom needs to be wiped and devices configured from fresh...

Cheers!
That's been done, now I just have the one sensor, I also added the second resistor. The power cord for the Aurdino should be here tomorrow.

It's been a fun day trying to keep this afloat.
 

Attachments

  • Screenshot from 2022-05-22 22-26-33.png
    Screenshot from 2022-05-22 22-26-33.png
    157.8 KB
One thing to note when running BrewPi with a single sensor is you can only run in Fridge Constant mode.
Both Beer Constant and Beer Profile modes require a minimum of two sensors to operate correctly...

Cheers!
 
I am running the Glycol firmware on the Aurdino and was initially running two Temperature probes.

@day_trippr I think @thestraw0039 is running the glycol version of the code which works fine with one sensor. I never got round to fixing the GUI for glycol, so both the beer and fridge temperatures display the same value. Control is done on the beer temperature.
 
Yeah I'm running the glycol build. Update so far reflashing the Aurdino and adding the extra resistor seems to be working. My wife sent me a screen shot and it is still reading temperature as of about 4 this afternoon. My power supply got here and I'll put it in tonight. Thanks for the help everyone.

@duncan.brown are you still running temperature idle range top to 1F? It was initially set to 1.83 and I thought I broke something when beer temp was rising past my set temperature and brewpi wasn't putting the cooling on. I changed it to 1 but was considering going to 0.5
 
@duncan.brown are you still running temperature idle range top to 1F? It was initially set to 1.83 and I thought I broke something when beer temp was rising past my set temperature and brewpi wasn't putting the cooling on. I changed it to 1 but was considering going to 0.5

My glycol is set to 28F to keep my long-draw loop cold, which drops the temp in my tanks like a stone when the pump comes on. This generally gets me an overshoot, even with some tweaking of the parameters. The following work well for me:

Temperature idle range top: 0.998
Temperature idle range bottom: -1.502
Heating target upper bound: 0.541
Heating target lower bound: -0.359
Cooling target upper bound: 0.359
Cooling target lower bound: -0.541
Maximum time in seconds for heating overshoot estimator: 600
Maximum time in seconds for cooling overshoot estimator: 1200

Kp, Ki, and Kd are all set to 0 to disable the PID. I had some discussion with Lee a while ago about this and came to the decision that it’s not worth tuning the PID loop when the glycol is on an on/off pump.

Again, see post above. I get some cooling overshoot, but it still makes a damn good beer!
 
So not sure what happened last night, but got home and hadn't had any issues all day. I got the power supply so I plugged that into the Ardiuno and everything went smoothly until around 10. I looked at the website and the temperature went null. I went out and unplugged the USB from the Pi and it didn't turn back on. I then figured out I had the power supply attached so I opened it up and pulled out the 5V pin, replugged and the temperature came back on as expected.

Went to bed and everything was fine. I woke up this morning to the glycol chiller running all night yet the temperature reading 67 degrees. So went downstairs, decided I was switching the probe out, which I did. When I went to the website again Devices wouldn't load, restarted the Pi and then the BrewPi service wouldn't start. After digging on why the Aurdino couldn't be found. Unplugged it from the Pi and the power source and plugged everything back in and the Pi found the Aurdino, set up the new sensor and it appears like we are running again. Is there a chance my Ardiuno is going and I should buy a new one? At this point I'm just going to let this run and see what happens.

If anyone wants to copy my beer profile go for it, I probably should take this moment to dry hop since I have now cold crashed.

Edit: Sensor is null again, bought a new Arduino see if that fixes it
 

Attachments

  • Screenshot from 2022-05-24 08-35-05.png
    Screenshot from 2022-05-24 08-35-05.png
    154.7 KB
Last edited:
To figure it out we'd need to see the /home/brewpi/logs/stdout.txt and /home/brewpi/logs/stderr.txt. I've got ideas but I'd prefer not to guess and step through it carefully.
 
Back
Top