HOWTO - Make a BrewPi Fermentation Controller For Cheap

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk:

Status
Not open for further replies.
Joined
Jan 19, 2013
Messages
3,570
Reaction score
1,487
Location
Kansas City
Oh! Well you are on the right track. But first, you cannot do this headless - you will need a keyboard and monitor connected. If you think about the security of that it makes sense.

Remove your SD card, mount it on some other computer, edit the cmdline.txt file and look for a line that says something like:
Code:
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
At the end of that line, add a space and the following statement (this MUST be on the same line):
Code:
init=/bin/sh
Dismount/eject/remove the card and put it back in your Pi (with a keyboard and monitor) and boot it up. You'll see "stuff" as it boots, then it will appear to stop/freeze. You will then issue the following command:
Code:
mount -o remount, rw /
After that you will be in the system as root. Issue the following command and follow the instructions:
Code:
passwd pi
After you successfully change the password, issue the following two commands:
Code:
sync
exec /sbin/init
It will do it's thing and then seemingly lock up. Give it another full minute after that to finish just in case. Then power off your Pi. Remove the SD card again and mount it on some other computer as you did previously. Again edit the cmdline.txt file and remove the init=/bin/sh statement. Save the file, dismount/eject/remove the card, put it back in your Pi and power it up. You should be good to go at this point.
 

BobbyAG

Member
Joined
May 25, 2019
Messages
14
Reaction score
2
Location
Tasmania, Australia
@CadiBrewer was kind enough to help me with a new shield design for the I2C release and I have been musing on the same thing ... the "BTOOTH" header could/should easily be used as a connection for an ESP8266 bridge.

You must have had it right at one point, because in the log you got responses back from the Arduino. Have you changed anything physically since then?
Hi Lee,
Good news, it's working!
I rewired, reloaded everything from scratch, and still couldn't get any joy. After much pulling out of hair, I read somewhere that some D1 minis can work on 5v for Rx, even though officially it should be 3.3v. In desperation I got rid of the voltage divider from arduino to ESP and it worked!

Don't know about longevity....
Here is the output on the BPR webpage stdout:

2019-05-27 17:37:02 Opening serial port.
2019-05-27 17:37:02 Notification: Script started for beer 'My First Legacy BrewPi Run'
2019-05-27 17:37:17 Checking software version on controller.
2019-05-27 17:37:17 Found BrewPi v0.2.11 build af7545e, running on an Arduino Uno with a revC shield on port socket://192.168.0.110:23

Thanks for taking the time to help. Cheers.
 
Joined
Jan 19, 2013
Messages
3,570
Reaction score
1,487
Location
Kansas City
That's awesome!

Strange on the voltage divider thing. The fact that it detected the version previously tells me it worked at least sporadically so the circuit may have been right, but moving things around maybe loosened up a bad solder joint? The electronic equivalent of "yelling louder" should not have made a difference.

I played around with some BT dongles that are supposed to be 3V3 on the signals but I used 5. They do work for a while but seem to go out eventually. Who knows when.

"Someday" I may clean up that logic surrounding the configuration of an IP port. That seems pretty kludgy to me but it works. I definitely need to work on the OTA flashing so maybe when I do that.
 

shtank

Well-Known Member
Joined
Oct 29, 2010
Messages
162
Reaction score
6
Location
Lexington
Oh! Well you are on the right track. But first, you cannot do this headless - you will need a keyboard and monitor connected. If you think about the security of that it makes sense.

Remove your SD card, mount it on some other computer, edit the cmdline.txt file and look for a line that says something like:
Code:
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
At the end of that line, add a space and the following statement (this MUST be on the same line):
Code:
init=/bin/sh
Dismount/eject/remove the card and put it back in your Pi (with a keyboard and monitor) and boot it up. You'll see "stuff" as it boots, then it will appear to stop/freeze. You will then issue the following command:
Code:
mount -o remount, rw /
After that you will be in the system as root. Issue the following command and follow the instructions:
Code:
passwd pi
After you successfully change the password, issue the following two commands:
Code:
sync
exec /sbin/init
It will do it's thing and then seemingly lock up. Give it another full minute after that to finish just in case. Then power off your Pi. Remove the SD card again and mount it on some other computer as you did previously. Again edit the cmdline.txt file and remove the init=/bin/sh statement. Save the file, dismount/eject/remove the card, put it back in your Pi and power it up. You should be good to go at this point.
Well after many attempts and then my SD getting corrupt from pulling the plug so many times....Its a fresh install for me! I am going to install a monitor and keyboard permanently. Will I need a better power supply? I currently have the one Fuzzy originally recommended (5v I think).

