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.
Change the rules file:

This assumes both instances have Unos connected via USB.

$ sudo nano /etc/udev/rules.d/99-arduino.rules

SUBSYSTEM=="tty", KERNEL=="ttyACM*", ATTRS{serial}=="85336303532351F0A031", SYMLINK+="brewpi1", GROUP="brewpi"
SUBSYSTEM=="tty", KERNEL=="ttyACM*", ATTRS{serial}=="754373038303510BF870", SYMLINK+="brewpi2", GROUP="brewpi"


Cheers!

Dave, if one of the instances is on bluetooth at rfcomm0 would you replace the "ttyACM*" with "/dev/rfcomm0" ?
 
Exactly. Kinda. You don't use 99-arduino.rules entries for anything other than USB connected Arduinos.
Quoting myself from a few posts back:

*********

/home/brewpi/brewpi1/settings/config.cfg

scriptPath = /home/brewpi/brewpi1/
wwwPath = /var/www/brewpi1/
port = /dev/brewpi1

Note: the BrewPi port (eg: /dev/brewpi1 above) can be defined in multiple ways.
If using USB device serial numbers with Symlinks, the port is defined in udev rules (below).
Otoh, if using a Bluetooth bridge a /dev/rfcomm(n) will be created using the Bluetooth SPP support.
Or, if connected using a Wifi bridge ala esp8266, you'll use the actual ip socket address.

*********

My main system has a dev/rfcomm0, dev/rfcomm1 and dev/rfcomm2, for the three BT-connected Unos. The comms are defined by the Bluetooth SPP service...

Cheers!

[edit] Glanced at this, need to note that the Bluetooth support only works with Wheezy, as Raspbian.org totally screwed the pooch with BT on Jessie...
 
If I have the raspberry 3 can I just plug the new uno into another usb or do I need to have a usb hub?


Update: Never mind this question.
 
Hey guys, I restarted this whole brewpi thing after giving it up for about a year. I seriously struggled with it last time. Got it working, and then it quit, im guessing because i didnt give my RPI a static IP address. Well ive decided to try again. First things first, How do i give my RPI a static IP address? Secondly, i did a fresh install of Jessie on my RPI, and have the BrewPi up and running, sort of. I can get the web page to display, but i cannot get the scrip to start. Any ideas why? Or how to go about fixing?
 
TO Lbussey, day_trippr, elco, thanks for all of your work developing the BrewPi and all of the followup to fixing the many problems folks have had. I've been watching this thread for quite a while and have finally decided to use BrewPi to manage my fermentations and have been through the install guides 3 or more times as well as read through the various BrewPi and HBT forums, but I've run into a snag that looks unique.

I'm using 2 zones so I've 2 Arduinos an UNO which appears to work fine and an ATmega2560 which I can't get to take the program.

When I run the updater.py for that device (brewpi2) or my holding chamber, I get the following: "Could not find compatible device in available serial ports."

The ATmega2560 works just fine using the Arduino notebook interface. See the udev information below:

pi@PRM-brewpi:/etc/udev/rules.d $ ls /dev/ttyACM*
/dev/ttyACM0

sudo udevadm info -a -n /dev/ttyACM0
looking at device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/tty/ttyACM0':
KERNEL=="ttyACM0"
SUBSYSTEM=="tty"
DRIVER==""

looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0':
KERNELS=="1-1.2:1.0"
SUBSYSTEMS=="usb"
DRIVERS=="cdc_acm"
ATTRS{bInterfaceClass}=="02"
ATTRS{bmCapabilities}=="6"
ATTRS{bInterfaceSubClass}=="02"
ATTRS{bInterfaceProtocol}=="01"
ATTRS{bNumEndpoints}=="01"
ATTRS{authorized}=="1"
ATTRS{supports_autosuspend}=="1"
ATTRS{bAlternateSetting}==" 0"
ATTRS{bInterfaceNumber}=="00"

looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2':
KERNELS=="1-1.2"
SUBSYSTEMS=="usb"

So I know the board is being seen by the Pi3.

Then the rules file:
# Create SYMLINKS for Arduino's based on the USB hub port

SUBSYSTEM=="tty", KERNEL=="ttyACM*", KERNELS=="1-1.4", SYMLINK+="brewpi1"
SUBSYSTEM=="tty", KERNEL=="ttyACM*", KERNELS=="1-1.2", SYMLINK+="brewpi2"

Then the updater.py per Lbussey in post 5638.

pi@PRM-brewpi:/home/brewpi/brewpi-tools $ sudo python updater.py --ask

Using interactive (advanced) update with user input


######################################################
#### ####
#### Welcome to the BrewPi Updater! ####
#### ####
######################################################

Checking whether the update script is up to date
/home/brewpi/brewpi-tools is up-to-date.



*** Updating BrewPi script repository ***
The path '/home/brewpi' does not seem to be a valid git repository
What path did you install the BrewPi python scripts to?/home/brewpi/hold

Stopping running instances of BrewPi
Quit message sent to BrewPi instance with pid 1086!
You are on branch legacy

Available branches on the remote 'origin' for /home/brewpi/hold:
[0] beta
[1] develop
[2] feature/ejsloggingdate
[3] legacy
[4] legacy_dev
[5] master
[6] Skip updating this repository
Enter the number of the branch you wish to update [legacy]:3
The latest commit in /home/brewpi/hold is 8b782f0fd5a1d58cfb4f6f08d37ef8f8ef51f28e on Wed, 27 Apr 2016 13:25:47
The latest commit on origin/legacy is 8b782f0fd5a1d58cfb4f6f08d37ef8f8ef51f28e on Wed, 27 Apr 2016 13:25:47
Your local version of /home/brewpi/hold is up to date!


*** Updating BrewPi web interface repository ***
The path '/var/www' does not seem to be a valid git repository
What path did you install the BrewPi web interface scripts to? /var/www/html/hold
You are on branch legacy

Available branches on the remote 'origin' for /var/www/html/hold:
[0] beta
[1] develop
[2] feature/chart-export
[3] feature/notifications
[4] legacy
[5] master
[6] Skip updating this repository
Enter the number of the branch you wish to update [legacy]:4
The latest commit in /var/www/html/hold is 398f1b50c71904f69e836b26299dd178d9d4515a on Mon, 11 Jan 2016 07:16:11
The latest commit on origin/legacy is 398f1b50c71904f69e836b26299dd178d9d4515a on Mon, 11 Jan 2016 07:16:11
Your local version of /var/www/html/hold is up to date!

No changes were made, skipping runAfterUpdate.sh.
If you encounter problems, you can start it manually with:
sudo /home/brewpi/hold/utils/runAfterUpdate.sh
The update script can automatically check your controller firmware version and program it with the latest release on GitHub, would you like to do this now? [Y/n]:y
Stopping any running instances of BrewPi to check/update controller...

Checking current firmware version...
Sep 13 2016 11:40:16 Opening serial port
Unable to receive version from controller.
Is your controller unresponsive and do you wish to try restoring your firmware? [y/N]:
y
Could not find compatible device in available serial ports.
Firmware update done


*** Done updating BrewPi! ***

pi@PRM-brewpi:/home/brewpi/brewpi-tools $

I'd be very grateful for any help in solving this issue. If nothing else I'll go out a buy another UNO.

Thanks in advance,
Paul
 
To be clear: You have both Arduinos plugged in during this time? I've never tried to flash them with them both plugged in. You might try one at a time with the web interface's uploader.
 
To be clear: You have both Arduinos plugged in during this time? I've never tried to flash them with them both plugged in. You might try one at a time with the web interface's uploader.


I've tried both ways. This last time was just with the ill performing communication.
 
