Quantcast

HOWTO - Make a BrewPi Fermentation Controller For Cheap

HomeBrewTalk.com - Beer, Wine, Mead, & Cider Brewing Discussion Community.

Help Support Homebrew Talk:

Status
Not open for further replies.

Fcsteve777

Member
Joined
Jan 16, 2017
Messages
5
Reaction score
0
Sorry but i have tried searching and i know this is going to be a stupid question for someone that is familiar with arduino...

I downloaded the hex and the source code, I can find the appropriate file to edit in the source code folder. But how do i compile that whole folder back into a hex file to load back onto the arduino.

Again sorry for the newb arduino question but my google fu has failed me tonight.

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.
 

day_trippr

"Now brewing exclusively with Hydrohydroxic Acid"
Joined
May 31, 2011
Messages
35,097
Reaction score
16,967
Location
Stow, MA
Elco (the author) uses Atmel Studio for compiling the Arduino hex file...

Cheers!
 

Fcsteve777

Member
Joined
Jan 16, 2017
Messages
5
Reaction score
0
After i posted this i went to the brewpi community and found that out haha. Unfortunately even right out of the repository it wont compile as there is an error and warning. I posted over there so hopefully it can get sorted out.

I have a radiator setup with ice water (DIY Glycol on the way) and a PTC heater for heating and im surprised how fast that pc radiator takes the heat down in the chamber even with it just being ice water.
 

ame

Well-Known Member
Joined
Oct 25, 2015
Messages
378
Reaction score
60
It sounds similar to a Son of Fermentation Chiller, which uses frozen bottles of water in a small chamber with a PC fan to cycle air from the main chamber to cool it.
 

wbarber69

Well-Known Member
Joined
Oct 13, 2013
Messages
2,191
Reaction score
263
After i posted this i went to the brewpi community and found that out haha. Unfortunately even right out of the repository it wont compile as there is an error and warning. I posted over there so hopefully it can get sorted out.

I have a radiator setup with ice water (DIY Glycol on the way) and a PTC heater for heating and im surprised how fast that pc radiator takes the heat down in the chamber even with it just being ice water.

Iirc you have to remove some line in the post processor settings. don't remember much more than that
 

Fcsteve777

Member
Joined
Jan 16, 2017
Messages
5
Reaction score
0
Yep that was it, In the properties area you have to remove the command in the window. Documented in the BrewPi community. It fixed it for the heating but i need to up the max overshoot number for the cooling side to get it to eep the fridge where it needs to be without overshooting. There is alot of thermal mass in the radiator that seems to trip it up, but its probably similar to someone running a jacketed conical where once you cool the jacket down there is alot of carry over.

I have the first beer in the chamber as i have no doubts about it holding temp but after its done i would like to get rid off the cooling overshoot that needs a heat cycle, just more tuning.
 

jmark

Well-Known Member
Lifetime Supporter
Joined
Jan 30, 2011
Messages
975
Reaction score
192
Location
Marietta, GA
Okay, I've spent the better part of the last two hours trying to figure out WTF is wrong with my PHP code for the LCD.php when using multiple chambers... I keep getting Internal Server 500 Errors and the log says

PHP Parse error: syntax error, unexpected '<' in /var/www/chamber1/lcd.php on line 59.

Code:
<?php
/* Copyright 2012 BrewPi/Elco Jacobs.
* This file is part of BrewPi.
* BrewPi is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* BrewPi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with BrewPi.  If not, see <http://www.gnu.org/licenses/>.
*/ 

//load default settings from file
$defaultSettings = file_get_contents('defaultSettings.json');
if($defaultSettings == false){
	die("Cannot open default settings file: defaultSettings.json");
}
$settingsArray = json_decode(prepareJSON($defaultSettings), true);
if(is_null($settingsArray)){
	die("Cannot decode defaultSettings.json");
}
// overwrite default settings with user settings
if(file_exists('userSettings.json'))

	{
	$userSettings = file_get_contents('userSettings.json');
	if($userSettings == false){
		die("Error opening settings file userSettings.json");
	}
	$userSettingsArray = json_decode(prepareJSON($userSettings), true);
	if(is_null($settingsArray)){
		die("Cannot decode userSettings.json");
	}
	foreach ($userSettingsArray as $key => $value)

	{
		$settingsArray[$key] = $userSettingsArray[$key];
	}
}