Okay I have the github here.

You can just go ahead and install it with the command:
Code:
curl -L wifi.brewpiremix.com | sudo bash
(I should have remembered that.)

It should give you an option to overwrite your existing daemon unit file.

The downside to installing this before I release 0.5.2.1 (which has this same logic) is that the version checking for the WiFi checker in the BrewPi installer will break. I believe that would result in the BrewPi installer always thinking this stand-alone version is "higher" so the default would always be to not overwrite. You could choose to do so of course, and then version checking would again work properly.
Will I still need to do this Lee? Or has an update came out that I missed. Thanks again
 
Joined
Jan 19, 2013
Messages
3,570
Reaction score
1,487
Location
Kansas City
Well after many attempts and then my SD getting corrupt from pulling the plug so many times....Its a fresh install for me! I am going to install a monitor and keyboard permanently. Will I need a better power supply? I currently have the one Fuzzy originally recommended (5v I think).
I run all my Pi's headless, but that does increase the chance of bricking it when you pull the power. I've been kicking around the idea of a "shutdown button", basically shorting a GPIO to halt the Pi in case this happens, but I've not done anything with it. In theory such a watchdog would be trivial. There's also a way to create a shutdown/reboot button on the web GUI but there's two problems with that:
  1. Most issues that result in the need to shutdown/reboot also result in the Pi not being accessible on the network
  2. The security implications are horrible. Allowing the www-data user that level of access is an incredible security risk. One could create a new socket message from the web application to BrewPi and do it that way, but that would also require/allow elevated access for the brewpi user - something I'm trying to get away from
Will I still need to do this Lee? Or has an update came out that I missed. Thanks again
If you are going to use the latest release version of BrewPi (0.5.2.0) then the WiFi Checker is semi-buggy (as was the Legacy wifichecker). If you are having issues with WiFi you can use the one I shared to over-write the 0.5.2.0 version till I release the next version which includes these fixes.

I am >this< close to releasing the new version with some updates I'm really excited about being able to share. I mean not life changing, just stuff that I've had a really interesting time pulling together.
 

BobbyAG

Member
Joined
May 25, 2019
Messages
14
Reaction score
2
Location
Tasmania, Australia
That's awesome!

Strange on the voltage divider thing. The fact that it detected the version previously tells me it worked at least sporadically so the circuit may have been right, but moving things around maybe loosened up a bad solder joint? The electronic equivalent of "yelling louder" should not have made a difference.

I played around with some BT dongles that are supposed to be 3V3 on the signals but I used 5. They do work for a while but seem to go out eventually. Who knows when.

"Someday" I may clean up that logic surrounding the configuration of an IP port. That seems pretty kludgy to me but it works. I definitely need to work on the OTA flashing so maybe when I do that.
Yes, agree about the voltage divider. I'll do some more playing. On the ESP-link troubleshooting page the guy suggests using a 1k resistor for rx, I assume in series.

I'm thinking maybe the 2.0.4 version picked up earlier might have been on the ESP, not the Uno, cos I was playing around with Fermentrack earlier. Ghost in the machine....

Thanks for the help.
 
Joined
Jan 19, 2013
Messages
3,570
Reaction score
1,487
Location
Kansas City
Yes, agree about the voltage divider. I'll do some more playing. On the ESP-link troubleshooting page the guy suggests using a 1k resistor for rx, I assume in series.
On the board I am working on now, I have a 1kΩ and a 2kΩ splitting the voltage - which I assume is how @day_trippr designed it originally.

I'm thinking maybe the 2.0.4 version picked up earlier might have been on the ESP, not the Uno, cos I was playing around with Fermentrack earlier. Ghost in the machine....
Hrm ... maybe, but what you posted from your log said:
Code:
2019-05-25 23:30:38 Found BrewPi v0.2.4, running commit 00000000 on port socket://192.168.0.106:23
It seems like from the log you posted that the issue was more that I changed 0.5.2.0 to require a minimum firmware version of 0.2.10 (which I have since changed back to 0.2.4.) I'm guessing you had two issues hitting you at different times.
 

shtank

Well-Known Member
Joined
Oct 29, 2010
Messages
162
Reaction score
6
Location
Lexington
During install I opted not to flash shields, now my script is not running. I assume this is the problem. How do I flash shields after the fact?

Thank you
 