Could you grab me about 5 or 6 and send them to me, there ain't a microcenter anywhere in Louisiana
Microcenter is making it difficult to get a them. They only limit one per visit and you must pick them up at the store.It's a hour round trip for me so it's almost not worth it.
 
Oh just walk out and right back in with a different hat on…
 
I'm almost certain that Elco never cranked out a hex file for the ATmega2560.
Uno (ATmega328p) and Leonardo (ATmega32u4) were it for the AVR hex files.

Sorry...
 
No problem! It was a $6 solution. Much easier than continuing to bang my head against the wall.

It's all working now!

Now to shut it down and back it up.

Then box it up and put it on the fridge.


Thanks guys!
 
Hey guys, I restarted this whole brewpi thing after giving it up for about a year. I seriously struggled with it last time. Got it working, and then it quit, im guessing because i didnt give my RPI a static IP address. Well ive decided to try again. First things first, How do i give my RPI a static IP address? Secondly, i did a fresh install of Jessie on my RPI, and have the BrewPi up and running, sort of. I can get the web page to display, but i cannot get the scrip to start. Any ideas why? Or how to go about fixing?

If you just did a new build, then the version of Apache2 you're using has changed the default location for in-bound web accesses to land from /var/www to /var/www/html.

BrewPi has two file repositories, one is built under /home/brewpi by default and the other under /var/www/brewpi.
That /var/www/brewpi folder (or equivalent) either needs to be moved to /var/www/html/brewpi, or you need to edit the apache2 config file to change its default location from /var/www/html to /var/www.

Change html document root from /var/www/html to /var/www

Edit /etc/apache2/sites-available/000-default.conf

Find DocumentRoot /var/www/html
Change to DocumentRoot /var/www

Then save the file.

Next, edit /etc/apache2/apache2.conf

Find this structure - noting that the Directory - may point to /var/www/html:

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

If it does point to /var/www/html/ change it to look like the above, then save the file.

Finally, restart Apache2:

Code:
$ sudo /etc/init.d/apache2 restart


So, decide where you want things to live, make whatever changes required, and see where that gets you...

Cheers!

[edit] Totally left out the network thing.
What type of network are you using - wired or wifi?
 
BrewPi has two file repositories, one is built under /home/brewpi by default and the other under /var/www/brewpi.
That /var/www/brewpi folder (or equivalent) either needs to be moved to /var/www/html/brewpi, or you need to edit the apache2 config file to change its default location from /var/www/html to /var/www.
It all depends on how you install. If you use Jessie and the updated instructions I posted in 5638, the script will install into /var/www/html the first time and you have to explicitly define that when you run the script with the -ask flag:

Okay I did it with a clean Arduino too. Had to add support for the Arduino before it would install the firmware. Pretty simple process start to finish:

sudo apt-get install arduino-core
git clone https://github.com/BrewPi/brewpi-tools.git ~/brewpi-tools
sudo ~/brewpi-tools/install.sh
sudo passwd brewpi
sudo ~/brewpi-tools/updater.py --ask


(choose legacy branch both times when prompted)

*** Updating BrewPi web interface repository ***
The path '/var/www' does not seem to be a valid git repository
What path did you install the BrewPi web interface scripts to? /var/www/html

The update script can automatically check your controller firmware version and program it with the latest release on GitHub, would you like to do this now? [Y/n]:Y

Is your controller unresponsive and do you wish to try restoring your firmware? [y/N]: Y


(Choose 0.2.10 release)

sudo nano /etc/apache2/apache2.conf

Change "KeepAliveTimeout 5" to "KeepAliveTimeout 99" to deal with LCD text refresh bug.

sudo /etc/init.d/apache2 restart

Do regular setup and configuration from within web interface.

Done.

