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.
I may have found the answer myself - I merely updated the installation to use the "master" branch for the web interface. Is that OK or will it cause me problems?
Legacy is the branch that will talk to the Arduino. I am not sure on that particular setting, but I do know the Master branch is not compatible.
 
I am using a pi3, did an ls /dev/ttys* and didn't get anything so didn't think that existed. I'll try those


Found this info online, don't know if it'll help you though

Code:
Step 3 - Device Tree settings as below:

Add device tree to /boot/config.txt to disable the Raspberry Pi 3 bluetooth.

sudo nano /boot/config.txt
Add at the end of the file

*if you want to change the blutooth to miniuart port(bad)

dtoverlay=pi3-miniuart-bt
*if you want to disable the blutooth(good)

dtoverlay=pi3-disable-bt
Exit the editor saving your changes.

Step 4 - reboot the pi

sudo reboot
step 5 -

a)to disable the Serial Console edit the file using

sudo nano /boot/cmdline.txt
remove the word phase "console=serial0,115200" or "console=ttyAMA0,115200"

Exit and save your changes

b)to Enable the Serial Console edit the file using

sudo nano /boot/cmdline.txt
Change the file to the following:

dwc_otg.lpm_enable=0 console=tty1 console=serial0(or ttyAMA0),115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
Exit and save your changes

Step 6 - reboot the pi

sudo reboot
 
I actually made my setup in the early summer and made two beers during the summer before reinstalling the Raspberry Pi. As far as I remember, there were options to set "minimum on time" and "minimum off time" in the web interface, but now these are nowhere to be found. Am I wrong?

...

I may have found the answer myself - I merely updated the installation to use the "master" branch for the web interface. Is that OK or will it cause me problems?

EDIT 2:
Did not work. Get this in the log:

Nov 03 2016 22:34:44 Controller debug message: INFO MESSAGE 12: Received new setting: minCoolTime = 1
Nov 03 2016 22:34:44 Controller debug message: WARNING 0: Could not process setting

So apparently the Arduino does not understand the setting.

Yeah, you pretty much hit the nail on the head. There's three parts to BrewPi:

brewpi-firmware - The firmware on your Arduino/other device - There are a lot of differences, and the master branch won't work on an Arduino. Everything was pretty much rewritten between legacy and master, but works in mostly the same way. There were substantial changes to the "behind the scenes" variables used in the PID algorithm, however, as well as the conversion of everything to use PWM.

brewpi-script - The part that communicates between firmware & web interface - The legacy and master branch are functionally identical. They added an error message to prevent you from using the master branch with legacy devices, but if you disable that it works fine. A full list of all of the differences is here.

brewpi-www - The web interface - The only real difference I've found is that the "master" web interface expects/sends the "master" behind the scenes variables (and therefore is only compatible with the "master" firmware when attempting to edit these variables). If all you're looking to do is set a beer profile, look at graphs, etc. then the master & legacy branches of brewpi-www are identical.


tl;dr - You happened to try to use the one feature in the "master" branch of brewpi-www that is incompatible with the "legacy" firmware.
 
Bypassed the idea of a direct serial connection and now i'm getting this error:


Nov 04 2016 20:49:03 Opening serial port
Nov 04 2016 20:49:03 Notification: Script started for beer 'My First BrewPi Run'
Nov 04 2016 20:49:13 Checking software version on controller...
Traceback (most recent call last):
File "/home/brewpi/brewpi.py", line 348, in
hwVersion = brewpiVersion.getVersionFromSerial(ser)
File "/home/brewpi/brewpiVersion.py", line 32, in getVersionFromSerial
ser.timeout = 1
File "/usr/local/lib/python2.7/dist-packages/serial/serialutil.py", line 352, in timeout
self._reconfigure_port()
File "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 315, in _reconfigure_port
raise SerialException("Could not configure port: {}".format(msg))
serial.serialutil.SerialException: Could not configure port: (5, 'Input/output error')
Nov 04 2016 20:50:03 Opening serial port
Nov 04 2016 20:50:03 Notification: Script started for beer 'My First BrewPi Run'
Nov 04 2016 20:50:13 Checking software version on controller...
Traceback (most recent call last):
File "/home/brewpi/brewpi.py", line 348, in
hwVersion = brewpiVersion.getVersionFromSerial(ser)
File "/home/brewpi/brewpiVersion.py", line 32, in getVersionFromSerial
ser.timeout = 1
File "/usr/local/lib/python2.7/dist-packages/serial/serialutil.py", line 352, in timeout
self._reconfigure_port()
File "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 315, in _reconfigure_port
raise SerialException("Could not configure port: {}".format(msg))
serial.serialutil.SerialException: Could not configure port: (5, 'Input/output error')
Nov 04 2016 20:51:04 Opening serial port
Nov 04 2016 20:51:14 Errors while opening serial port:
Could not find compatible serial devices
""


