HOWTO - Make a BrewPi Fermentation Controller For Cheap

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.
Status
Not open for further replies.
Do you get the same results when running updateFirmware.py?

You can try adding a ":i" after the filename to explicitly define it as an Intel Hex file:
Code:
sudo avrdude -F -e -p atmega328p -c arduino -b 115200 -P /dev/ttyACM0 -U flash:w:brewpi-arduino-uno-revc-0.2.12.hex:i
It should not be needed, but that's the answer to that error.

That suggests the BrewPi script was still running.

Excellent! That means when I fix the UI method, it will work. :)

Odd because I can't get the script to run, fooling around with it now but here is what the log says. Clean install on a new Pi.

Code:
pi@raspberrypi:/home/brewpi/logs $ cat stdout.txt
2020-01-18 22:04:14  Opening serial port.
2020-01-18 22:04:14  0.5.4.1 (master) [5824d24 Fix degree sign in web]
2020-01-18 22:04:14  Starting 'My BrewPi Remix Run.'
2020-01-18 22:04:14  Waiting 10 seconds for board to restart.
2020-01-18 22:04:24  Checking software version on controller.
2020-01-18 22:04:24  Found BrewPi v0.2.12 build 8d36524, running on an Arduino Uno with a revC shield on port /dev/ttyACM0.
2020-01-18 22:04:25  Caught an unhandled exception, exiting.
2020-01-18 22:04:25  Stopping background serial processing.
2020-01-18 22:04:25  Closing port.
2020-01-18 22:04:25  Closing open sockets.
2020-01-18 22:04:25  Exiting.
 
Yes, I've been working on fixing my BrewPi and have run into the same log contents. I've tried installing on 2019-04-08-rasbian-stretch (no logging, "Script not Running!") and now 2019-09-26-rasbian-buster-full ("Script not Running!") log:

Code:
2020-01-18 22:56:39 Opening serial port.
2020-01-18 22:56:39 0.5.4.1 (master) [5824d24 Fix degree sign in web]
2020-01-18 22:56:39 Starting 'My BrewPi Remix Run.'
2020-01-18 22:56:39 Waiting 10 seconds for board to restart.
2020-01-18 22:56:49 Checking software version on controller.
2020-01-18 22:56:49 Found BrewPi v0.2.12 build 8d36524, running on an Arduino Uno with a revC shield on port /dev/ttyACM0.
2020-01-18 22:56:50 Caught an unhandled exception, exiting.
2020-01-18 22:56:50 Stopping background serial processing.
2020-01-18 22:56:50 Closing port.
2020-01-18 22:56:50 Closing open sockets.
2020-01-18 22:56:50 Exiting.

When I check device configuration and device list I get:

Code:
Error while receiving device configuration: SyntaxError: Unexpected token C in JSON at position 0

Any thoughts?

Thank you-

Mark
 
Well .... sh*t. That certainly seems like a “me” problem. I eat my own dog food however and I have it running here as well though so no initial thoughts.

Gimme a few to wake up and smell the coffee and I’ll get to work on it.
 
Okay for @mwamsley and @thestraw0039:

Please do the following:
Code:
cd /home/brewpi
sudo systemctl stop brewpi
sudo git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
sudo git fetch --all
sudo git pull --all
sudo git checkout devel
sudo git pull
sudo systemctl start brewpi
At this point, the script will try to start up again. You can watch the logs with:
Code:
tail -f /home/brewpi/logs/std*.txt
Assuming it will still raise an exception, it should show in the stderr.log. That will give me more to go on.
 
You're right - the documentation is lagging. Since I basically forked the project and the original docs were limited, I often find myself neglecting some because it's not "all."

Sorry if I offended you by stating "all" documentation, that was not my intention.

I reviewed the config.cfg file and this is what I have:

scriptPath = /home/brewpi
wwwPath = /var/www/html
port = auto
chamber = ""
tiltColor = Orange

I have included the full log files for both the stderr.txt and stdout.txt files.

