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.
Thanks for this great work. A question if anyone can help me (I'm rather new at this). Instead of buying both temperature probes and relays, could I use the ones in a stc 1000? I have several around but I am planning to evolve to a controller such as this, with remote control + data logging.

I have seen that some logging can be done with an arduino + stc 1000, as shown here: https://github.com/matsstaff/stc1000-datalogger
But can I use the stc 1000 like this: use it as a temperature probe, shows the temperature in the display, gives the temperature data to the arduino so it can do its work, but re using the stc 1000 relays instead of using the wiring shown as standard in this post?
Any help would be appreciated, thanks in advance!

No unfortunately the BrewPi expects them to be DS18B20 sensors that it can detect on a OneWire bus hooked up to the Uno. Im sure you could get it to work with weeks of hacking away at the code, or just spend $15 and get the relays and probes :)
 
OK, I started a new brew yesterday and in checking my BrewPi logs this morning came across this. It's running fine just thought the error was odd.
File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 485, in write
raise SerialException('write failed: %s' % (v,))
serial.serialutil.SerialException: write failed: [Errno 5] Input/output error
Mar 02 2015 03:00:01 Notification: Script started for beer 'Blues Brothers Ale'
Mar 02 2015 03:00:12 Found BrewPi v0.2.4, running commit 2a6f7f05 build 40, on an Arduino standard with a revC shield on port /dev/ttyACM0

Transport error between Arduino and BrewPi host system.
Are you powering your Arduino via its USB input?

Cheers!
 
We need to put a sticky somewhere that says, "if you bought a third party arduino and it came with its own usb cable, just go ahead and throw that cable away..."
 
Mar 01 2015 14:16:16 Notification: Script started for beer 'BrewPi2 Test4'
Mar 01 2015 14:16:28 Found BrewPi v0.2.4, running commit 2a6f7f05 build 40, on an Arduino standard with a revC shield on port /dev/rfcomm0

Why doesn't your log look something like that?
Are you still trying to use your home-cooked hex file?

Cheers!

Yes, It's a Home cooked Hex.. My DIY board doesn't have a Shift Register for the LCD so I can't use the RevA, RecA hexs and I have an Uno, the only DIY hex is for Leonardo.
 
Yes, It's a Home cooked Hex.. My DIY board doesn't have a Shift Register for the LCD so I can't use the RevA, RecA hexs and I have an Uno, the only DIY hex is for Leonardo.

Where did you get that notion?

Check out the stable hex file repository. I'm pretty sure everyone here - or nearly everyone anyway - is using the rev C Uno hex file on their Uno or "almost Unos".

Also, the only way BrewPi "knows" what shield you're using is via the hex file - it actually has no way to determine shield type on its own. Therefore it actually doesn't matter if you have the "right" or "wrong" shield installed - or no shield at all. The hex file will still upload.

Use the rev C Uno file and I suspect at least some of the problems you're seeing will go away.

Also, I'm pretty sure the addition of the shift register was a Rev C thing - I think the Rev A actually drove all the LCD pins directly.
But you don't need the display or the shift register. BrewPi won't know if they're there or not...

Cheers!
 
Where did you get that notion?

Check out the stable hex file repository. I'm pretty sure everyone here - or nearly everyone anyway - is using the rev C Uno hex file on their Uno or "almost Unos".

Also, the only way BrewPi "knows" what shield you're using is via the hex file - it actually has no way to determine shield type on its own. Therefore it actually doesn't matter if you have the "right" or "wrong" shield installed - or no shield at all. The hex file will still upload.

Use the rev C Uno file and I suspect at least some of the problems you're seeing will go away.

Also, I'm pretty sure the addition of the shift register was a Rev C thing - I think the Rev A actually drove all the LCD pins directly.
But you don't need the display or the shift register. BrewPi won't know if they're there or not...

Cheers!

Well, looking at the code, that's the only way my Arduino pins will map. REVA, REVC shield pin mappings are different from mine. Using this shield..

http://1drv.ms/1BOCDiF
 