going to try a full software re-install... otherwise everything was working swimmingly.
 
however. after it hangs for a while it'll run for about 10 minutes or so (based on screen counter on LCD and stop watch) then it'll just hang for a while, then it'll pick back up... wtf?
 
Sorry to come back to this but I just started working on it.

I repeated the udevadm info -a -n /dev/ttyACM0 | less > info.log and changed it to /ttyACM1 with the log output to info1.log. That's how I found the second Arduino.

My question is, it should be on a different ACM* for each arduino right? When I i follow the rest of your directions i leave the * as a *, and I dont have to put the 0 or 1?

Also, I would change the code you have as brewpi1 and brewpi2 to my folder names, chamber1 and chamber2.

Thanks again!

lol

Ok, I'll offer this: if referring to http://docs.brewpi.com/advanced-setups/multiple-arduinos-single-rpi.html, there's a better mechanism to exploit than using kernel ids.

That is, use the Arduino serial numbers instead, which has the major advantage that the symlink value never, ever changes, no matter how many/how few Arduinos are connected.

It's pretty much the same procedure to find the serial number for each Arduino, then you edit the same arduino.rules file, but the key parameter is different.

eg:

Code:
$ udevadm info -a -n /dev/ttyACM0 | less > info.log

$ sudo nano info.log
.
.
.
	KERNEL=="ttyACM0"
	ATTRS{manufacturer}=="Arduino (www.arduino.cc)"
	ATTRS{serial}=="9543231383735150F0D1"
.
.
.

Record the serial number, then repeat for each Arduino.

Then, create the rules file:

Code:
$ sudo nano /etc/udev/rules.d/99-arduino.rules

SUBSYSTEM=="tty", KERNEL=="ttyACM*" , ATTRS{serial}=="9543231383735150F0D1", SYMLINK+="brewpi1", GROUP="brewpi"
SUBSYSTEM=="tty", KERNEL=="ttyACM*" , ATTRS{serial}=="9425672387582557E2F0", SYMLINK+="brewpi2", GROUP="brewpi"

Cheers!
 
Sorry to come back to this but I just started working on it.

I repeated the udevadm info -a -n /dev/ttyACM0 | less > info.log and changed it to /ttyACM1 with the log output to info1.log. That's how I found the second Arduino.

My question is, it should be on a different ACM* for each arduino right? When I i follow the rest of your directions i leave the * as a *, and I dont have to put the 0 or 1?

Also, I would change the code you have as brewpi1 and brewpi2 to my folder names, chamber1 and chamber2.

Thanks again!

First, one should never be reluctant to ask for assistance here. It's what we do :)

Yes, you leave the asterisk regardless of how many Arduinos you have in play.

Here's the 99-arduino.rules file from my primary system when I had four Arduinos connected via USB:

Code:
SUBSYSTEM=="tty", KERNEL=="ttyACM*", ATTRS{serial}=="85336303532351F0A031", SYMLINK+="brewpi1", GROUP="brewpi"
SUBSYSTEM=="tty", KERNEL=="ttyACM*", ATTRS{serial}=="754373038303510BF870", SYMLINK+="brewpi2", GROUP="brewpi"
SUBSYSTEM=="tty", KERNEL=="ttyACM*", ATTRS{serial}=="5543131323835130B160", SYMLINK+="brewpi3", GROUP="brewpi"
SUBSYSTEM=="tty", KERNEL=="ttyACM*", ATTRS{serial}=="55431313238351104021", SYMLINK+="brewpi4", GROUP="brewpi"