This was from the stderr.text file.
2020-01-19 13:38:23 Configured for Tilt but no Bluetooth radio available. // I am using a Raspberry Pi ver 3b+. I thought this had native bluetooth radio support.
2020-01-19 13:38:23 Starting BrewPi.
 

Attachments

  • config.cfg.txt
    97 bytes · Views: 13
  • stderr.txt
    113 bytes · Views: 11
  • stdout.txt
    6.5 KB · Views: 12
Sorry if I offended you by stating "all" documentation, that was not my intention.
Nah, my skin is thicker than that. :) The documentation does suck. I will accept pull requests to improve them. :p
I thought this had native bluetooth radio support.
It does, but something's not working for sure. Try running "Tilt" on its own:
Code:
/home/brewpi/Tilt.py
See if it detects the Tilt. If not ... well, we'll figure something out.
 
This is the response. I got to this by navigating to the file Located at: /home/brewpi/Tilt.py

Reporting Tilt values every 5 seconds. Ctrl-C to stop.
Color Purple report: No results returned.
Color Purple report: No results returned.
Color Purple report: No results returned.

I have the Orange Tilt.
 
This is the response. I got to this by navigating to the file Located at: /home/brewpi/Tilt.py

Reporting Tilt values every 5 seconds. Ctrl-C to stop.
Color Purple report: No results returned.
Color Purple report: No results returned.
Color Purple report: No results returned.

I have the Orange Tilt.
Oops. :rolleyes:

Line 516, change "Purple" to "Orange". I'll fix that so it will pick up the one from the config.
 
Okay for @mwamsley and @thestraw0039:

Please do the following:
Code:
cd /home/brewpi
sudo systemctl stop brewpi
sudo git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
sudo git fetch --all
sudo git pull --all
sudo git checkout devel
sudo git pull
sudo systemctl start brewpi
At this point, the script will try to start up again. You can watch the logs with:
Code:
tail -f /home/brewpi/logs/std*.txt
Assuming it will still raise an exception, it should show in the stderr.log. That will give me more to go on.

When I get to git pull --all I get the following output, and I think this is something you need to change on GitHub.

Code:
pi@raspberrypi:/home/brewpi $ sudo git pull --all
Fetching origin
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> devel
 
I must have a completely different issue. Same log result. I'm using defaults.cfg.

Code:
pi@brewpi:~ $ cd /home/brewpi
pi@brewpi:/home/brewpi $ sudo systemctl stop brewpi
pi@brewpi:/home/brewpi $ sudo git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
pi@brewpi:/home/brewpi $ sudo git fetch --all
Fetching origin
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 2), reused 3 (delta 2), pack-reused 0
Unpacking objects: 100% (6/6), done.
From https://github.com/brewpi-remix/brewpi-script-rmx
   3c25020..9bb9ffe  devel      -> origin/devel
pi@brewpi:/home/brewpi $ sudo git pull --all
Fetching origin
Already up to date.
pi@brewpi:/home/brewpi $ sudo git checkout devel
Branch 'devel' set up to track remote branch 'devel' from 'origin'.
Switched to a new branch 'devel'
pi@brewpi:/home/brewpi $ sudo git pull
Already up to date.
pi@brewpi:/home/brewpi $ sudo systemctl start brewpi
pi@brewpi:/home/brewpi $ tail -f /home/brewpi/logs/std*.txt
==> /home/brewpi/logs/stderr.txt <==
2020-01-19 18:05:14  Starting BrewPi.

==> /home/brewpi/logs/stdout.txt <==
2020-01-19 18:05:14  Opening serial port.
2020-01-19 18:05:14  0.5.4.1 (master) [5824d24 Fix degree sign in web]
2020-01-19 18:05:14  Starting 'My BrewPi Remix Run.'
2020-01-19 18:05:14  Waiting 10 seconds for board to restart.
2020-01-19 18:05:24  Checking software version on controller.
2020-01-19 18:05:24  Found BrewPi v0.2.12 build 8d36524, running on an Arduino Uno with a revC shield on port /dev/ttyACM0.
2020-01-19 18:05:24  Caught an unhandled exception, exiting.
2020-01-19 18:05:24  Stopping background serial processing.
2020-01-19 18:05:24  Closing port.
2020-01-19 18:05:24  Exiting.