BrewCityBaller

Well-Known Member
Joined
Oct 8, 2012
Messages
341
Reaction score
73
Location
Northwest Chicago Burbs
Hi there! I was able to install BrewPi Remix without any issues, and it appears I was able to update the Arduino as well. However, I still cannot get the script to run. Any thoughts on what might cause this?
upload_2019-5-29_17-5-9.png
 
Joined
Jan 19, 2013
Messages
3,570
Reaction score
1,487
Location
Kansas City
I learned after that release there's a sort of race condition where the do_not_run_brewpi file is created and the permissions never get updated, so it can't get deleted normally - I suspect this is that condition. (You flashed as part of the install process I assume?) Just delete the file and all should be well:
Code:
sudo rm /var/www/html/do_not_run_brewpi
In theory, after deleting that file the script will start within 10 seconds or so. Because of the web page refresh interval it might take another 5-6 seconds for the status to be updated on the web page. This bug is fixed in dev branch and I know I say this often but I'm really really close to the next release.

If that does not work, I'd try resetting permissions:
Code:
sudo /home/brewpi/utils/doPerms.sh
If that does not work, try a reboot before checking out the contents of stderr.txt and stdout.txt in /home/brewpi/logs/.
 

BrewCityBaller

Well-Known Member
Joined
Oct 8, 2012
Messages
341
Reaction score
73
Location
Northwest Chicago Burbs
I learned after that release there's a sort of race condition where the do_not_run_brewpi file is created and the permissions never get updated, so it can't get deleted normally - I suspect this is that condition. (You flashed as part of the install process I assume?) Just delete the file and all should be well:
Code:
sudo rm /var/www/html/do_not_run_brewpi
In theory, after deleting that file the script will start within 10 seconds or so. Because of the web page refresh interval it might take another 5-6 seconds for the status to be updated on the web page. This bug is fixed in dev branch and I know I say this often but I'm really really close to the next release.

If that does not work, I'd try resetting permissions:
Code:
sudo /home/brewpi/utils/doPerms.sh
If that does not work, try a reboot before checking out the contents of stderr.txt and stdout.txt in /home/brewpi/logs/.
Thanks for your help, Lee. Unfortunately, neither of those commands were able to solve my problem. I am still unable to get the script running. I screenshotted the contents of both log files. Does this help narrow it down?
 

Attachments

Joined
Jan 19, 2013
Messages
3,570
Reaction score
1,487
Location
Kansas City
The script is running. You can see the JSON in the stdout log showing that. Does the interface say it’s not?

The errors shown in stderr are due to the wifichecker not being able to figure out information about the wifi setup. Are you using wifi? If so, what version of Raspbian?
 

BrewCityBaller

Well-Known Member
Joined
Oct 8, 2012
Messages
341
Reaction score
73
Location
Northwest Chicago Burbs
The script is running. You can see the JSON in the stdout log showing that. Does the interface say it’s not?

The errors shown in stderr are due to the wifichecker not being able to figure out information about the wifi setup. Are you using wifi? If so, what version of Raspbian?
I am happy to hear that the script is running, that's good news! The BrewPi panel says that the script is not running though. I have tried to click "Start Script", but to no avail. As you said though, the script is actually running, the panel just doesn't seem to know it.

I am not using WiFi and don't intend to. Hooray for ethernet! But for info, this is running on a fresh install of Raspbian Stretch.
 
Joined
Jan 19, 2013
Messages
3,570
Reaction score
1,487
Location
Kansas City
Okay so we can kill the WiFi checker. I had honestly never considered someone not using wifi so it's never come up. Issue the following commands:
Code:
sudo systemctl stop wificheck
sudo systemctl disable wificheck
sudo echo > /home/brewpi/logs/stderr.txt
The last command is optional but it will clear out the crap from the error log.

If the web page is not connecting to the application, we need to look at the Apache log for a clue. Refresh the page to get a "current" error, then have a look at that and let us know what you see:
Code:
tail /var/log/apache2/error.log
 

BrewCityBaller

Well-Known Member
Joined
Oct 8, 2012
Messages
341
Reaction score
73
Location
Northwest Chicago Burbs
Okay so we can kill the WiFi checker. I had honestly never considered someone not using wifi so it's never come up. Issue the following commands:
Code:
sudo systemctl stop wificheck
sudo systemctl disable wificheck
sudo echo > /home/brewpi/logs/stderr.txt
The last command is optional but it will clear out the crap from the error log.

