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 think it's been established that the only safe way to make your pages accessible from the web is to put the 'Pi behind a tunnel...

Cheers!
 
Just don't post the link to the forums and you should be ok…
 
First I would like to thank Fuzze and 100Amps and everyone else on this thread for the inspiration and help I have read so far.

I pretty much built it from Fuzze's part list, except I used a 4 channel relay as the 2 channel was out of stock when I ordered from Amazon. I also got a Pi B+. I put it all together and was having a heck of a time getting it to boot after installing the BrewPi software, until I found that my Apple Aluminum keyboard apparently has problems with Debian Wheezy, so after I unplugged it, it would boot up fine and I could get to it from another box.

I made a test profile and used a growler with water (small dorm type fridge as a test before I buy a freezer, and eventually will keep using it as a 1 gallon pilot system) and when it is running, I get dropouts on the graph in the BrewPi webpage. I have tried changing the USB cable between the Pi and the Uno, and still get the dropout. I am thinking of getting a shielded USB cable that also has the ferrite beads, but wanted to ask everyones opinion of what else it could be? The profile appears to be running fine, just my graph is missing data. I'll have to check the error log, but that will be on Friday as it is at my girlfriend's house, and I won't be back there until then. I have not set up with intarweb part yet, and probably will not, no need.

Thanks again to everyone for the help that you did not even know you provided!

Chef Jay
 
Without error logs it'll be hard to diagnose. Have you tried powering the arduino.
 
The log file is kinda important to differentiate between a true probe problem (or probe connectivity problem) versus USB errors. They'll be easily distinguishable as the latter will typically show invalid characters in USB packets, where the former will show actual probe read failures...

Cheers!
 
Thanks guys, gives me something to look at on Friday. The Uno is powered from the Pi, which is being powered by a 2.1 amp iPad charger, as I thought some of my first problems were from the charger that came with the Pi. I will probably switch it back to that one.

I will update on Friday when I look at the log file.

Thanks!

Chef Jay
 
Which, btw, I forgot to thank FuzzeWuzze for taking the time to do.
I've used it a half-dozen times already to locate my own posts ;)

Cheers! (and thanks, Fuzze! :) )

Honestly i got tired of answering the same questions 50 times because it was so hard to find the answers you guys already posted lol. An hour or so of work just spamming through the 150ish pages was well worth it ;)
 
For my setup, my intention is to not have any room temp sensors. Too much extra data to log. I've allowed my test setup to run for like 2 months straight without changing anything and once my graph got that big it started dragging down my browsers and crashing my phone.

Yea you cant let the graphs get crazy long or it will screw you but i think that we are talking months or years. But it can get to the point where it can become nearly impossible to recover from.

During my initial testing with Elco i was having problems with the BrewPi spamming annotations every second on the graph, something to do with the rotary encoder code they have not playing well with our "non standard" BrewPi build...within 30 seconds my entire interface was barely usable and it would take like 5-10 minutes to perform any action like opening up the menu. All because the graphing API was trying to show me like 30,000 annotations and wouldnt let me do anything until it was done.
 
Thanks guys, gives me something to look at on Friday. The Uno is powered from the Pi, which is being powered by a 2.1 amp iPad charger, as I thought some of my first problems were from the charger that came with the Pi. I will probably switch it back to that one.

I will update on Friday when I look at the log file.

Thanks!

Chef Jay

Honestly sometimes when im fiddling with my probes my setup decides to just stop reading my probes. All i do is just power down the entire BrewPi setup and power it back on and when it comes back up it works every time and i just make sure not to disturb my probes until im done.

But im using home-made probes, and ive found them to be quite finnicky even after i coat the stupid things in hot glue to keep any of the connections from popping off.

If its intermittent though it could be a few things as day_trippr mentioned so the logs will help.
 
I've tried to search for it but haven't found it in this thread. I'm wondering if anyone has been able to configure their arduino to report to the BrewPi server over a network connection vs. the USB cable. I would like to keep my server in it;s current location where I already have power and network, but this is in another room and a good 50-75 feet away from my ferm chamber. I've already ordered the following for my arduino semi by mistake, but I'm hoping someone who has more experience with these things may know of a way to make it work.

http://www.amazon.com/gp/product/B00CRX7BI2/ref=ox_sc_sfl_title_1?ie=UTF8&psc=1&smid=A2N73ZGXSMF3PT

Thanks,
Nathan
 
Last edited by a moderator:
There's no way to make it work, it would require quite a bit more code on the Arduino itself which is already max'd out.
 
Well I've been running without error since last night and it's been running without power to the hub. This tiny little thing is a beast. Had a long day today so I'm probably not going to make any more progress till the weekend. I've got a new hopback that should be in tomorrow too, so that's going to set me back a little but too. But it would be nice to have this ferm chamber finished by the time I have a couple more beers to put down.
 