Last edited:
Ok, so you're out there in the wilderness on this one ;)

So, that shield design doesn't match either the BrewPi rev A or rev C shields?

Why?

Cheers!
 
Ok, so you're out there in the wilderness on this one ;)

So, that shield design doesn't match either the BrewPi rev A or rev C shields?

Why?

Cheers!

Because Elko has stopped selling the PCBs! All he sells is the spark model now, but I want to DIY.. I've seen plenty of others build a DIY shield from scratch so figured this shield was better than that!

This was the only Eagle file I could get my hands on... I don't want to buy one, I want to build one , just didn't expect it would be this difficult with a couple pin mappings.. learning a lot, but stuck trying to debug whats going on on the arduino...

I know everything is soldered good and works with individual sketches.. I've had LCD working with an LCD sketch and the One wires both pulling temps.. Just not with this HEX that's needed as the slave.. the only way looking at the code is to specify a DIY shield and change the PIN mappings. I did that, my LCD is garbage and I don't see any one wire devices.. who knows maybe it does all work and I just don't know how to configure the devices.. I've never had a working brewpi, not sure what to expect...
 
I'd love to be able to help, but I can barely find my way through the code behind the hex file. Actually, most time's I can't find my way.

For instance, tonight I was poking around looking for noise-susceptible AVR pins and discovered some coded weirdness with the Door pin (IO4 on a rev C shield analog): by default it is an inverted input - so a LOW indicates the door is open. But also by default the BrewPi configuration ignores the door sensor function.

I noted the door pin input sits at "0" volts by default. Then I enabled the door pin sensor in the BrewPi device configuration gui, and suddenly there was a pull-up asserted on that input! Then I disabled the door pin function, but the pull-up remained.