Hey guys, I restarted this whole brewpi thing after giving it up for about a year. I seriously struggled with it last time. Got it working, and then it quit, im guessing because i didnt give my RPI a static IP address. Well ive decided to try again. First things first, How do i give my RPI a static IP address? Secondly, i did a fresh install of Jessie on my RPI, and have the BrewPi up and running, sort of. I can get the web page to display, but i cannot get the scrip to start. Any ideas why? Or how to go about fixing?
You don't really need a static IP address. When you are done you can nearly always get to your Pi with the {hostname}.local convention. For example if you do not change your hostname, your web page will be http://raspberrypi.local/ and you can SSH to raspberrypi.local.

If you want it to be accessible externally, that's a whole different argument but I recommend you get things working the easy way first.

If the script will not start, can you paste in the logs? You can get them from the web interface in the maintenance panel > view logs > refresh.
 
TO Lbussey, day_trippr, elco, thanks for all of your work developing the BrewPi and all of the followup to fixing the many problems folks have had.
If I've been helpful, I got lucky. :) FuzzeWuzze deserves credit for starting this thread and getting us all going, Elco and crew for the original and ongoing development, Day_trippr and others here have helped me a bunch.
 
Ok, for the record, here's how to calibrate probes in BrewPi.
Assumes an RPi host with network connectivity, with the entire procedure performed remotely via Putty or equivalent terminal emulator.

- tie all probes to a trusted thermometer and allow to normalize
- use the BrewPi web gui to record the probe temperatures and note any variances from the trusted reading

- use the BrewPi gui to Stop the running Script

- open a Putty session and log into the RPi host
- if the program Screen is not installed on the RPi, install it as follows:

$ sudo apt-get update
$ sudo apt-get install screen

- use Screen to connect to the serial port used by the Arduino.
Note if you have a multi-instance configuration to be sure to use the correct port reference.
In this example I'm using a Bluetooth-connected Uno using rfcomm1.
For a single-instance, USB-connected Uno, the most likely ports used are either /dev/ttyACM0 or /dev/ttyUSB0.

$ screen /dev/rfcomm1 57600

There will be no indication that Screen is connected.

- dump the data associated with all probes:

h{v:1}

- probes are referenced using an index i with values of 0 through 2.
Examine the data stream dumped above, looking for each value of "i", and the corresponding temperature reading. The One-wire address of each probe is also provided to help correlate datasets with probes.

- apply the desired adjustment factor for each probe:

U{i:n,j:v.v}

where n=probe index (0 through 2) and v.v is the adjustment value (if negative, then -v.v).

For example, I applied a negative 1.4°F adjustment to a room temperature probe, using:

U{i:2,j:-1.4}

After applying the adjustment factor you can use the dump command to verify the setting.

- Disconnect Screen from the serial port using

ctrl-a, k then answering "y".

- Use the BrewPi web gui to start the script and verify the probe data has been adjusted as desired.

Cheers!

I'm trying to run the calibration.

I have found I have to copy and paste the commands to get them to work.

I only have to adjust the probes a tiny bit. I want to apply a 0.4 deg C adjustment

I use

U{i:0,j:0.4} and I want the value to be 0.4 deg C higher than the sensor temp

Then it returns
U:{"i":0,"t":1,"c":1,"b":1,"f":9,"h":2,"d":0,"p":18,"a":"28FFA7D2A1150380","j":-0.125}

Am I missing something?
 
First things first, How do i give my RPI a static IP address?

I believe the best way to assign a static I.P. to your RPi is to reserve the address in your router configuration, if possible.

Most routers will support the function, and it eliminates any possible I.P. conflicts that may result by setting it up at the device.
 
Considering there are 611 pages to this thread, that's a lot of skimming to find my answer. I've got the GUI working, but the temp sensors are not being recognized as temp sensors but digital pins instead. I'm unable to get any temp readings at all and I have 3 sensors from amazon wired.

https://www.amazon.com/gp/product/B00CHEZ250/?tag=skimlinks_replacement-20

I assume without active temp sensor readings it won't activate the cooler or heater relays and that that may explain the "idling".