$beerName = $settingsArray["beerName"];
$tempFormat = $settingsArray["tempFormat"];
$profileName = $settingsArray["profileName"];
$dateTimeFormat = $settingsArray["dateTimeFormat"];
$dateTimeFormatDisplay = $settingsArray["dateTimeFormatDisplay"];

function prepareJSON($input) 

{
    //This will convert ASCII/ISO-8859-1 to UTF-8.
    //Be careful with the third parameter (encoding detect list), because
    //if set wrong, some input encodings will get garbled (including UTF-8!)
    $input = mb_convert_encoding($input, 'UTF-8', 'ASCII,UTF-8,ISO-8859-1');

//Remove UTF-8 BOM if present, json_decode() does not like it.
    if(substr($input, 0, 3) == pack("CCC", 0xEF, 0xBB, 0xBF)) $input = substr($input, 3);</p><p>    return $input;
}

?>
<!DOCTYPE html >
<html>
	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<title>BrewPi reporting for duty!</title>
		<link type="text/css" href="css/redmond/jquery-ui-1.10.3.custom.css" rel="stylesheet" />
		<link type="text/css" href="css/style.css" rel="stylesheet"/>
		<link rel="apple-touch-icon" href="touch-icon-iphone.png">
        <link rel="apple-touch-icon" sizes="76x76" href="touch-icon-ipad.png&quoquot;>
        <link rel="apple-touch-icon" sizes="120x120" href="touch-icon-iphone-retina.png">
        <link rel="apple-touch-icon" sizes="152x152" href="touch-icon-ipad-retina.png">
        <meta name="apple-mobile-web-app-title" content="BrewPi">
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <link rel="apple-touch-startup-image" href="splash.png" />
	</head>
	<body>
		
		<div id="lcd" class="lcddisplay"><span class="lcd-text">
		<span class="lcd-line" id="lcd-line-0">Live LCD waiting</span>
		<span class="lcd-line" id="lcd-line-1">for update from</span>
		<span class="lcd-line" id="lcd-line-2">script...</span>
		<span class="lcd-line" id="lcd-line-3"></span></p><p>		

</div>
		<script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>
		<script type="text/javascript" src="js/jquery-ui-1.10.3.custom.min.js"></script>
		<script type="text/javascript" src="js/jquery-ui-timepicker-addon.js"></script>
		<script type="text/javascript" src="js/spin.js"></script>
		<script type="text/javascript" src="js/dygraph-combined.js"></script>
		<script type="text/javascript">
			// pass parameters to JavaScript
			window.tempFormat = <?php echo "'$tempFormat'" ?>;
			window.beerName = <?php echo "\"$beerName\""?>;
			window.profileName = <?php echo "\"$profileName\""?>;
			window.dateTimeFormat = <?php echo "\"$dateTimeFormat\""?>;
			window.dateTimeFormatDisplay = <?php echo "\"$dateTimeFormatDisplay\""?>;
		</script>
		<script type="text/javascript" src="js/main.js"></script>
		<script type="text/javascript" src="js/device-config.js"></script>
		<script type="text/javascript" src="js/control-panel.js"></script>
		<script type="text/javascript" src="js/maintenance-panel.js"></script>
		<script type="text/javascript" src="js/beer-chart.js"></script>
		<script type="text/javascript" src="js/profile-table.js"></script>
		
	</body>
</html>
Any ideas??? It seems that it hates the closing php tag for some reason, but I really don't know how to resolve this.
 

pocketmon

Well-Known Member
Joined
Oct 12, 2015
Messages
690
Reaction score
221
Okay, I've spent the better part of the last two hours trying to figure out WTF is wrong with my PHP code for the LCD.php when using multiple chambers... I keep getting Internal Server 500 Errors and the log says

PHP Parse error: syntax error, unexpected '<' in /var/www/chamber1/lcd.php on line 59.
How did you get the files?

This is not correct PHP syntax.
Code:
 if(substr($input, 0, 3) == pack("CCC", 0xEF, 0xBB, 0xBF)) $input = substr($input, 3);</p><p>    return $input;
 

jmark

Well-Known Member
Lifetime Supporter
Joined
Jan 30, 2011
Messages
975
Reaction score
192
Location
Marietta, GA
Copied directly from this thread! This gives me something to look at though... thanks.

Edit... hmm... not so fast... don't know how those paragraph tags got in there. They are not in my files :(

Edit.. edit... upon further review those tags WERE in my files... no idea how they got there but removing them resolved the issue. Thanks a bunch... it helps to have a second set of eyes spot the obvious error!!!
 

Diesel48