That doesn't seem right, and I'm wondering if the default leaves that pin vulnerable to noise getting into the AVR. "0" may not be a low impedance state for all I know. But for the life of me I can't find how the pin is set up, aside from it's actual operating function (yeah, it's a "door" sensor). Where is it defined as an Input with or without a pull-up or pull-down on boot up?

Arrgh! I'm a hardware guy who codes only when it's absolutely necessary and there's nobody to pawn it off on ;)

Cheers!
 
From what I can tell he's using an outdated revA pinout because he keeps saying "both one-wire". Has he tried uploading the revA sketch to find out?

Like I said before elco has told me in the past that there is a bit of a bug in the revc code for the door pin. But I believe the low as input is designed that way because of the way a door latch button works. A typical door button is an inverted switch. It's open when it's pushed down and closed when it springs up. I believe he did it this way because some small fridges don't have door switches and you'd have to use a momentary push button meaning everything would be inverse unless you have a dual throw push button switch.
 
I'd love to be able to help, but I can barely find my way through the code behind the hex file. Actually, most time's I can't find my way.

For instance, tonight I was poking around looking for noise-susceptible AVR pins and discovered some coded weirdness with the Door pin (IO4 on a rev C shield analog): by default it is an inverted input - so a LOW indicates the door is open. But also by default the BrewPi configuration ignores the door sensor function.

I noted the door pin input sits at "0" volts by default. Then I enabled the door pin sensor in the BrewPi device configuration gui, and suddenly there was a pull-up asserted on that input! Then I disabled the door pin function, but the pull-up remained.

That doesn't seem right, and I'm wondering if the default leaves that pin vulnerable to noise getting into the AVR. "0" may not be a low impedance state for all I know. But for the life of me I can't find how the pin is set up, aside from it's actual operating function (yeah, it's a "door" sensor). Where is it defined as an Input with or without a pull-up or pull-down on boot up?

Arrgh! I'm a hardware guy who codes only when it's absolutely necessary and there's nobody to pawn it off on ;)

Cheers!

Well, I'm a software guy but I'm not too familiar with this stack quite yet.. Not a Python guy, haven't debugged an Arduino outside the Sketches in the normal IDE.

It should be a matter of compiling a new .HEX using the DIY shield constants.. this should change the PIN mappings, ie: from Pins.h

Code:
#elif BREWPI_STATIC_CONFIG==BREWPI_SHIELD_DIY

// pins
#define beerSensorPin    10
#define fridgeSensorPin  11

// Pay attention when changing the pins for the rotary encoder.
// They should be connected to external interrupt INT0, INT1 and INT3

#define rotaryAPin 2 // INT1
#define rotaryBPin 1 // INT3
#define rotarySwitchPin 0 // INT2


#define coolingPin 12
#define heatingPin 13
#define doorPin    A5

#define DISP_RS 9
#define DISP_RW 8
#define DISP_EN 7
#define DISP_D4 6
#define DISP_D5 5
#define DISP_D6 4
#define DISP_D7 3

#define BREWPI_INVERT_ACTUATORS 0

#endif

These ARE my pin mappings, so that's good. but when I upload this hex it doesn't seem to communicate with the brewpi.py script properly.. ie the json errors...
 
Which is why they've been had at work rewriting the software from scratch.
 
Because Elko has stopped selling the PCBs! All he sells is the spark model now, but I want to DIY.. I've seen plenty of others build a DIY shield from scratch so figured this shield was better than that!

This was the only Eagle file I could get my hands on... I don't want to buy one, I want to build one , just didn't expect it would be this difficult with a couple pin mappings.. learning a lot, but stuck trying to debug whats going on on the arduino...

I know everything is soldered good and works with individual sketches.. I've had LCD working with an LCD sketch and the One wires both pulling temps.. Just not with this HEX that's needed as the slave.. the only way looking at the code is to specify a DIY shield and change the PIN mappings. I did that, my LCD is garbage and I don't see any one wire devices.. who knows maybe it does all work and I just don't know how to configure the devices.. I've never had a working brewpi, not sure what to expect...

But why dont you use the RevC design with the shift register?

I even got the I2C version working, but the DIY shield version with the LCD directly connected seems to be a very old design..

@day_trippr

The pin setups seem to be burried somwhere here:

https://github.com/BrewPi/brewpi-avr/blob/master/brewpi_avr/arduino/variants/standard/pins_arduino.h

And here:

https://github.com/BrewPi/brewpi-avr/blob/master/brewpi_avr/arduino/cores/arduino/Arduino.h

I wonder if a quick and dirty solution would just be to initialize the display every minute in the main brewpi loop..

https://github.com/BrewPi/brewpi-avr/blob/master/brewpi_avr/Brewpi.cpp

Just added the following, but it does not work.. When the error is there the reinitialisation is not correcting it.

// update the lcd for the chamber being displayed
display.init();
display.printStationaryText();

display.printState();
display.printAllTemperatures();
display.printMode();
display.updateBacklight();
 
But why dont you use the RevC design with the shift register?

A month ago when I was looking for Shield Eagle files, this one is all I found. I wasn't aware that that were different shield revisions as that point. Also,
I've seen people put shields together like this: http://cdn.homebrewtalk.com/attachm...imageuploadedbyhome-brew1411003829.837827.jpg

So, I figured I'd be better off than starting from scratch... Where is the RevC design? Is there an Eagle file?

I already blew $75 having these shields made up.. You would think I could salvage my investment.
 
Also, I'm pretty sure the addition of the shift register was a Rev C thing - I think the Rev A actually drove all the LCD pins directly.

Per Elco, (Brewpi Forum)
No RevA and RevC both had the shift register. The RevA shield had 2 OneWire ports and just 2 actuator outputs.

We do have a DIY hex file, but it is untested at this point, as we have moved towards using RevC.
Here: http://dl.brewpi.com/brewpi-avr/stable/
The DIY shield has not been tested with an Arduino Uno either.

If you are not using an LCD, you are better off using the RevC hex file. Take a look at the schematic in the shop then.
 
So should I buy a Leonardo? There is a Leonardo / DIY shield hex..
 


That's not a brewpi shield. It's a ds2413/temp probe array backpack for an 8-channel relay board that is controlled with one-wire from 4 different Arduinos. None of which have a shield on them. Actually all the arduinos are screwed together in a stack with the 4.7k resistors soldered right on the arduinos. Most people that have built diy shields have used prototyping boards for arduinos.
 
So should I buy a Leonardo? There is a Leonardo / DIY shield hex..

No, what if they release a new version, i would build a Rev C shield it has the best chances to be supported in the future.
 
MDMA just said in the forum that they are rewriting the arduino code as well we should have good things to come. Hints of ability to set your own pin assignments and all. So your boards could still be useful. I'm planning to have some boards cut in the next month or so. I'm still debating whether I'll use an lcd or not on at least my uno or nano board. We'll see how it goes. I may just burn a couple copies of the revc board for my uno. Depending on cost I'll probably have to make up more than I need. Anyone is welcome to them when/if it ever happens. I'm still prototyping and I'll probably make my first few boards at home.
 
Yes the brewpi spark is the newest one, but its not out yet.

As far is i can remember, elco said multiple times that he will continue to support the arduino.

He said he would leave the repos up for the arduinos. I wouldn't expect much in the way of arduino avr development, the latest commit for it is from July of last year. He's moving on to bigger (errm.. smaller?) and better things.
 
MDMA just said in the forum that they are rewriting the arduino code as well we should have good things to come. Hints of ability to set your own pin assignments and all. So your boards could still be useful.

Ah, good to know. So no need to worry about building to shield revisions then.

'the forum'? brewpi forum?
 
He said he would leave the repos up for the arduinos. I wouldn't expect much in the way of arduino avr development, the latest commit for it is from July of last year. He's moving on to bigger (errm.. smaller?) and better things.

Thats fine though, the BrewPi does what it was designed to do and it does it well. I see no real necessary improvements they need to make, worst case someone forks off his GIT repo and takes on the work...
 
Multi-ferment seems to be where they intend to draw their focus once brew spark is up a running
 
I ended up buying a new router and am havingba hell of a time getting my brewpi back to where it was. I have it running locally but can't get it to upgrade or update. May end up posting some of the errors I'm getting if I can get it hashed out.
 
Old router probably used 192.168.1.x addresses and the new one is using something like 192.168.0.x which wouldn't normally matter, but if you've got your pi using the wifi dongle with a static ip it'll give you all kinds of hell. What router did you buy?
 
I picked up an ASUS RT-AC56U. I've gone back through the wifi set up steps, to change the interfaces file to the new settings. after doing so and reining the start up i get this (which i can't remember if is normal):
[....] Running /etc/init.d/networking restart is deprecated because it may not r[warnble some interfaces ... (warning).
[....] Reconfiguring network interfaces...ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ifup: interface wlan0 already configured
done.

If i run the update i get this:
pi@brewpi ~ $ sudo apt-get update
Err http://raspberrypi.collabora.com wheezy Release.gpg
Something wicked happened resolving 'raspberrypi.collabora.com:http' (-5 - No address associated with hostname)
Err http://archive.raspberrypi.org wheezy Release.gpg
Something wicked happened resolving 'archive.raspberrypi.org:http' (-5 - No address associated with hostname)
Err http://mirrordirector.raspbian.org wheezy Release.gpg
Something wicked happened resolving 'mirrordirector.raspbian.org:http' (-5 - No address associated with hostname)
Err http://repository.wolfram.com stable Release.gpg
Something wicked happened resolving 'repository.wolfram.com:http' (-5 - No address associated with hostname)
Ign http://raspberrypi.collabora.com wheezy Release
Ign http://archive.raspberrypi.org wheezy Release
Ign http://mirrordirector.raspbian.org wheezy Release
Ign http://repository.wolfram.com stable Release
7% [Connecting to mirrordirector.raspbian.org] [Connecting to raspberrypi.colla

then it eventually times out or i have to ^c to move on to try something else.
 
Is it a usb device or is the wifi built in. It looks like a configuration file for wlan is already running and you have made a duplicate. Are you able to use the wifi tool in Linux to scan and find APs?
 
it's a usb dongle in the pi. I will see if i can figure out if i made a duplicate. Thanks for the direction, it makes me feel less like I'm spinning my wheels.

I did find two interfaces.save files: actually thats not true.. I found a interfaces.save and interface.save file
 
If u have a spare sd card you could try setting up a test environment from scratch. See if you can connect with a fresh install. Then weeding out the issue will be a lot easier. You may be editing the wrong file or your settings aren't being saved because you missed a sudo in there somewhere.
 
I picked up an ASUS RT-AC56U. I've gone back through the wifi set up steps, to change the interfaces file to the new settings. after doing so and reining the start up i get this (which i can't remember if is normal):
[....] Running /etc/init.d/networking restart is deprecated because it may not r[warnble some interfaces ... (warning).
[....] Reconfiguring network interfaces...ioctl[SIOCSIWAP]: Operation not permitted
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ifup: interface wlan0 already configured
done.

If i run the update i get this:
pi@brewpi ~ $ sudo apt-get update
Err http://raspberrypi.collabora.com wheezy Release.gpg
Something wicked happened resolving 'raspberrypi.collabora.com:http' (-5 - No address associated with hostname)
Err http://archive.raspberrypi.org wheezy Release.gpg
Something wicked happened resolving 'archive.raspberrypi.org:http' (-5 - No address associated with hostname)
Err http://mirrordirector.raspbian.org wheezy Release.gpg
Something wicked happened resolving 'mirrordirector.raspbian.org:http' (-5 - No address associated with hostname)
Err http://repository.wolfram.com stable Release.gpg
Something wicked happened resolving 'repository.wolfram.com:http' (-5 - No address associated with hostname)
Ign http://raspberrypi.collabora.com wheezy Release
Ign http://archive.raspberrypi.org wheezy Release
Ign http://mirrordirector.raspbian.org wheezy Release
Ign http://repository.wolfram.com stable Release
7% [Connecting to mirrordirector.raspbian.org] [Connecting to raspberrypi.colla

then it eventually times out or i have to ^c to move on to try something else.

I was having issues and these look familiar. I cant remember EVERYTHING i did, but I tried changing the repositories to different mirrors and it didnt help at all so dont bother. What I eventually noticed was that the wifi dongle just didnt seem to stay on. I repositioned the pi back to its normal spot and it worked a charm. I also cant have the uno, dongle, and keyboard/mouse plugged at the same time without external power to a usb hub.

Try unhooking any peripherals and reposition the pi to see if you cant get a stronger signal. Then ssh into it.

I might have had to do an apt command to clean. I think something like sudo apt -F, let somebody else verify that though as I'm not confident thats correct.
 
I was having issues and these look familiar. I cant remember EVERYTHING i did, but I tried changing the repositories to different mirrors and it didnt help at all so dont bother. What I eventually noticed was that the wifi dongle just didnt seem to stay on. I repositioned the pi back to its normal spot and it worked a charm. I also cant have the uno, dongle, and keyboard/mouse plugged at the same time without external power to a usb hub.

Try unhooking any peripherals and reposition the pi to see if you cant get a stronger signal. Then ssh into it.

I might have had to do an apt command to clean. I think something like sudo apt -F, let somebody else verify that though as I'm not confident thats correct.

Thanks. I did move my brewpi but it's sitting about six feet away from the router as I'm working on this issue. I may do a fresh instal but i have to wait a bit. It supposed to warm up and i don't want to put off a brew day because i'm messing with this. Again, its working, just locally and i can't get it to update/uprgrade. I did get the clock squared away but that didn't make a difference.
 
I was able to successfully get BrewPi up and running. Calibrated my two sensors and everything seems to be working alright, see picture.

I tried the external BrewPi webpage feature, but no luck. My .htaccess file looks like;

<Files "index.php">
AuthUserFile /var/www/private/.htpasswd
AuthGroupFile /dev/null
AuthName "McNabb"
AuthType Basic

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


My default file looks like;

<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">


Followed instructions as is, and when I enter "http://brewpi/index.php" into Chrome, nothing loads. Am I completely missing the fact I need a webhost?

brewpi.jpg
 
Status
Not open for further replies.
Back
Top