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.
OK, essentially there are 2 parts:
The part that takes a pic every "however" long.
And the part that sticks it on the webpage.

Taking the pic:
Plug in your webcam.
In terminal, type "lsusb", check that the webcam shows up.
To take a pic, type the following:
Code:
streamer -f jpeg -o image.jpeg
If that doesn't work, install streamer
Code:
sudo apt-get install streamer
If it still doesn't work, try it with sudo
Code:
sudo streamer -f jpeg -o image.jpeg

If that's all working then we just need to get it running often.
Let's start with once per minute.
In Ubuntu, type
Code:
sudo crontab -e
Add the following line at the bottom:
Code:
* * * * * streamer -f jpeg -o /var/www/html/image.jpeg
(omit the "html" bit if you don't have that folder)
[Note: I don't know how to edit cron for other Unix os's. Maybe someone else can help with that, or Google it]
Exit crontab

Wait a minute, check if image.jpeg has showed up in the right folder, and that it's pointing in the right direction.

Editting the webpage:
Back up your index.php
Then, edit this line:
Code:
<body>
to this:
Code:
<body onload="JavaScript:timedRefresh(60000);">

Then, add this just before the </body> tag:
Code:
<canvas id="x" width="600" height="600"/>
<script type="text/JavaScript">

var x=0, y=0;
var canvas, context, img;

function timedRefresh(timeoutPeriod)
{
    canvas = document.getElementById("x");
    context = canvas.getContext("2d");
    img = new Image();
    img.src = "image.jpeg?t=" + new Date().getTime();
    img.onload = function() {
    context.drawImage(img, x, y);

    setTimeout("timedRefresh("+timeoutPeriod+")",timeoutPeriod);
};
}  
</script>

Save, and refresh your webpage.
You should be all set :)
Note:
This is almost definitely not the optimum way to do this, but it works, and took me 5 minutes to do. I may optimise it this weekend when I get a chance.
I'm keen to get it taking a pic a second, but that requires extra work as cron only works in minutes.

Seriously, this is so f'awesome I think my brain just wet itself!
 
Hello all. Thanks for this great thread.

I'm trying to get the BrewPi up and running with a physical LCD display, but have no real output showing. The LCD powers on and shows two rows of blocks. The POT works to adjust contrast. But no characters as emulated in the top left hand corner of the BrewPi interface.

Do I need to modify any code in BrewPi to enable the display or will it work out of the box?

Thanks in advance for any suggestions!

======================
Background Info
======================

I am using a 20X4 board compatible with the Hitachi HD44780 driver, with 16 pins.

I have wired the LCD according to the following:

Wire your LCD screen to your Arduino. Connect the following pins:
LCD RS pin to digital pin 12
LCD Enable pin to digital pin 11
LCD D4 pin to digital pin 5
LCD D5 pin to digital pin 4
LCD D6 pin to digital pin 3
LCD D7 pin to digital pin 2
Additionally, wire a 10K pot to +5V and GND, with it's wiper (output) to LCD screen's VO pin (pin3).

LCD_bb.png


LCD_schem.png
 