Well-Known Member
Joined
Jan 6, 2010
Messages
114
Reaction score
2
Location
West Michigan
For people with chest freezers, what are you setting your minimum temp to? I am using the default 33.8. Do you set yours any lower than that?
 

Mikmonken

Well-Known Member
Joined
Mar 28, 2013
Messages
423
Reaction score
101
For people with chest freezers, what are you setting your minimum temp to? I am using the default 33.8. Do you set yours any lower than that?

I've set mine to -16c to + 30c for no other reason than I can lager and I don't plan to have it go any higher than 30c for fermentation.
 

wbarber69

Well-Known Member
Joined
Oct 13, 2013
Messages
2,191
Reaction score
263
Keep my keezer at 42. Because the colder you go the less you'll be able to taste your beer. IPAs really should be served at 45 degrees to be able to enjoy all the flavor sand aromas from the hops.
 

Mikmonken

Well-Known Member
Joined
Mar 28, 2013
Messages
423
Reaction score
101
Keep my keezer at 42. Because the colder you go the less you'll be able to taste your beer. IPAs really should be served at 45 degrees to be able to enjoy all the flavor sand aromas from the hops.

I think you've misinterpreted the question. It's not what temp you keep your keezer at but the maximum low point it can reach under settings.

When I cold crash a lager for example my fridge needs to try to cool to -8c to drop the fridge to freezing quickly so I set my minimum setting way below that. If your fridge min setting is 42f you'd hardly be able to cold crash or lager.

Do you just use yours for serving, rather than fermenting?
 

cunnol

Active Member
Joined
Feb 16, 2016
Messages
35
Reaction score
2
I've set up two arduinos so far without many issues, I'm setting up a 3rd and am the installing devices stage Usually I'd reset the eeprom here, which I've done, yet I still can't get anything to move up into the installed devices section. Does anybody know of any other reason this wouldn't work? Thanks
 

wbarber69

Well-Known Member
Joined
Oct 13, 2013
Messages
2,191
Reaction score
263
I've set up two arduinos so far without many issues, I'm setting up a 3rd and am the installing devices stage Usually I'd reset the eeprom here, which I've done, yet I still can't get anything to move up into the installed devices section. Does anybody know of any other reason this wouldn't work? Thanks

Go to advanced settings and scroll all the way to the bottom of the bottom screen. click restore to factory defaults or whatever it says down there. magically everything will work now.
 

cunnol

Active Member
Joined
Feb 16, 2016
Messages
35
Reaction score
2
Go to advanced settings and scroll all the way to the bottom of the bottom screen. click restore to factory defaults or whatever it says down there. magically everything will work now.
Tried that too, did it manually via ssh, while logged on as normal user and as root. Still nothing...I'm at a loss
 

Mikmonken

Well-Known Member
Joined
Mar 28, 2013
Messages
423
Reaction score
101
Tried that too, did it manually via ssh, while logged on as normal user and as root. Still nothing...I'm at a loss
Do you know which version of BrewPi you're running, you might want to make sure you have install the legacy version.

Arduino users
This new release did not fit into an Arduino and it is unlikely we can make it fit in the future. To keep using your Arduino version of BrewPi, and to prevent our update scripts from updating the UI to something that only works with 0.4.0 and later, change your branch to the 'legacy' branch. Run the updater with --ask. It will ask you which branch to check out. Choose 'legacy'.

Code:
cd ~/brewpi-tools
sudo python updater.py --ask
 

wbarber69

Well-Known Member
Joined
Oct 13, 2013
Messages
2,191
Reaction score
263
Tried that too, did it manually via ssh, while logged on as normal user and as root. Still nothing...I'm at a loss

? Don't know how you clicked a button on a website from under ssh terminal but whatever?
 

cunnol

Active Member
Joined
Feb 16, 2016
Messages
35
Reaction score
2
? Don't know how you clicked a button on a website from under ssh terminal but whatever?
When I say 'it' I'm referring to resetting the eeprom not the button on the brewpi ui. Hope that clears up the confusion
 

cunnol

Active Member
Joined
Feb 16, 2016
Messages
35
Reaction score
2
Do you know which version of BrewPi you're running, you might want to make sure you have install the legacy version.

Arduino users
This new release did not fit into an Arduino and it is unlikely we can make it fit in the future. To keep using your Arduino version of BrewPi, and to prevent our update scripts from updating the UI to something that only works with 0.4.0 and later, change your branch to the 'legacy' branch. Run the updater with --ask. It will ask you which branch to check out. Choose 'legacy'.