If the web page is not connecting to the application, we need to look at the Apache log for a clue. Refresh the page to get a "current" error, then have a look at that and let us know what you see:
Code:
tail /var/log/apache2/error.log
I ran the commands to disable the WiFi checker and clear the logs. Then I loaded to web page and it's working! Script is running. I am not sure what did the trick, but I am up and running now. Thank you for the assistance.
 
Joined
Jan 19, 2013
Messages
3,570
Reaction score
1,487
Location
Kansas City
I ran the commands to disable the WiFi checker and clear the logs. Then I loaded to web page and it's working! Script is running. I am not sure what did the trick, but I am up and running now. Thank you for the assistance.
Might be that the wifichecker was doing what I pay it to do - reset the network stack when it can't find the wireless gateway. That likely prevented your page from refreshing properly but the script was likely running all along.

I'll put in an option to install the wificheck script on the Dev branch.

Glad you got it going!
 

darrinvw02

Member
Joined
Mar 31, 2014
Messages
19
Reaction score
2
Hey everyone. I'm getting set up to start brewing again after a 3 year haitus. My old brewpi setup is no longer around (worked flawless). I am having issues setting up a new brewpi system on raspbian stretch. I am using the installation instructions from here: https://diybrewpi.fandom.com/wiki/Setting_Up_Your_RPI

I get to sudo ~/brewpi-tools/install.sh and get the following message:


sudo ~/brewpi-tools/install.sh
Checking for Internet connection...
Success!
Checking whether this script is up to date...
/home/pi/brewpi-tools is up-to-date.
***** Installing/updating required packages... *****
Reading package lists...
Building dependency tree...
Reading state information...
Package php5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Package php5-cli is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Package libapache2-mod-php5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Package php5-common is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Package php5-cgi is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libapache2-mod-php5' has no installation candidate
E: Package 'php5-cli' has no installation candidate
E: Package 'php5-common' has no installation candidate
E: Package 'php5-cgi' has no installation candidate
E: Package 'php5' has no installation candidate
*** ERROR ERROR ERROR ERROR ERROR ***
----------------------------------
See above lines for error message
Setup NOT completed

Any help would be appreciated! I am not good with errors like this; I am a rookie when it comes to programming.
 

Bigdaddyale

Well-Known Member
Joined
Aug 29, 2011
Messages
1,403
Reaction score
317
Location
Rowland Heights
Hey everyone. I'm getting set up to start brewing again after a 3 year haitus. My old brewpi setup is no longer around (worked flawless). I am having issues setting up a new brewpi system on raspbian stretch. I am using the installation instructions from here: https://diybrewpi.fandom.com/wiki/Setting_Up_Your_RPI

I get to sudo ~/brewpi-tools/install.sh and get the following message:


sudo ~/brewpi-tools/install.sh
Checking for Internet connection...
Success!
Checking whether this script is up to date...
/home/pi/brewpi-tools is up-to-date.
***** Installing/updating required packages... *****
Reading package lists...
Building dependency tree...
Reading state information...
Package php5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Package php5-cli is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Package libapache2-mod-php5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Package php5-common is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Package php5-cgi is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libapache2-mod-php5' has no installation candidate
E: Package 'php5-cli' has no installation candidate
E: Package 'php5-common' has no installation candidate
E: Package 'php5-cgi' has no installation candidate
E: Package 'php5' has no installation candidate
*** ERROR ERROR ERROR ERROR ERROR ***
----------------------------------
See above lines for error message
Setup NOT completed

Any help would be appreciated! I am not good with errors like this; I am a rookie when it comes to programming.
https://www.brewpiremix.com/
 
Joined
Jan 19, 2013
Messages
3,570
Reaction score
1,487
Location
Kansas City
index.jpg