Thank you for your work on this project. This is truly my most important 2020 resolution.

Mark
 
Alright, I think I got the devel up and running, here is the error. I'm curious if you have this written for wifi (I ask because this is a wired connection), I think I remember you reading this, the stdout.txt isn't showing anything, but this appears to be looping:

Code:
pi@raspberrypi:/home/brewpi $ tail -f /home/brewpi/logs/std*.txt
==> /home/brewpi/logs/stderr.txt <==
2020-01-19 20:46:10 DOWIFI WARN: 3 failure(s) to reach 192.168.1.1.
2020-01-19 20:46:10 DOWIFI ERROR: Gateway unreachable. Restarting wlan0.
2020-01-19 20:55:30 DOWIFI WARN: 1 failure(s) to reach 192.168.1.1.
2020-01-19 20:55:50 DOWIFI WARN: 2 failure(s) to reach 192.168.1.1.
2020-01-19 20:56:10 DOWIFI WARN: 3 failure(s) to reach 192.168.1.1.
2020-01-19 20:56:10 DOWIFI ERROR: Gateway unreachable. Restarting wlan0.
2020-01-19 21:05:31 DOWIFI WARN: 1 failure(s) to reach 192.168.1.1.
2020-01-19 21:05:51 DOWIFI WARN: 2 failure(s) to reach 192.168.1.1.
2020-01-19 21:06:11 DOWIFI WARN: 3 failure(s) to reach 192.168.1.1.
2020-01-19 21:06:11 DOWIFI ERROR: Gateway unreachable. Restarting wlan0.

Edit: After looking at this the daemon won't start:

Code:
pi@raspberrypi:/home/brewpi $ systemctl status brewpi
● brewpi.service - BrewPi Remix daemon for: brewpi
   Loaded: loaded (/etc/systemd/system/brewpi.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sun 2020-01-19 21:26:43 EST; 1min 33s ago
     Docs: https://docs.brewpiremix.com/
  Process: 21527 ExecStart=/bin/bash /home/brewpi/utils/doBrewPi.sh -d (code=exited, status=1/FAILURE)
 Main PID: 21527 (code=exited, status=1/FAILURE)

Jan 19 21:26:43 raspberrypi systemd[1]: brewpi.service: Service RestartSec=1s expired, scheduling restart.
Jan 19 21:26:43 raspberrypi systemd[1]: brewpi.service: Scheduled restart job, restart counter is at 5.
Jan 19 21:26:43 raspberrypi systemd[1]: Stopped BrewPi Remix daemon for: brewpi.
Jan 19 21:26:43 raspberrypi systemd[1]: brewpi.service: Start request repeated too quickly.
Jan 19 21:26:43 raspberrypi systemd[1]: brewpi.service: Failed with result 'exit-code'.
Jan 19 21:26:43 raspberrypi systemd[1]: Failed to start BrewPi Remix daemon for: brewpi.

Second edit: turning on wifi and daemon still won't start.
 
Last edited:
Yeah sorry LBussy, I haven't got around to getting the exact output for you just yet - been focused on determing which of my DS18b20s are dead/alive, rearranging the setup and getting it working. I'm proud to report it now operates perfectly, running three probes (beer, fridge & room) and two relays for heating and cooling.

Re: the Arduino issue; I also had a few difficulties for a while uploading a sketch from my PC and other communication issues, but I'd say at this stage it's probably user error I have successfully flashed with avrdude via command line (same command as thestraw0039) previously, but not been able to since.
 

Attachments

  • USER_SCOPED_TEMP_DATA_MSGR_PHOTO_FOR_UPLOAD_1579528529829.jpeg
    USER_SCOPED_TEMP_DATA_MSGR_PHOTO_FOR_UPLOAD_1579528529829.jpeg
    689.3 KB · Views: 64
Alright, daemon appeared to not be running due to permission issues, a quick run of doPerms.py seemed to fix that. Here is the error I am getting:

Code:
pi@raspberrypi:/home/brewpi/logs $ cat stderr.txt
2020-01-20 22:06:07  Starting BrewPi.
2020-01-20 22:06:18  '_csv.reader' object has no attribute 'next'
 
Alright, daemon appeared to not be running due to permission issues, a quick run of doPerms.py seemed to fix that. Here is the error I am getting:

Code:
pi@raspberrypi:/home/brewpi/logs $ cat stderr.txt
2020-01-20 22:06:07  Starting BrewPi.
2020-01-20 22:06:18  '_csv.reader' object has no attribute 'next'

Found the issue,

in temperatureProfile.py line 44 and 45

Code:
temperatureReader = csv.reader(csvfile, dialect)
temperatureReader.next() # Discard the first row, which is the table header

temperatureReader.next() is a Python2 code, and this method needs to be changed for Python3. Changing the code to below gets my Brewpi up and running:

Code:
temperatureReader = csv.reader(csvfile, dialect)
next(temperatureReader)

Here is the link that helped me out.

https://memoryleak.in/2018/02/27/ho...o-attribute-next-python-3-6-csv-reader-error/
 
Alright, daemon appeared to not be running due to permission issues, a quick run of doPerms.py seemed to fix that. Here is the error I am getting:

Code:
pi@raspberrypi:/home/brewpi/logs $ cat stderr.txt
2020-01-20 22:06:07  Starting BrewPi.
2020-01-20 22:06:18  '_csv.reader' object has no attribute 'next'
Issue #105 closed, change merged into Master and Devel.
 
Oops. :rolleyes:

Line 516, change "Purple" to "Orange". I'll fix that so it will pick up the one from the config.

I ran into a few issues with a corrupt SD card, and a few other things. I have a fresh install of BrewPi remix up and running. I also found out I am running on a Raspberry PI 3 B not the PI 3 B +. I modified the Tilt.py Script to Orange and get the following responses.

Code:
pi@brewpi:~ $ sudo /home/brewpi/Tilt.py
Reporting Tilt values every 5 seconds. Ctrl-C to stop.
Orange: Temp = 37.0°F, Gravity = 0.998, Battery = 0 weeks old.
Orange: Temp = 37.0°F, Gravity = 0.998, Battery = 11 weeks old.
Orange: Temp = 37.0°F, Gravity = 0.998, Battery = 11 weeks old.
Orange: Temp = 37.0°F, Gravity = 0.998, Battery = 11 weeks old.
Orange: Temp = 37.0°F, Gravity = 0.998, Battery = 11 weeks old.
Orange: Temp = 37.0°F, Gravity = 0.998, Battery = 11 weeks old.
Orange: Temp = 37.0°F, Gravity = 0.998, Battery = 11 weeks old.

My Stderr.txt file is still displaying the following:
2020-01-29 17:28:08 Configured for Tilt but no Bluetooth radio available.
2020-01-29 17:28:08 Starting BrewPi.

I just got BrewPi Remix running and will watch it a for a few days to see if I start getting a Trace for the Gravity.

I do not see a value/color for gravity listed in the Date/Time column on the right. I am currently logging SG with an iPad using the Tilt Application at the same time and saving values to the cloud. Is this causing any issues?
 

Attachments

  • Screen Shot -- No Tilt Listed..jpg
    Screen Shot -- No Tilt Listed..jpg
    219.3 KB · Views: 42
Logging should not matter. Might be that the radio is not “0” but “1” but I forgot where that is offhand and right now I’m on a ship in the Caribbean. :)

I can look when I get back, or maybe someone else is feeling froggy and will try to crack it.

It certainly is strange though, that script you are running should access it the same way.
 
Thanks for your help everyone. Here's my setup running with a 10L batch.
 

Attachments

  • Screenshot_20200202-114859_Chrome.jpg
    Screenshot_20200202-114859_Chrome.jpg
    672.5 KB · Views: 90
  • 20200131_224038.jpg
    20200131_224038.jpg
    3.4 MB · Views: 92
I ran into a few issues with a corrupt SD card, and a few other things. I have a fresh install of BrewPi remix up and running. I also found out I am running on a Raspberry PI 3 B not the PI 3 B +. I modified the Tilt.py Script to Orange and get the following responses.
Well that's certainly strange. I am (at least I thought I was) using the same logic in both places. Let's try something simple. On line 444 insert the following:
Code:
    return True