Code:
cd ~/brewpi-tools
sudo python updater.py --ask
The thing is I've successfully set up two other arduinos using the same raspberry pi. They're atmega rather than official arduinos so I uploaded the hex via xloader on all of them. This one is just getting stuck at the installed devices stage. It worked perfectly after resetting the eeprom on the other two atmegas. Thanks for all the advice so far
 

wbarber69

Well-Known Member
Joined
Oct 13, 2013
Messages
2,191
Reaction score
263
So I guess you're not going to try hitting the button on the webui…
 

wbarber69

Well-Known Member
Joined
Oct 13, 2013
Messages
2,191
Reaction score
263
After you hit set defaults try using one of the send to arduino buttons up above it in the advanced settings. Then reload the page and try adding devices again. it's not the board more than likely. it's got to do with Python or some weird php character. I'm guessing that it's coming up as having the script running and all. otherwise youd have started with that. Have you tried programming from the webui?
 
Joined
Feb 18, 2017
Messages
24
Reaction score
16
Hi. I'm going to build a brewpi system with arduino, raspberry and brewpi.
As there are many versions of arduino and raspberry, the question is simple:

Which is the most updated and proven to buy.

Thank you!
 

day_trippr

"Now brewing exclusively with Hydrohydroxic Acid"
Joined
May 31, 2011
Messages
35,097
Reaction score
16,967
Location
Stow, MA
Hi. I'm going to build a brewpi system with arduino, raspberry and brewpi. As there are many versions of arduino and raspberry, the question is simple:
Which is the most updated and proven to buy.
Might be a conflict between "most updated and "proven", both from a software package version and the hardware to run it.

The "most updated" BrewPi package uses the ARM Cortex M3 (Spark core) and relies on an extensive one-wire implementation for sensors and actuators. This is the actively supported version with upwards and outwards expansion potential that perhaps will be exploited by the developer some day.

Otoh, the "least updated" BrewPi version relies on an Atmel microcontroller communicating with a host processor, typically an RPi of some vintage. This package will likely never see another update, but has the advantage of plenty of supporters here on HBT.

Indeed, I don't know of anyone running BrewPi Spark on HBT.

For the Spark version hardware, see the developer's site for fully assembled kits. Haven't read of anyone cloning that version yet.

For the Arduino version, an implementation using an RPi2B and an Arduino Uno R3 (preferably one using a legit Atmel 16U2 for the USB/serial bridge as opposed to CH340/CH341 found on the really cheap Uno clones from China) would be the most likely to succeed with the fewest headaches.
As well, HBT members have developed BrewPi shields that support all of the functionality found in the original BrewPi (rev C) shield...

Cheers!
 
Joined
Feb 18, 2017
Messages
24
Reaction score
16
Good! Really interesting.
TY very much for explain in detail.

So...otoh, since I also have to buy a Raspberry, I would prefer to have more updated hardware.
Does anyone have BrewPi + Arduino + RaspPI R3 B+ (i.e) running smoothly?
If so, which model in particular?
And if possible, download links for firmware + soft.

TY
 

stlbeer

Senior Member
Joined
Jan 20, 2008
Messages
1,087
Reaction score
68
Location
Fenton
Good! Really interesting.
TY very much for explain in detail.

So...otoh, since I also have to buy a Raspberry, I would prefer to have more updated hardware.
Does anyone have BrewPi + Arduino + RaspPI R3 B+ (i.e) running smoothly?
If so, which model in particular?
And if possible, download links for firmware + soft.

TY
RPi 3B is the latest version and it works just fine.
https://www.raspberrypi.org/products/
It's faster than the RPi 2B+, the 2B+ works just fine.

As Day_trippr stated, get Arduino's with the Atmel 16U2 bridge chips. Try to get original R3's. ATMEGA's won't work. I know Fry's sells and R4 Arduino, but I haven't tried it yet.

See the top of this thread for a location with up to date installation instructions. They are very well written and if you read them and follow them you will likely be successful.

Follow-up with this forum. We're happy to help.
 

jmark

Well-Known Member
Lifetime Supporter
Joined
Jan 30, 2011
Messages
975
Reaction score
192
Location
Marietta, GA
Has anyone had any success building the 0.2.10 legacy branch from scratch? I'm trying to fix a small bug that was fixed in 0.2.11 but since that branch is not supported for the Arduino, I was just going to recompile 0.2.10 with the change. I've tried both the method described in this thread and using Atmel Studio but no luck... it keeps complaining about missing dependencies for Actuator.o which I don't think even exists in this branch. There's a thread on the Brewpi community where another guy has the same issue but no solution yet. Figured I'd post here too.
 