Cheers!
 
Yeah, you pretty much hit the nail on the head. There's three parts to BrewPi:

brewpi-firmware - The firmware on your Arduino/other device - There are a lot of differences, and the master branch won't work on an Arduino. Everything was pretty much rewritten between legacy and master, but works in mostly the same way. There were substantial changes to the "behind the scenes" variables used in the PID algorithm, however, as well as the conversion of everything to use PWM.

brewpi-script - The part that communicates between firmware & web interface - The legacy and master branch are functionally identical. They added an error message to prevent you from using the master branch with legacy devices, but if you disable that it works fine. A full list of all of the differences is here.

brewpi-www - The web interface - The only real difference I've found is that the "master" web interface expects/sends the "master" behind the scenes variables (and therefore is only compatible with the "master" firmware when attempting to edit these variables). If all you're looking to do is set a beer profile, look at graphs, etc. then the master & legacy branches of brewpi-www are identical.


tl;dr - You happened to try to use the one feature in the "master" branch of brewpi-www that is incompatible with the "legacy" firmware.

Thank you for the detailed info :) I might update to use the newer version of brewpi-script.

With regards to brewpi-firmware, I downloaded the 0.2.10 source code and set the relevant parameters to zero (cooler minimum on time, cooler minimum off time, time to wait between heating and cooling), then compiled and uploaded to the Arduino through the BrewPi UI. So far, it seems to have solved my problem, and my temperature control has become much more precise.

I suggest that other BrewPi legacy/Arduino + FTSS users, using BrewPi in fridge constant mode, do the same in order to avoid large temperature fluctuations due to the BrewPi cooling for a minimum of 3 minutes no matter the temperature of the fridge (the fridge being the beer). The parameters were probably set by Elco to protect the compressor of a fridge or freezer from rapidly switching on and off, but when using the BrewPi to control a cheap replaceable pump, these settings are unnecessary.

I don't know why I didn't notice the problem when fermenting in the summer. Perhaps because my room was about 77f or more all the time. Now my room is 71.6f or less. Now, especially during secondary fermentation when the exothermic reaction does not generate much heat, there the problem is evident. As less heat is generated in the fermenter, the cooling is less active, and the water in the reservoir becomes colder and colder (because the reservoir is inside a keezer set to 35.6f). For instance, if my set point is 68f and the BrewPi is set to cool at 68.9f (through the settings in the UI), the temperature ends up at 66.56f after 3 minutes. At the end of secondary fermentation, when the water in the reservoir is as cold as it is going to be, it would probably end up lower than 66.56f. Glad I got this problem solved.
 
When you change to the legacy branch it will ask you at one point which firmware you want to use on the arduino... select accordingly, I believe it's 2.10, 2.8, and 2.4 and the numbers maybe different. Also, the hex file is available in the github albeit it's a little confusing to find. Lastly if you REALLY can't find it, i can send it to you.
 
When you change to the legacy branch it will ask you at one point which firmware you want to use on the arduino... select accordingly, I believe it's 2.10, 2.8, and 2.4 and the numbers maybe different. Also, the hex file is available in the github albeit it's a little confusing to find. Lastly if you REALLY can't find it, i can send it to you.

Its 0.2.10, 0.2.9 and 0.2.8. Just ran the updater with the --ask parameter.
 
Can send 2.4 if you want. Do none of the other firmware have the option you're seeking?
 
Can send 2.4 if you want.
0.2.4 would be VERY old (there is no 2.4), it seems odd that this would have a feature that is not in the 0.2.10 (latest Arduino version).

The script, the web page, and the firmware must all be on the same version in order to avoid these incompatibilities.

I don't see a setting for the cooling delay in this version so you may have to dig into the source code and find it.
 
Can someone please explain how to connect brewpi to 2 ssr and not relay module?
 
0.2.4 would be VERY old (there is no 2.4), it seems odd that this would have a feature that is not in the 0.2.10 (latest Arduino version).

The script, the web page, and the firmware must all be on the same version in order to avoid these incompatibilities.