EQUIPMENT:
Raspberry Pi B+
https://www.amazon.com/gp/product/B00LAAKNHY/?tag=skimlinks_replacement-20
SainSmart UNO R3 ATmega328P Development Board (assumed rev C version)
https://www.amazon.com/gp/product/B00E5WJSHK/?tag=skimlinks_replacement-20

I'm Running Wheezy with the HEX C - UNO

I have rebooted yet there is no change in behavior.

Capture1.PNG


Capture2.PNG
 
Last edited by a moderator:
Considering there are 611 pages to this thread, that's a lot of skimming to find my answer. I've got the GUI working, but the temp sensors are not being recognized as temp sensors but digital pins instead. I'm unable to get any temp readings at all and I have 3 sensors from amazon wired.

https://www.amazon.com/gp/product/B00CHEZ250/?tag=skimlinks_replacement-20

I assume without active temp sensor readings it won't activate the cooler or heater relays and that that may explain the "idling".

EQUIPMENT:
Raspberry Pi B+
https://www.amazon.com/gp/product/B00LAAKNHY/?tag=skimlinks_replacement-20
SainSmart UNO R3 ATmega328P Development Board (assumed rev C version)
https://www.amazon.com/gp/product/B00E5WJSHK/?tag=skimlinks_replacement-20

I'm Running Wheezy with the HEX C - UNO

I have rebooted yet there is no change in behavior.
Did you run the sketch that was posted a few pages back to check that the DS18b20 are running in non parasitic mode?
 
Last edited by a moderator:
fwiw, this is how I set up all my RPi systems to use static addresses whether wired or wifi

Edit /etc/network/interfaces

Code:
auto lo

iface lo inet loopback
iface eth0 inet static
address 192.168.1.245
netmask 255.255.255.0
gateway 192.168.1.251

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet static
address 192.168.1.245
netmask 255.255.255.0
gateway 192.168.1.251

Obviously, you can only have one nic active at a time...

Cheers!
 
I found my mistake and edited my post accordingly. Thanks for the assist BigDaddyAle.

One more question, are there any tricks I should know before adding RaspberryPints to the same RPI with Wheezy vs NOOBS?

TYIA
 
I found my mistake and edited my post accordingly. Thanks for the assist BigDaddyAle.

One more question, are there any tricks I should know before adding RaspberryPints to the same RPI with Wheezy vs NOOBS?

TYIA

You should know that NOOBS is only for installing the particular version of the operating system you want. In your case, Wheezy. You will no longer need to use NOOBS once the operating system you want is installed.
 
You should know that NOOBS is only for installing the particular version of the operating system you want. In your case, Wheezy. You will no longer need to use NOOBS once the operating system you want is installed.

I scanned the directions last night and they used NOOBS is why I'm asking. I guess my main concern is remote viewing. How will I set-up unique web addresses on the same RPI?
 
the temp sensors are not being recognized as temp sensors but digital pins instead. I'm unable to get any temp readings at all and I have 3 sensors from amazon wired.

Did you run the sketch that was posted a few pages back to check that the DS18b20 are running in non parasitic mode?
Here is the post with the sketch:

https://www.homebrewtalk.com/showpost.php?p=7556259&postcount=5416

I don't have any experience with those probes, but the sketch will make it easier to diagnose things. It would also be helpful to post a good picture of the pertinent wiring so that we can see if there are any mistakes that nay have slipped past you.

I scanned the directions last night and they used NOOBS is why I'm asking. I guess my main concern is remote viewing. How will I set-up unique web addresses on the same RPI?
You would have to install the different applications into different web directories. For instance you are using Wheezy and the default is /var/www. You would install instead in /var/www/brewpi and your address would be http://{hostname}.local/brewpi

... the same with the next application and so on.

I'd recommend you get everything working once correctly "stock" and then start messing about with customizing.
 
Here is the post with the sketch:

https://www.homebrewtalk.com/showpost.php?p=7556259&postcount=5416

I don't have any experience with those probes, but the sketch will make it easier to diagnose things. It would also be helpful to post a good picture of the pertinent wiring so that we can see if there are any mistakes that nay have slipped past you.