So that block will look like:
Code:
def checkBluetooth(interface = 0):
    return True
    sock = None
That's just a hack to tell me where the issue may lie, but if I guessed right it should start working. You will of course have to restart the script to have the change take effect.
 
Hello fellow brewers.
I want to build out a controller for my fermentation vessels. Preferably with a display to view everything right there at the units.
I have 2 Unitanks that run off of inkbird c929s and an icemaster glycol chiller that runs off of an itc1000. (Lots of manual adjustment) I would love to have everything wired into one unit with a display screen (remote access would be nice as well).
I just want the unit to know what I want to do and adjust my glycol temps without me having to do so manually. Also I want a higher degree of temp control (the inkbirds are only within 1 degree so the swings are always +/- 1-3 degrees.
Example: when I ferment at 68 degrees I like my glycol around 53 degrees so the swing is minimal. 1-2 degrees typically. And when I cold crash to 36 I lower my glycol to 26 to minimize that swing as well. I know a pid with the right software will be able to dial this in to a much higher degree of accuracy and efficiency.

Is there an updated instructable I can read? Part list? Similar setups? What do you guys suggest?? Please help.
 
Hey, thanks for moving this question here.

I don't believe there are any DIY systems that will do this natively. All of the BrewPi-derivatives use one controller per control point. That said BrewPi Remix and Fermentrack both support multi-chamber which I believe could do what you need. Neither one (yet) natively "speaks" glycol, but at least initial testing indicates it's more than do-able. The basic process is to zero out the PID values, remove the min run time, and run the system under "chamber constant" with the chamber probe in the controlled vessel (be that the glycol loop or the beer.)

I released an alpha version of the firmware with this support baked in. I've not yet gone back and tried to make it configurable since the one person who was trying it seemed to lose interest.

For your specific use, my best idea would be to use three separate chambers - one for the glycol loop, and one each for your fermenter loops. The "main" page under multi-chamber will show all three temps, and drilling down to any of those will show the classic controls for that system.

None of this (nor any DIY system that I am aware of) will simply "know what you want to do" with the glycol loop. Once you have more than one loop things become pretty complex. I've done some work with commercial PLC systems that could do this pretty simply, but each of those systems is "custom" in some way and tailored for the environment.

I do feel like we could definitely get your temps a lot closer and for sure give you a nicer, more comprehensive interface. The hardware lists in the documentation are valid - except you'd need 3x everything having to do with the Arduino and one Raspberry Pi. Another possibility is to use the ESP-8266 controller (which provides built-in wireless connectivity) which is supported in BPR.

Until I get the time to do a UI change, such a system will always think of its world in terms of chamber or beer control. I do want to update the UI to reflect when running in Glycol mode though. If someone were actually trying it, it would make me more interested in hurrying that. :)

Unless someone else has any other ideas about how it can be done?

You can also ping @Thorrak in the Fermentrack thread and see if he has any different ideas. Be aware that Fermentrack and BrewPi Remix should both be thought of as the "front end" to either ESP-8266 or Arduino Uno controllers. They are almost interchangeable, it's a lot about how you want it to look/act on the front end.
 
I would love to have everything wired into one unit with a display screen (remote access would be nice as well).

Is there an updated instructable I can read? Part list? Similar setups? What do you guys suggest?? Please help.

Though I do not run Glycol, I do run a 3 Instance Fermentrack build that can control 3 different chambers. As @LBussy said, You can’t go wrong with either BrewPi Remix or Fermentrack.

That said BrewPi Remix and Fermentrack both support multi-chamber

For your specific use, my best idea would be to use three separate chambers - one for the glycol loop, and one each for your fermenter loops. The "main" page under multi-chamber will show all three temps, and drilling down to any of those will show the classic controls for that system.

@Bigs166 This is what my multi-chamber main page of Fermentrack looks like, and then drilling down to a chamber.

IMG_1634.JPG
IMG_1635.JPG
IMG_1636.JPG
 