I don't see a setting for the cooling delay in this version so you may have to dig into the source code and find it.

I agree. Anyway, I solved my problem by modifying the source code of the 0.2.10 version to ignore min cooling time.
 
I agree. Anyway, I solved my problem by modifying the source code of the 0.2.10 version to ignore min cooling time.
Glad you got it figured ... where did you find that by the way? I looked (albeit briefly) and could not find it.
 
Glad you got it figured ... where did you find that by the way? I looked (albeit briefly) and could not find it.

It is in the top of the \app\controller\TempControl.h file, from line 33 and onwards. As you can see, I have modified my cooling constants and set the switch time between heating to 0 seconds. I have not changed my heating constants, because they do not matter to me, as I don't have a heating solution for my conical (I rely on my rooms temperature to do the magic).

Code:
// Set minimum off time to prevent short cycling the compressor in seconds
const uint16_t MIN_COOL_OFF_TIME = 5;
// Use a minimum off time for the heater as well, so it heats in cycles, not lots of short bursts
const uint16_t MIN_HEAT_OFF_TIME = 300;
// Minimum on time for the cooler.
const uint16_t MIN_COOL_ON_TIME = 5;
// Minimum on time for the heater.
const uint16_t MIN_HEAT_ON_TIME = 180;
// Use a large minimum off time in fridge constant mode. No need for very fast cycling.
const uint16_t MIN_COOL_OFF_TIME_FRIDGE_CONSTANT = 5;
// Set a minimum off time between switching between heating and cooling
const uint16_t MIN_SWITCH_TIME = 0;
// Time allowed for peak detection
const uint16_t COOL_PEAK_DETECT_TIME = 1800;
const uint16_t HEAT_PEAK_DETECT_TIME = 900;

I also modified the source code to allow running beer profile mode without the typical beer in carboy in fridge setup. I am currently running beer profile mode with my conical and it seems to be working very well, significantly better than fridge constant mode with long minimum on and off times.
 
My BrewPi freaked out a little last night:

Untitled.png
 
Hopefully folks will notice the time stamps and figure it out for themselves.

brewpi_dst.jpg

Otherwise, I'm going to leave the helping out to you on this one...

Cheers! ;)
 
I work for a "large software company" and we were staffing the time change. Being somewhat bored I was playing around with my BrewPi during this time. Contextually it should not have surprised me but I have to admit it took me a second to figure out what was up. :p

For the benefit of a person reading this who may not know: This would/should be considered a display issue since the Arduino controls the temp and the Pi is mostly just displaying the results. If a person was doing a temp profile with steps that fell between 01:01-01:59 it could lead to interesting results because that part would actually be controlled by the Pi, but I can't think of any other potential issues.
 
In the grand scheme of things it won't really matter. if you're cold crashing at 2 in the morning then you have bigger problems to deal with….
 
i made the brew pi according to this thread and it works fine, but i bought new sensor from the brewpi shop and installed them on the arduino but when i power them they read 85°c instead of 15 (basement temp) anyone got some idea's about this.
i posted the question on the brewpi community but havent got a decent reply so i hope there some smart people here who can help out a computer and software moron. i cant get my head around computer code so i'm looking for a copy-past solution.

thanks guy's
 
I'm fermenting my beer for the first time in my new setup (large fridge with 50l CCT, heated with 2x50watt resistors). If you look at my graph, does it seem that the heating elements might be a bit overpowered? (zoomed in on 2 parts)

It's been running for almost a week now, so the PID's are normally already perfectly set by now..

You can also look at the live curve: www.kglprinting.com/brew

overpowered heating 1.png


overpowered heating 2.png
 
Worth reviewing your steps. I've gone through this a few times and this has worked consistently.


cd /etc/apache2/sites-available

sudo nano default

look for <directory /var/www/> ... </directory>
change allowOverride to All

restart apache:
cd /usr/sbin
sudo apache2ctl -k graceful

cd /var/www

sudo nano .htaccess
Add all this including the punctuation:

<Files "index.php">
AuthUserFile /var/www/private/.htpasswd
AuthGroupFile /dev/null
AuthName "Put Your Brewery Name Here"
AuthType Basic