Ok so I can't figure out what's going on here. I have everything up and running for testing. I go in and setup all 3 temperature probes and refresh the settings to see they are in my installed devices. Then 1 of them (and it's a different one every time) ends up showing up with all but the first 4 or 5 characters of the address name shows up as FFFFFFFFF. And the real device shows up under detected devices again making up 4 one wire devices. I setup the new real entry as my temp sensor but I cannot remove or reassign the faulty ghost device. Which continues to receive temperature data. I go in and reprogram again get everything set up and then one of the other temp probes starts doing it. I don't know exactly what's wrong here but it just started doing this about 30 minutes ago. I left it running all night with no problems.

ImageUploadedByHome Brew1406228175.461886.jpg
 
Hello all. Thanks for this great thread.

I'm trying to get the BrewPi up and running with a physical LCD display, but have no real output showing. The LCD powers on and shows two rows of blocks. The POT works to adjust contrast. But no characters as emulated in the top left hand corner of the BrewPi interface.

Do I need to modify any code in BrewPi to enable the display or will it work out of the box?

Thanks in advance for any suggestions!

======================
Background Info
======================

I am using a 20X4 board compatible with the Hitachi HD44780 driver, with 16 pins.

I have wired the LCD according to the following:

Wire your LCD screen to your Arduino. Connect the following pins:
LCD RS pin to digital pin 12
LCD Enable pin to digital pin 11
LCD D4 pin to digital pin 5
LCD D5 pin to digital pin 4
LCD D6 pin to digital pin 3
LCD D7 pin to digital pin 2
Additionally, wire a 10K pot to +5V and GND, with it's wiper (output) to LCD screen's VO pin (pin3).

LCD_bb.png


LCD_schem.png


Where did you get that wiring diagram? It looks like you have your LCD attached to every one of the actuator pins. The LCD interface for brewpi's setup uses spi I believe.
 
[...]The LCD interface for brewpi's setup uses spi I believe.

"You are correct, Sir!" (<-in best Ed McMahon voice ;) )

From the schematics they don't use the actual SPI packet protocol, they just use those AVR pins to bit-bang a shift register on one of their shield kit boards that in turn coughs out the LCD interface signals.

It seems there are plenty of free pins on a 328Mega running the BrewPi script that one could directly interface an LCD, but then you'd have to hack the BrewPi AVR code (at least) to make that work...

Cheers!
 
"You are correct, Sir!" (<-in best Ed McMahon voice ;) )

From the schematics they don't use the actual SPI packet protocol, they just use those AVR pins to bit-bang a shift register on one of their shield kit boards that in turn coughs out the LCD interface signals.

It seems there are plenty of free pins on a 328Mega running the BrewPi script that one could directly interface an LCD, but then you'd have to hack the BrewPi AVR code (at least) to make that work...

Cheers!

Hmm... I wonder....

http://www.ebay.com/itm/Serial-IIC-...no-r3-B-/251597727890?&_trksid=p2056016.l4276
 
Hey MongooseMan. Have you tried say a minute of video every hour?


Sent from my iPhone using Home Brew
 
Great thread FuzzeWuzze and all the other contributors. I found this thread a while back and bookmarked it. It sounded quite complicated to build as far as my skill sets, so I waited until I conquered a few other smaller electronic/computer builds. I'm looking forward to tackling this project in the coming weeks. I'm up to page 81 right now and have been bookmarking posts to answers that people have had. I won't start my build until I get to the end.

I do have one question at this point. How well do these electronic components hold up to the heat? My fermentation chamber is a chest freezer in the garage. The outside temperature at 9AM this morning was 105F. The garage is a little cooler than that and gets up to around 95F at the peak temperatures in the afternoon. I'm just thankful that it is a dry heat.

Thanks...
 