^Lots of time on the clock is even more encouraging.

Mine will show up in a few days...



Cheers!


I don't think it's going to give me any trouble. It ran all this time with ice weasel running a constant refresh of 4 iframes. The whole time I was installing stuff and running updates and tunneling and vncing in every time I made a little tweak. I even inc lugged and plugged in a couple off the arduinos here and there and try just restarted manually and went on logging. Reprogramming didn't show any errors I even moved around sensors and actuators all while running. No problems.
 
Ok, I think I figured out my issue... RTFM! The profile I made did not have anything set for day 0, so the Brew Pi was off in lala land. Once it hit day 1, which was before I left for work, solid graphs and everything is golden.

Thanks again guys, now to get a freezer and another Uno and get the double chamber working!

Chef Jay
 
A big thank you to FuzzeWuzze for starting and maintain this thread. Here are some pictures of my build using an old floppy disk case as a project box.
20140911_221148_Richtone%28HDR%29.jpg

20140911_220955_Richtone%28HDR%29.jpg

20140911_220912_Richtone%28HDR%29.jpg

20140911_220820_Richtone%28HDR%29.jpg

20140911_220652_Richtone%28HDR%29.jpg
 
So a friends install is having issues ive never seen. Every few seconds the front page lcd panel goes down and it says the script isnt running then it comes back. I manually started the script and can see it running and not crashing, the log shows no errors, and the arduino never goes down the rhing always runs and holds temps properly and no gaps in the graph. It just keeps losing the script on the front panel. I tried reinstalling the brewpi script via the install but it tells me brewpi user is not in the sudoers file.
 
Try this:

Login as root or su to get root prompt

type visudo

an editor will open find a line says

root ALL=(ALL) ALL

add one with your username below that

user ALL=(ALL) ALL

Type ctrl+x Type Y to the prompt
 
So a friends install is having issues ive never seen. Every few seconds the front page lcd panel goes down and it says the script isnt running then it comes back. I manually started the script and can see it running and not crashing, the log shows no errors, and the arduino never goes down the rhing always runs and holds temps properly and no gaps in the graph. It just keeps losing the script on the front panel. I tried reinstalling the brewpi script via the install but it tells me brewpi user is not in the sudoers file.

My gut reaction is to check cron jobs. Just a thought.
 
So a friends install is having issues ive never seen. Every few seconds the front page lcd panel goes down and it says the script isnt running then it comes back. I manually started the script and can see it running and not crashing, the log shows no errors, and the arduino never goes down the rhing always runs and holds temps properly and no gaps in the graph. It just keeps losing the script on the front panel. I tried reinstalling the brewpi script via the install but it tells me brewpi user is not in the sudoers file.

Sounds like a connection issue between the script and the web server. Check the log files to see if the script is restarting continously to confirm. If the script quits and restarts, that would cause this behavior, but then the problem is elsewhere.

The script could be busy and not reply, but I don't see why.

See if switching to a TCP socket instead of a file socket (AF_UNIX socket) helps.


Add this to config.cfg in the script settings dir:

socketPort=6332
socketHost=127.0.0.1

And in the web directory, create config_user.php with:

$useInetSocket = true;
$scriptPort = 6332;


Also, check my new HERMS design proposal out here please :)

https://www.homebrewtalk.com/f11/automated-closed-system-herms-layout-490798/
 
My gut reaction is to check cron jobs. Just a thought.

This is a RPI, but its one of the model A's.

Im pretty sure its not a cron job issue because i manually killed the script PID, and then manually started the script myself(not through cron).

I can sit there and watch the processes and the script process never goes away so its not crashing.
 
So a friends install is having issues ive never seen. Every few seconds the front page lcd panel goes down and it says the script isnt running then it comes back. I manually started the script and can see it running and not crashing, the log shows no errors, and the arduino never goes down the rhing always runs and holds temps properly and no gaps in the graph. It just keeps losing the script on the front panel. I tried reinstalling the brewpi script via the install but it tells me brewpi user is not in the sudoers file.

Check dmesg | tail and see if there's an issue with arduino connection. I have this problem with mine because of the crappy USB hub.
 
Well its up and running and a brew is in process so i dont want to fiddle with it since its technically working, ill try that and any other suggestions in a few weeks when its free.
 