Well that's certainly strange. I am (at least I thought I was) using the same logic in both places. Let's try something simple. On line 444 insert the following:
Code:
    return True
So that block will look like:
Code:
def checkBluetooth(interface = 0):
    return True
    sock = None
That's just a hack to tell me where the issue may lie, but if I guessed right it should start working. You will of course have to restart the script to have the change take effect.


Thanks for looking into my issues and providing some insight. This appears to have corrected the issue and I now have a display in the top center providing Tilt battery life, Tilt temp and appear to be getting a value/color for gravity listed in the Date/Time column on the right.

Looks like this short cut fixed the issue.
 
Thanks for looking into my issues and providing some insight. This appears to have corrected the issue and I now have a display in the top center providing Tilt battery life, Tilt temp and appear to be getting a value/color for gravity listed in the Date/Time column on the right.

Looks like this short cut fixed the issue.
Probably one of those "not" != "not" issues (bad programmer joke.) I'll dig into it a little more and see if I can figure out where I went sideways. In the meantime, I'm glad it's working for you!

Entered issue #108 on Github for this.
 
I’ve been using Remix for quite some time now, but just this morning tried to use a temp profile for my temperature rise and diacetyl rest. As soon as I loaded the profile the script crashed and defaulted back to my original beer constant temp. Anyone experience this before or know of a fix?
 
I’ve been using Remix for quite some time now, but just this morning tried to use a temp profile for my temperature rise and diacetyl rest. As soon as I loaded the profile the script crashed and defaulted back to my original beer constant temp. Anyone experience this before or know of a fix?
I recently pushed a fix involving that, you might have to upgrade. Scroll up a little bit to the last release and you'll find instructions on how to do that.
 
Just wanted to drop in with a quick THANKS to @LBussy . I have been successfully using brewPi legacy since early 2016 without any issue and frankly I have never updated anything or touched it since that time. I decided to build another unit for a second chamber so I had to brush up on how I built the first one back in 2016. This is when I found all the work that @LBussy has done to not only keep the Legacy code relevant, but drastically improved the install process and added Multi-chamber, Tilt integration, etc. I was planning on just building a entire setup for the second chamber, until found this project.

I already had my second controller box built and I was able to get the BrewPi Remix multi-chamber installed, configured, and operational in less then 30 minutes. One command ... crazy simple compared to when I built the first one 4 years ago. Again, MANY thanks to you and those that consistently pitch in with their passion and efforts to keep this solution alive.
 
Hello - I have a question for folks here smarter than me, hopefully this is an easy one. I have set up Fermentrack for my latest fermentation chamber build, which includes an I2C LCD display. However, I can't seem to get the I2C variant of the firmware to work, the script does not start and I get an error that Fermentrack is unable to reach brewpi-script. Fermentrack runs just fine when I flash the controller with the latest non-I2C variant (fine except for the LCD display of course). Controller is an Arduino Uno, running on a Raspberry Pi 4. Trying not to sound like an idiot here, but I have very little experience with these systems. Any advice appreciated. Let me know if there is any other info needed about my setup to help troubleshoot?
 
Hello - I have a question for folks here smarter than me, hopefully this is an easy one. I have set up Fermentrack for my latest fermentation chamber build, which includes an I2C LCD display. However, I can't seem to get the I2C variant of the firmware to work, the script does not start and I get an error that Fermentrack is unable to reach brewpi-script. Fermentrack runs just fine when I flash the controller with the latest non-I2C variant (fine except for the LCD display of course). Controller is an Arduino Uno, running on a Raspberry Pi 4. Trying not to sound like an idiot here, but I have very little experience with these systems. Any advice appreciated. Let me know if there is any other info needed about my setup to help troubleshoot?
What pin are you using for the I2C and the OneWire?

Are you using a shield or no?
 
What pin are you using for the I2C and the OneWire?

Are you using a shield or no?
Is the OneWire the data connection that the temperature sensors use? If so, I am using A4 for that. The other pin on the I2C goes to A5 currently.

Not using a shield.
 
Status
Not open for further replies.
Back
Top