There really isn't much heat dissipated by the 'Pi, Arduino and relay board, and all of the components have at least a commercial rating (so they're good way above the temperatures you'll see in a garage - even one that's too hot to spend any time therein).

I'd be more concerned with the freezer compressor than any of this stuff...

Cheers!
 
Ok so I can't figure out what's going on here. I have everything up and running for testing. I go in and setup all 3 temperature probes and refresh the settings to see they are in my installed devices. Then 1 of them (and it's a different one every time) ends up showing up with all but the first 4 or 5 characters of the address name shows up as FFFFFFFFF. And the real device shows up under detected devices again making up 4 one wire devices. I setup the new real entry as my temp sensor but I cannot remove or reassign the faulty ghost device. Which continues to receive temperature data. I go in and reprogram again get everything set up and then one of the other temp probes starts doing it. I don't know exactly what's wrong here but it just started doing this about 30 minutes ago. I left it running all night with no problems.

Well, that's pretty weird behavior. Just to rule out the first-order stuff, the things I'd check are the system 5VDC rail, make sure the One-Wire power is coming from a 5VDC pin and not 3.3VDC, and that the 4.7K pullup for the One-Wire data line is also connected to 5VDC (that's different than on a 'Pi - which is not a 5V chip).

Beyond that, I'd remove one probe and see if the behavior changes; if not, put that one back on-line and remove a different one; until all three probes have been ruled out as causing the errors.


fwiw, and only barely related, I've lately noticed that my Uno with the third probe will randomly cough up:

"Arduino debug message: WARNING 2: Temperature sensor disconnected pin 18, address 288E70D305000036"

immediately followed by

"Arduino debug message: INFO MESSAGE 0: Temp sensor connected on pin 18, address 288E70D305000036

I can go for days and not see one of these in the logs, and then suddenly there might be one or two or more sets, with no particular affinity towards any of the attached probes, and always ending with the fingered probe reconnected. Last night in a ~40 second window I got messages for all three probes.

I'm short one probe (more probes are on the boat from China) to configure the other Uno the same way to see if this is behavior is shared or not (I'm guessing not). And as all three probes on the one Uno have been fingered there's no point in swapping them with the other Uno - yet.

On the up side, even with motion sensors, multiple temperature loggers, and two BrewPi instances running together, that's the most significant issue lingering around right now. Eventually I'll sort this out...

Cheers!
 
Yeah everything is setup like you said. I built a small pcb shield to hookup my one wire so I know it's all hooked up correctly. It's not just that one probe. If I start over and reprogram my arduino what ever the last probe I set up was that's the one that gives me issues.

What's even weirder is that, like I said before, when I refresh my devices list then the last probe shows up again under detected devices and I can set it up accordingly. It's gotta be a bug in the brewpi software because I have not noticed any negative results from it acting up. But I'm incredibly OCD and this thing is just pissing me off having a 4th retarded ghost device thy won't go the hell away when I set everything to unassigned.


I'm starting to think that it may be em interference.
 
I'd PM Elco on their IRC channel and see if he can help with that...may be a bug he can fix.
 
[...]But I'm incredibly OCD and this thing is just pissing me off having a 4th retarded ghost device thy won't go the hell away when I set everything to unassigned.

You're not alone with the OCD thing, I like everything in my world working without weirdness ;)

I'm starting to think that it may be em interference.

From?

How long are your probe wires, btw?

I'm running 3 meter probes everywhere - including five running on the system watching over my keezer (that 'Pi is a rock, it's never even burped since it went on line before Easter)...

Cheers!
 
My probes are on 1m wires. I say em interference because every since I brought this fridge home I've had problems with wifi devices all over my house. Also while I'm testing there at high and low voltage wires going every which a way.
 
My probes are on 1m wires. I say em interference because every since I brought this fridge home I've had problems with wifi devices all over my house.

Ok, that would definitely drive me insane. I feel your angst ;)

Also while I'm testing there at high and low voltage wires going every which a way.

Do you have your BrewPi system sitting in the middle of all that?

Cheers!
 
I wish I could get a preassembled revc board for less than 68 bucks. I can buy 4 arduinos for that price or 2 pi's.
 
Your setup doesnt look any better or worse than mine did, although i will say using alligator clips probably isnt the best idea in terms of high voltage and supplying power.
 
I put shrink tubing on the handle part!

Alligator clips are meant for debugging and prototyping, not functional circuits.

Atleast that's my take, i would replace those with wire twist caps or screw the wire down to the actual socket...i see another alligator clip running to your socket which seems super sketchy to me.
 
The clips are only going to my ferm wrap. It draws half an amp nominal and only runs like twice a day
 
Hey I built my entire brewery with those test leads. They are super legit.

Your also the only person here out of 20+ that have built it with this problem and the only one using them :mug:

Im not saying thats the issue, but its the only thing i can see thats different than everyone elses setup.

Good point about the EMI from the relay shield though trippr, thats definately a possibility.
 
This is all just testing at this point anyway. My intention is to build 2 carboy sized chambers inside the fridge. And use fans and ducting to draw cold air from the top to cool independently. Using 2 separate arduinos. Then a third arduino to control the freezer as a lagering crashing chamber for my secondaries. I wish it was practical to use the 4 relay shield that I have now but brewpi just wasn't written to use its pinout. I'll probably end up building it into the fridge to control 4 ferm wraps and just remote the pins to the 3 arduinos.
 