I had this issue before and it had to do with permissions. Starting and stopping the script manually doesn't exactly work like it should. When I had this issue I was able to do the same thing. I asked elco about it and he explained that when you start and stop it manually it doesn't run like it would by being started and stopped by the brewpi user. Start with the fixPermissions.sh and if that doesn't work use the visudo stuff I posted early this morning. But I've never seen this issue on the rpi only in my vm. Because of the way root and the pi user are setup on the rpi and how you need to make sure pi is the main user and brewpi and pi are in the same group when you do a vm/pc manual setup. That's why I figured you weren't on a rpi. You could have a corrupted image. Or you're trying a manual install… where I and day_tripper figured out the online docs forgot to add pi to the 2 groups. This is why you can manually start the script, because user pi is in the sudoers file, but brewpi is not. If you created multiple instances, remember to change each fixPermissions.sh accordingly to reflect the new locations that aren't stock. Like I said I also saw this issue on a single manual install until I figured out how to comment out the raspi-update portion of the install script to get it to install properly. Because the install script does make sure all the correct groups and permissions are set accordingly.
 
So I had a hard drive issue and had to start all over. I followed all instruction and thought I was doing well. Went to the web browser and tried to access brew pi and got the "brewpi Reporting for duty" in the header of the browser but the body only gave me this error.

. */ // 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); return $input; } ?>

any thoughts on how I can get past this?
 
Check your permissions. If a file cannot be opened it either doesn't exist or you don't have permission to open it. Is this a manual install? Did you make sure you installed all the dependencies? You may not have the json packages installed. Or maybe one of the installs failed along the way.
 
The strongest advise I could give anyone building either a BrewPi system or a RaspberryPints system (or a hybrid) is to backup the SD card whenever a major milestone is achieved...

Cheers!
 
I've noticed that randomly throughout the day some of my brewpi scripts find it necessary to restart on their own, but they are already running. I get "there is already an instance of this script running that will interfere with the currently running script. This script will exit." What's weird is it doesn't seem to affect anything. What's weirder is that it's been over 16 hours since the last time one did it, but the lcd output shows that it's only been idling for 10 hours and some change when that particular instance isn't logging any temps or set to any mode other than off. It should show that it's been idling for nearly 20 hours now. The script must have restarted along the way but not have been logged…
 
Well its up and running and a brew is in process so i dont want to fiddle with it since its technically working, ill try that and any other suggestions in a few weeks when its free.

If you do dmesg that will just pull the message logs. You can find where the arduino connects and (potentially) disconnects. The output from mine after a reboot looks like:
Code:
[    7.617174] ftdi_sio 1-2:1.0: FTDI USB Serial Device converter detected
[    7.622345] usbcore: registered new interface driver ftdi_sio
[    7.622349] ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver

So, if you see repeated connect/disconnect on the FTDI stream (or whatever real arduinos use) then you know it's the connection going all intermittent-y.
 
I've noticed that randomly throughout the day some of my brewpi scripts find it necessary to restart on their own, but they are already running. I get "there is already an instance of this script running that will interfere with the currently running script. This script will exit." What's weird is it doesn't seem to affect anything. What's weirder is that it's been over 16 hours since the last time one did it, but the lcd output shows that it's only been idling for 10 hours and some change when that particular instance isn't logging any temps or set to any mode other than off. It should show that it's been idling for nearly 20 hours now. The script must have restarted along the way but not have been logged…

The timer to keep track of that is just an unsigned int and overflows at 32768.
 
A short video of my test with discreet actuator control of my ssr. This will be how I control the compressor. I'll be using fans to control cooling to each fermentation chamber.

http://youtu.be/d4Oe1_aGRRk
 
Currently fermenting a DIPA that I brewed yesterday. Have it set at beer constant of 68F. Fermentation has been active so my fridge has been running at around 60F. The pi has crashed twice today but the UNO has kept everything pretty much in control. There is one odd behavior that I wonder if anyone else has encountered. After the PI crashes and I get the pi up and running again, the fridge constant jumps from a setting point of around 60 to the beer constant temp of 68. My beer creeps up to around 68.5 before BrewPi gets things in line again and starts to bring the fridge constant temp back to the 60ish range. Shouldn't the UNO keep the fridge constant from spiking up like this after a PI crash?
 
Yes if you didn't restart the pi. When the pi starts up it restarts the uno and reloads the script. Causing the uno to restart the algorithm. Now it's time to determine why the pi is crashing, are you overclocking?
 
No, not overclocking. However, I do live in SoCal and currently the temperature where the BrewPi is located is 96F. Do you think this could be a temperature issue?
 
Maybe. Did you start fresh when you built your brewpi. Or have you done anything else with it?
 
Yes. Brand new CanaKit. The first crash was resolved by simply restarting the pi. The 2nd crash, I had to go and reconnect the Wifi. 2 separate reasons for a crash is having me lean towards a heat issue. I'm going to try to cool the area down and see if that solves the issue.
 
I'm willing to bet its a wifi issue. Every time I see someone suffering from pi freezes they have a wifi dongle attached...
 
Hmmmmm... If it continues to crash I'll bust a hole through the garage and wire up an ethernet cable. Have to find some time to do this when the wife is not at home as I have promised her I was done with this little project. :mug:
 
Status
Not open for further replies.
Back
Top