Joined
Feb 18, 2017
Messages
24
Reaction score
16
RPi 3B is the latest version and it works just fine.
https://www.raspberrypi.org/products/
It's faster than the RPi 2B+, the 2B+ works just fine.

As Day_trippr stated, get Arduino's with the Atmel 16U2 bridge chips. Try to get original R3's. ATMEGA's won't work. I know Fry's sells and R4 Arduino, but I haven't tried it yet.

See the top of this thread for a location with up to date installation instructions. They are very well written and if you read them and follow them you will likely be successful.

Follow-up with this forum. We're happy to help.
TY very much for the extensive information! Will try RPI 3 B and UNO R3.
Cheers!
 
Joined
Feb 18, 2017
Messages
24
Reaction score
16
RPi 3B is the latest version and it works just fine.
https://www.raspberrypi.org/products/
It's faster than the RPi 2B+, the 2B+ works just fine.

As Day_trippr stated, get Arduino's with the Atmel 16U2 bridge chips. Try to get original R3's. ATMEGA's won't work. I know Fry's sells and R4 Arduino, but I haven't tried it yet.

See the top of this thread for a location with up to date installation instructions. They are very well written and if you read them and follow them you will likely be successful.

Follow-up with this forum. We're happy to help.
TY very much indeed. Will try RPI 3 B and UNO R3 and comment.
Cheers! ;)

Edit: So... you mean this R3 card is not valid? http://www.ebay.es/itm/201530741428
I understand CH340 / CH341 is the "cheap and not good" option.
Can you pls put a link example of valid R3 card (clone or Arduino, not original) ?
Ty and sorry, I do not have high knows about tech
 

day_trippr

"Now brewing exclusively with Hydrohydroxic Acid"
Joined
May 31, 2011
Messages
35,097
Reaction score
16,967
Location
Stow, MA
It would be wonderful if someone would indeed post a blow-by-blow How To Compile BrewPi Hex Code In Atmel Studio 7.
I've given it a couple of tries and utterly failed both times...

Cheers!
 

froot

Well-Known Member
Joined
Sep 7, 2014
Messages
114
Reaction score
13
It would be wonderful if someone would indeed post a blow-by-blow How To Compile BrewPi Hex Code In Atmel Studio 7.
I've given it a couple of tries and utterly failed both times...

Cheers!
Hold it a second!:eek:

Your the Guru!!!:goat:

We're screwed!!!:smack:

It may be studio 7 just sux, but what error is it coming up with? I know there were a few sketches I had for other stuff that HAD to be compile in Linux, or the file size was just too big to load to the uno. I'm in the middle of switching my setup over to BrewPiless and BrewmaniacEx, so can't do too much testing myself, Just wish the postie would hurry up already.
And lets not discuss Chinese New Year.
 

stlbeer

Senior Member
Joined
Jan 20, 2008
Messages
1,087
Reaction score
68
Location
Fenton
It would be wonderful if someone would indeed post a blow-by-blow How To Compile BrewPi Hex Code In Atmel Studio 7.
I've given it a couple of tries and utterly failed both times...

Cheers!
Agreed. Same here.
 

ame

Well-Known Member
Joined
Oct 25, 2015
Messages
378
Reaction score
60
My solution was to re-write everything in Python. No compiler, no HEX file, no Arduino.
 

day_trippr

"Now brewing exclusively with Hydrohydroxic Acid"
Joined
May 31, 2011
Messages
35,097
Reaction score
16,967
Location
Stow, MA
LOL! Ok, but how is that helpful to the question at hand?
You know the answer...

Cheers! ;)
 

day_trippr

"Now brewing exclusively with Hydrohydroxic Acid"
Joined
May 31, 2011
Messages
35,097
Reaction score
16,967
Location
Stow, MA
Hold it a second!:eek:

Your the Guru!!!:goat:

We're screwed!!!:smack:[...]
Don't lose hope, it's probably me.

I am highly skilled (over four decades experience) in finding software potholes to fall into.

Honest to Big Hairy Thunderer, when I worked for IBM/DEC/HP/Stratus the CAD/CAE software wizards would have me trial their work.
Typically, I would find all the weak spots they were trying to hide ;)

Cheers!
 
Status
Not open for further replies.
Top