<Limit GET POST>
require valid-user
</Limit>
</Files>

Write the file out and exit.

mkdir private
cd private

htpasswd -c .htpasswd username (where username is whatever actual username you'll use to access the web page. I use brewpi, fwiw)...

Cheers!

I am attempting to ad a login page to my brewpi webpage folloing these instructions. When i do sudo nano default it seems to open a blank file.

I have tried sudo nano 000-default.conf but am not seeing the

"<directory /var/www/> ... </directory>" so I am not sure if this is even the correct file.

Any guidance would be greatly appreciated.
 
I'm fermenting my beer for the first time in my new setup (large fridge with 50l CCT, heated with 2x50watt resistors). If you look at my graph, does it seem that the heating elements might be a bit overpowered? (zoomed in on 2 parts)

It's been running for almost a week now, so the PID's are normally already perfectly set by now..

You can also look at the live curve: www.kglprinting.com/brew

Maybe a bit? But not really, the fridge temperature more or less follows the fridge setting(which is where BrewPi wants to be), maybe overshooting by 1 degree or so but that doesnt really matter because your temps are staying pretty stable.
 
I am attempting to ad a login page to my brewpi webpage folloing these instructions. When i do sudo nano default it seems to open a blank file.

I have tried sudo nano 000-default.conf but am not seeing the

"<directory /var/www/> ... </directory>" so I am not sure if this is even the correct file.

Any guidance would be greatly appreciated.

Which version Raspbian are you using - Wheezy (older) or Jessie (current)?

Cheers!
 
i made the brew pi according to this thread and it works fine, but i bought new sensor from the brewpi shop and installed them on the arduino but when i power them they read 85°c instead of 15 (basement temp) anyone got some idea's about this.
i posted the question on the brewpi community but havent got a decent reply so i hope there some smart people here who can help out a computer and software moron. i cant get my head around computer code so i'm looking for a copy-past solution.

thanks guy's


85 deg is the temperature you get from the sensor when there is some kind of error. Chase the BrewPi guys - it sounds like there may be a power issue.
 
i made the brew pi according to this thread and it works fine, but i bought new sensor from the brewpi shop and installed them on the arduino but when i power them they read 85°c instead of 15 (basement temp) anyone got some idea's about this.
i posted the question on the brewpi community but havent got a decent reply so i hope there some smart people here who can help out a computer and software moron. i cant get my head around computer code so i'm looking for a copy-past solution.

thanks guy's

Clarification, please: how many sensors are you now running, and how many of the sensors are the new ones?
And which ones are reporting 85°C?

Cheers!
 
I am attempting to ad a login page to my brewpi webpage folloing these instructions. When i do sudo nano default it seems to open a blank file.

I have tried sudo nano 000-default.conf but am not seeing the

"<directory /var/www/> ... </directory>" so I am not sure if this is even the correct file.

Any guidance would be greatly appreciated.

did you do the cd/bla bla bla before you tried the sudo? plan on working on this over this upcoming weekend and trying to fumble my way to get it to work. but i tried it with out the cd/ first and got what you did then i added the cd/ and got it to come up. so its worth a shot if you didnt add that first
 
Ugh. Haven't done this on my Jessie test bed yet, and first glance the Apache2 installation config files are different and/or moved.
I had changed the config to use /var/www as the document root successfully, (the current Apache2 defaults to /var/www/html) so some of it behaves the same.

I'll put this on my todo list but hopefully someone else has gone down this road on Jessie already...

Cheers!
 
Ugh. Haven't done this on my Jessie test bed yet, and first glance the Apache2 installation config files are different and/or moved.
I had changed the config to use /var/www as the document root successfully, (the current Apache2 defaults to /var/www/html) so some of it behaves the same.

I'll put this on my todo list but hopefully someone else has gone down this road on Jessie already...

Cheers!

Thank you sir.
 
Is there a trick to getting the temperature probes calibrated? I hooked mine up and they both were reading 185 Fehrenheit initially, then the fridge one started changing a bit, but I can't figure out how to calibrate them at all. I was hoping to get it setup and currently have a kolsch sitting in an ice bath til this thing is running.
 
Status
Not open for further replies.
Back
Top