Seeking 1 to many folks with a system not currently responsible for creating beer to Beta test the pending release. So long as you at least have a spare system (but ideally with an Arduino as well) you can add value. Folks with a Tilt are especially welcome. Expected time investment can be as little as 10 minutes (that's about how long it takes to install) up to whatever you have to give.

Please send me a private message if you can help. I'd really like to get some different eyes on this before I merge these changes into the Master branch.
 

jasonv

Member
Joined
Nov 21, 2013
Messages
22
Reaction score
3
Its my first time fermenting with Kveik yeast. Is the BrewPI software able to control a higher fermentation setting? The beer constant is set at 85. Beer is currently at 88. I've never seen that much of a difference fermenting around 68.
upload_2019-6-24_10-47-31.png
 
Joined
Jan 19, 2013
Messages
3,570
Reaction score
1,487
Location
Kansas City
Not sure if anyone saw the new Raspberry Pi 4:

  • Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz
  • 1GB, 2GB or 4GB LPDDR4-2400 SDRAM (depending on model)
  • 2.4 GHz and 5.0 GHz IEEE 802.11ac wireless, Bluetooth 5.0, BLE
  • Gigabit Ethernet
  • 2 USB 3.0 ports; 2 USB 2.0 ports.
  • Raspberry Pi standard 40 pin GPIO header (fully backwards compatible with previous boards)
  • 2 × micro-HDMI ports (up to 4kp60 supported)
  • 2-lane MIPI DSI display port
  • 2-lane MIPI CSI camera port
  • 4-pole stereo audio and composite video port
  • H.265 (4kp60 decode), H264 (1080p60 decode, 1080p30 encode)
  • OpenGL ES 3.0 graphics
  • Micro-SD card slot for loading operating system and data storage
  • 5V DC via USB-C connector (minimum 3A*)
  • 5V DC via GPIO header (minimum 3A*)
  • Power over Ethernet (PoE) enabled (requires separate PoE HAT)
  • Operating temperature: 0 – 50 degrees C ambient
* A good quality 2.5A power supply can be used if downstream USB peripherals consume less than 500mA in total.

You can pre-order them now (which I just did.) Looks pretty nice! They are supposed to ship next month.
 

jasonv

Member
Joined
Nov 21, 2013
Messages
22
Reaction score
3
Heating pad has not turned on. I can hear the fridge coming on. Just not for long. Its currently now 88.5. The graph shows it turns on drops the fridge temp 1 degree and then goes back to idle.
upload_2019-6-24_14-48-58.png
 

jasonv

Member
Joined
Nov 21, 2013
Messages
22
Reaction score
3
I do not have a fan. I have a thermowell for the beer. Now that you say that i might have the fridge probe to close to the cooling element. Never had this issue before with the lower temps.
 

day_trippr

"This Space For Rent"
Joined
May 31, 2011
Messages
37,478
Reaction score
20,330
Location
Stow, MA
Did you change the default "Temperature Setting Maximum" value from 86°F?


upload_2019-6-24_16-9-34.png


Cheers!
 

day_trippr

"This Space For Rent"
Joined
May 31, 2011
Messages
37,478
Reaction score
20,330
Location
Stow, MA
Not sure if anyone saw the new Raspberry Pi 4:[...]
You can pre-order them now (which I just did.)[...]
I stuck a post in the Automated forum because the Pi4 may bring enough ooomph to handle BruControl adequately.

Which supplier did you pre-order from?

I'm going to pick up a pair (I never buy just one of anything hobbyist-scale :)) and the first thing I'm going to try to do is update a Jessie install with the firmware for the Pi4. Really not looking forward to the havoc the Debian 10 based Raspbian is inevitably going to cause...

Cheers!
 
Joined
Jan 19, 2013
Messages
3,570
Reaction score
1,487
Location
Kansas City
Canakit is where I purchased it from. Note that there’s a new power supply available.

I’m going the opposite direction. Not going to make an effort to make things work on an old OS. The only way is forward!!
 

day_trippr

"This Space For Rent"
Joined
May 31, 2011
Messages
37,478
Reaction score
20,330
Location
Stow, MA
Yeah, well, I like to get my feet planted on something proven before setting out into The Great Unknown :)
And if past is prolog there will be pain on that path...

Cheers!
 
Joined
Jan 19, 2013
Messages
3,570
Reaction score
1,487
Location
Kansas City
Yeah, well, I like to get my feet planted on something proven before setting out into The Great Unknown :)
And if past is prolog there will be pain on that path...
Riiiight ... and getting Wheezy running on the new 3's when they came out was a cake walk. :)

Gives me something to do though. I mean AFTER I get these firmware bugs stomped of course. I already know I need to get BrewPi to Python 3 which promises to be a lift.
 
Joined
Jan 19, 2013
Messages
3,570
Reaction score
1,487
Location
Kansas City
I do not have a fan. I have a thermowell for the beer. Now that you say that i might have the fridge probe to close to the cooling element. Never had this issue before with the lower temps.
With colder temps the fridge has to run longer giving internal convection a chance to get going, and the higher temp differential reduces the relative impact of the sensor/element interaction.

Fans are good. Use one.
 
Status
Not open for further replies.
Top