Your also the only person here out of 20+ that have built it with this problem and the only one using them :mug:



Im not saying thats the issue, but its the only thing i can see thats different than everyone elses setup.


I'm beginning to think there is an issue with my pi. I'm re-everythinging all my software on it. Since I've been messing around with the kernel and stuff. I'll get everything back up and running fresh and see if it goes away.
 
Problem solved. BrewPi Uno#2 with the three probes sits right where I set my beer and the power lead to the One-Wire breakout board wasn't making the best connection to the Uno's socket. If even I looked at it sideways the 5V to the probes would drop out. Scrubbed the pin in and out of the Uno socket and now I can do the drum solo from In A Gadda Da Vida without perturbing BrewPi...

So...what to do next while waiting for R'Pints v.2...

Cheers! ;)
 
Ok wish me luck I'm running the 12 day sample profile. Let's see how she does.
 
Anybody got an old kenmoore fridge laying around that has a good fan motor in it?
 
There really isn't much heat dissipated by the 'Pi, Arduino and relay board, and all of the components have at least a commercial rating (so they're good way above the temperatures you'll see in a garage - even one that's too hot to spend any time therein).

I'd be more concerned with the freezer compressor than any of this stuff...

Cheers!

I'm always concerned about the freezer compressors. I used to have 5 of them in my garage. I've had two go out on me at different times, but close together in time. It is a pain in the arse to move things around to consolidate. I only have 4 in there now.:drunk:
 
Hello all. Thanks for this great thread.

I'm trying to get the BrewPi up and running with a physical LCD display, but have no real output showing. The LCD powers on and shows two rows of blocks. The POT works to adjust contrast. But no characters as emulated in the top left hand corner of the BrewPi interface.

Do I need to modify any code in BrewPi to enable the display or will it work out of the box?

Thanks in advance for any suggestions!

======================
Background Info
======================

I am using a 20X4 board compatible with the Hitachi HD44780 driver, with 16 pins.

I have wired the LCD according to the following:

Wire your LCD screen to your Arduino. Connect the following pins:
LCD RS pin to digital pin 12
LCD Enable pin to digital pin 11
LCD D4 pin to digital pin 5
LCD D5 pin to digital pin 4
LCD D6 pin to digital pin 3
LCD D7 pin to digital pin 2
Additionally, wire a 10K pot to +5V and GND, with it's wiper (output) to LCD screen's VO pin (pin3).

LCD_bb.png


LCD_schem.png

This is the schematic you want. You'll need a 595 shift register. No reprogramming of pins. Should be able to wire it up and have it work. I'm leaving on vacation for two weeks tomorrow or I'd throw this together and test it out. If nobody has by the time I get back maybe I'll put it together.

LCD_using_74HC595_and_SPI.png
 
Hey MongooseMan. Have you tried say a minute of video every hour?


Sent from my iPhone using Home Brew

I tried my hand at setting up a VLC stream yesterday.
That worked fine (I could view the stream using VLC on my laptop), but is tricky to get into a webpage, which is my priority.

I did increase the number of photos per minute (just by adding lines like this to my crontab:
"sleep 1;streamer -f..."

But I found that if you do too many, then the PC gets overloaded (it's trying take a new photo whilst still processing the old one, and hasn't fully released the device, etc) so settled on a sweet spot of 1 every 3 seconds.

The end goal is definitely a live video stream though.
Will hopefully get some time to work on that this weekend.
 
I tried my hand at setting up a VLC stream yesterday.

That worked fine (I could view the stream using VLC on my laptop), but is tricky to get into a webpage, which is my priority.



I did increase the number of photos per minute (just by adding lines like this to my crontab:

"sleep 1;streamer -f..."



But I found that if you do too many, then the PC gets overloaded (it's trying take a new photo whilst still processing the old one, and hasn't fully released the device, etc) so settled on a sweet spot of 1 every 3 seconds.



The end goal is definitely a live video stream though.

Will hopefully get some time to work on that this weekend.


How about using some HTML5 video.
 
Status
Not open for further replies.
Back
Top