-ANSWER- YES, I must have knocked a wire loose while moving from station to station, I recalled it was two spaces from the end but reinstalled in TX vs A4 on the arduino board. That was my bad.

You would have to install the different applications into different web directories. For instance you are using Wheezy and the default is /var/www. You would install instead in /var/www/brewpi and your address would be http://{hostname}.local/brewpi

... the same with the next application and so on.

I'd recommend you get everything working once correctly "stock" and then start messing about with customizing.

So, if everything is running as desired but I didn't install to /var/www/brewpi and instead followed the directions to install in /var/www/, then I need to reinstall in location /var/www/brewpi, and once again for /var/www/RaspberryPints ? Is it necessary now to start from scratch all over again or can I simply move the folder around?

Thanks for the LOCAL KC help (and everyone else)!

14330040_10211022925675822_8530864596749758079_n.jpg
 
So, if everything is running as desired but I didn't install to /var/www/brewpi and instead followed the directions to install in /var/www/, then I need to reinstall in location /var/www/brewpi, and once again for /var/www/RaspberryPints ? Is it necessary now to start from scratch all over again or can I simply move the folder around?



Thanks for the LOCAL KC help (and everyone else)!


Look for a set of directions from day_trippr within the first 10 pages of this thread. He lists how to move the files from /var/www to the directory you decide and which files to modify and how to modify them. It's very similar to how you would install multiple Arduinos.
 
So, if everything is running as desired but I didn't install to /var/www/brewpi and instead followed the directions to install in /var/www/, then I need to reinstall in location /var/www/brewpi, and once again for /var/www/RaspberryPints ? Is it necessary now to start from scratch all over again or can I simply move the folder around?

Thanks for the LOCAL KC help (and everyone else)!

If "everything is running as desired", you don't need to do anything.

But if you have a wild hair that's driving you to change, scan back a couple of pages where I've put all kinds of way to "fix" that...

Cheers!
 
I triple checked the wiring and I am not sure what is going on...my relay does not appear to be switching. In the Device List I can manually get it to turn on if I select "not-inverted" however the device will not change states (switch on/off)...only stays in constant state. Any ideas?

IMG_5289.jpg
 
Are you seeing legitimate temperature readings from the ds18b20 probes?
If the Arduino cannot read temperature probes, it will idle in perpetuity...

Cheers!
 
Yes I have one sensor wired and I am getting correct ambient temp reading. I have also ensured that my setpoint for cooking is lower than my ambient reading...this should provide the conditions to trigger the relay?
 
Last edited:
Could this have anything to do with selecting the wrong Arduino Uno rev? (i.e. I selected A versus C) when I downloaded the compatible HEX file from BrewPI?
 
If you only have the ambient (ie: Room Temperature) reading, BrewPi will idle forever.
There is no function for it to manage.

There is Fridge Constant, Beer Constant, and Beer Profile.
Point of fact, the Room Temperature is for info only and plays no role in anything BrewPi actually does.

So...easiest is to change that one probe to either Beer or Chamber Temperature, then you can run BrewPi in either Beer Constant or Fridge Constant, respectively, and manipulate the probe to cause the relays to toggle...

Cheers!

[edit] While I've only ever used the Rev C UNO hex files, I suspect either A or C hex file (for the correct module) will work.
I think the difference might be in the Rev A vs Rev C BrewPi shields, but I could well be wrong.
In any case, you're problem right now is how that one probe is configured...
 
I should've been more specific I apologize. It is not measuring ambient temperature as far as the board is concerned it is set as the beer temperature function however I am not currently brewing a batch and only gathering the ambient temperature from that probe.
 
Is there a reason your not using 2 probes? BrewPi really needs Beer + Fridge temp to be accurate.

Also what temp control option are you choosing? Beer Profile, Beer Constant, Fridge constant?
 
Status
Not open for further replies.
Back
Top