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.
Here are the steps I am going through.
1. Make sure brewpi script is running
2. Upload Hex file using web interface
3. Install the devices and change the temp setting from Celsius to Fahrenheit
4. Set the beer temp constant on main page

Everything up to that point works great. The graph updates fine and records the correct temps. Then I unplug the USB cable from the Arduino. When I plug it back in and view the log window it says:

"Warning: Cannot receive version number from controller. Your controller is either not programmed or running a very old version of BrewPi. Please upload a new version of BrewPi to your controller."

Nothing comes up if I refresh the devices screen. I then try to reflash the Hex file and choose to restore old settings and installed devices. When I do that, it programs fine and says successful but during the process it says that there was no previous version and no settings were restored.

How much time are you giving it before you reprogram the arduino? Have you tried giving it 10minutes or so to see if the arduino is recognized? Have you tried rebooting the computer after plugging the arduino back in? Have you tried manually stopping and restarting the brewpi scripts after plugging the arduino back in?
 
How much time are you giving it before you reprogram the arduino? Have you tried giving it 10minutes or so to see if the arduino is recognized? Have you tried rebooting the computer after plugging the arduino back in? Have you tried manually stopping and restarting the brewpi scripts after plugging the arduino back in?

I have let it sit for almost a full day after plugging it back in (it's current state actually). I have tried restarting the script as well. The only thing I have not done is restarting my VM.
 
I have let it sit for almost a full day after plugging it back in (it's current state actually). I have tried restarting the script as well. The only thing I have not done is restarting my VM.

OK. I just tried restarting the script again and for some reason, it worked! I then reboot the VM and it came back up fine as well. So I guess the question is, why is the script not recognizing it when it first powers on?
 
Here is my wild guess: when you unplug the usb the script is still looking for the arduino on the same ttyUSB port, so when you plug the arduino back in the kernel assigns it to a different ttyUSB port because the first one is still opened and being read by the script. So the script is looking in the wrong port until you reset it and it can then 'search' for the proper port.

Again this is just a guess, maybe someone else can chime in on this.
 
^that^ sounds reasonable.

Could this problem be avoided by using ATTRS{serial}== for the symlink in /etc/udev/rules.d/99-arduino.rules instead of the port name?

I use that technique to allow me to easily move my BrewPi minions around without worrying about what ports they're attached to...

Cheers!
 
^that^ sounds reasonable.

Could this problem be avoided by using ATTRS{serial}== for the symlink in /etc/udev/rules.d/99-arduino.rules instead of the port name?

I use that technique to allow me to easily move my BrewPi minions around without worrying about what ports they're attached to...

Cheers!

I agree. It definitely sounds like it just cannot find the serial link on reconnect. Is that 99-arduino.rules file something I have to create? I only have one for vmware in that directory.
 
Yes, it does hand the Arduino back over to the VM, but sometimes it uses a different port. It is usually ttyACM0, but will sometimes come back up to ttyACM1. It should be fine since the altport is specified as ttyACM1 in the config.cfg file.



To answer the previous question, yes, I have tried the fix permissions script a few times. I even wiped and reinstalled from scratch and also tried throwing the www-data and brewpi users into additional groups than what is specified in the instructions (dialout,brewpi,www-data).


Ok so to solve one problem you need to go back and look at some of the earlier posts after day_tripper and I played with the multi-chamber settings for using usb hubs. You need to setup a symlink device using the serial address of the arduino. This way whenever you plug it back in it will always detect the device for what it is. Altport isn't a very good alternative imho. I've used vm's in my early testing phases to get everything programmed and working for my BT minions. I think I've had your problem before. The thing is your arduino will be programmed and your vm won't see it that way for some reason. I'd try resetting the vm instead of reflashing the arduino everytime.

EDIT: I see day_tripper beat me to the punch
 
I agree. It definitely sounds like it just cannot find the serial link on reconnect. Is that 99-arduino.rules file something I have to create? I only have one for vmware in that directory.

Most likely. It's been awhile so I can't remember for sure, but the only entries I have in mine are for the BrewPi devices, so I believe I had to create it.

Here are my notes on how to set this all up...

Set up identifiers for UNOS:

Remove all but one UNO from the USB ports and hubs, then run these commands:

Code:
$ udevadm info -a -n /dev/ttyACM0 | less > info.log
$ nano info.log

In the log file, look for "Arduino", and right below that you'll find the serial number for the AVR. Eg:

Code:
looking at parent device '/devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3.4':
    KERNELS=="1-1.3.4" 
 		ATTRS{manufacturer}=="Arduino (www.arduino.cc)"
 		ATTRS{serial}=="85336303532351F0A031"

Repeat for additional UNOS on the USB ports

Then create the rules file:

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

You can use the following as a template. This shows two AVRs.

Code:
SUBSYSTEM=="tty", KERNEL=="ttyACM*" , ATTRS{serial}=="85336303532351F0A031", SYMLINK+="brewpi1", GROUP="brewpi"
SUBSYSTEM=="tty", KERNEL=="ttyACM*" , ATTRS{serial}=="85334333931351F0F020", SYMLINK+="brewpi2", GROUP="brewpi"


Once the udev rules file is created, disconnect your Arduino and then reload udev
before connecting all of the Ardiunos to their respective ports.

Code:
$ sudo /etc/init.d/udev reload

Cheers!
 
Most likely. It's been awhile so I can't remember for sure, but the only entries I have in mine are for the BrewPi devices, so I believe I had to create it.

Here are my notes on how to set this all up...

Set up identifiers for UNOS:

Remove all but one UNO from the USB ports and hubs, then run these commands:

Code:
$ udevadm info -a -n /dev/ttyACM0 | less > info.log
$ nano info.log

In the log file, look for "Arduino", and right below that you'll find the serial number for the AVR. Eg:

Code:
looking at parent device '/devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3.4':
    KERNELS=="1-1.3.4" 
 		ATTRS{manufacturer}=="Arduino (www.arduino.cc)"
 		ATTRS{serial}=="85336303532351F0A031"

Repeat for additional UNOS on the USB ports

Then create the rules file:

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

You can use the following as a template. This shows two AVRs.

Code:
SUBSYSTEM=="tty", KERNEL=="ttyACM*" , ATTRS{serial}=="85336303532351F0A031", SYMLINK+="brewpi1", GROUP="brewpi"
SUBSYSTEM=="tty", KERNEL=="ttyACM*" , ATTRS{serial}=="85334333931351F0F020", SYMLINK+="brewpi2", GROUP="brewpi"


Once the udev rules file is created, disconnect your Arduino and then reload udev
before connecting all of the Ardiunos to their respective ports.

Code:
$ sudo /etc/init.d/udev reload

Cheers!

Awesome. I will definitely give that a try. I had a chance to do some additional testing tonight and have determined that it is definitely an issue with the serial connection not being released from the VM when I unplug the Arduino. If it is running on ttyACM0 and I unplug it, it will almost always come back up on ttyACM1. It did come back up a few times on ACM0, but usually not. It would also occasionally work again by stopping and restarting the script. Again, not always. However, rebooting the VM would always fix the issue and it comes up immediately when I launch the BrewPi site.

At this point I think I will try creating the symlink file and see if that clears it up. If not, at least I know I can just restart the VM and fix it. I might see if I can find an old physical machine to install it on and see if that clears it up as well. Thank you thekraken, day_trippr and wbarber69 for all your help.
 
now annotations are displaying TRIPLE

any ideas?

annotations.JPG
 
im having trouble with the udevadm info-a-n /dev/ttyACM0 | less step of the multi chamber set up, when i type the command i get this screen


info query sysfs or the udev database
trigger request events from the kernel
settle wait for the event queue to finish
control control the udev daemon
monitor listen to kernel and udev events
test test an event run
test-builtin test a built-in command
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
(END)
where i cant do anything
any help would be appreciated
 
im having trouble with the udevadm info-a-n /dev/ttyACM0 | less step of the multi chamber set up, when i type the command i get this screen


info query sysfs or the udev database
trigger request events from the kernel
settle wait for the event queue to finish
control control the udev daemon
monitor listen to kernel and udev events
test test an event run
test-builtin test a built-in command
~
[...]
~
(END)
where i cant do anything
any help would be appreciated

I'm surprised you get anything on the terminal - the correct command dumps the stdout lines to a text file.

Code:
$ udevadm info -a -n /dev/ttyACM0 | less > info.log
$ nano info.log

Still works here...

Cheers!
 
I'm surprised you get anything on the terminal - the correct command dumps the stdout lines to a text file.

Code:
$ udevadm info -a -n /dev/ttyACM0 | less > info.log
$ nano info.log

Still works here...

Cheers!

great thanks
i was able to get it and move forward to the web interface config part but how do you create the directories?

sorry your dealing with a total computer noob here
 
Are you trying to build a multi-ferment setup from scratch or are you just trying to solve the port disconnection issues. As the directories should have been created already
 
Trying from scratch in the instructions it says you may have to create the directories and it's telling me the file doesn't exist
 
You definitely have to create some folders for the different/multiple instance files to reside.
There are two "sets" of files for each instance, one resides under /home, the other under /var/www.

Eg: For my four-instance BrewPi setup, I created these pairs of folders:

/home/brewpi/brewpi1 & /var/www/brewpi1
/home/brewpi/brewpi2 & /var/www/brewpi2
/home/brewpi/brewpi3 & /var/www/brewpi3
/home/brewpi/brewpi4 & /var/www/brewpi4

I used WinSCP to create the first set of folders, made all the changes needed and got that instance running.
Then I used WinSCP to clone that first set to the other three instances, renaming the base folders along the way...

Cheers!
 
Are the Brewpi and Arduino Uno versions supposed to be the same? The LCD screen on my browser displays "Could not receive controller version. Please (re) program your controller". I updated the script with

sudo ~/brewpi-tools/updater.py

It updated Brewpi. However when I hit yes to update controller firmware, it failed. It said current version 2.4, latest 2.11 but wouldn't install. I manually downloaded and flashed 2.10 hex from Brewpi Github but couldn't find 2.11. Still seem to have the problem. On the program tab for controller, the output reads

serial.serialutils.SerialExecution: writefailed: [Errno 5] input/output error

During all of this, the system still controls temp and follows the set profile. It just doesn't display temps and set points on the LCD screen or log data for the plot.
 
Seems like you got a bad usb cable or you are trying to power the arduino over usb and the pi has a bad psu
 
Seems like you got a bad usb cable or you are trying to power the arduino over usb and the pi has a bad psu

Could be a bad USB cable. I'm using a PC running Debian instead of the RaspPi, so the PSU shouldn't be bad on that. BUT I am connecting the Arduino power to the computer USB outlet. That could be the problem. I will try to connect it to a power outlet with a USB-to-outlet adapter when I get home. Thanks.
 
Hello everyone. Brand new brewer here. I've only made one batch with a friend on his equipment (bottling an APA tonight) but I got hooked and in the mean time have gotten all of my own equipment to get going.

I'm a computer nerd and had a rasp pi literally sitting in a drawer so I figured I'd give this a shot. My aforementioned friend is an electronics tinkerer so I assisted while he did most of the wiring work.

The Uno and relay are velco'd to the project box in case they need to come out. Holes were cut to flush mount the outlet and the USB cable for the Uno:

jta14E2l.jpg


Identifying probes and outlets with cup of ice water and a fan:

IUrIaOll.jpg


Set up in my fridge with a 30L Speidel full of ~6.5 gallons of water wrapped in 3 feet of reptile heat tape with fan for circulation:

dWDEgmLl.jpg


I started with ~66F tap water and set it for 70F. It ramped up smoothly and held for a few hours. Then in the evening I set it to 64F and it's working beautifully. It had only been idle 10 minutes when I grabbed this screenshot but it was regularly going 60 - 90 minutes without running either heat or cool.

0KwcXvPl.jpg


Not bad for about $32 in parts including the thermowell.

Two lessons learned:

1. If using a 30L Speidel you'll need a 16" thermowell to get down into 5 or 5.5 gallons of liquid. I got the 12" and it's fine with 6.5 gallons but I don't think it would be in the liquid much or at all with 5 gallons. I have one ordered and I'll keep the 12" for carboys.

2. I want to splice about a 2 foot extension to at least the beer probe. I thought the probe wires would be long enough but didn't account for them coming up from the floor and back down into the thermowell. Alternately I may rig up a mounting solution to the side of the fridge higher up. The shelf standing on end is a mess.
 
It doesn't look like its jumping around. It looks like you have temperature control disabled. So you're just reading room temperature.
 
Wanted to ask if this look normal to you guys my refrigerator temp seams to jump around. Is this normal or is this noise.

Have you got the probe attached to anything at the moment?
If it is just in air then it will cycle more often then when it has some thermal mass to dampen the rate of change.
 
Compared to the beer temp (which is filtered) it will never be as smooth of a graph (due to the filter). But your vertical lines in the graph are 6 hours apart, so if you zoomed in to a 1 hour window, it would probably appear more constant. I think it appears to be normal.
 
Have you got the probe attached to anything at the moment?
If it is just in air then it will cycle more often then when it has some thermal mass to dampen the rate of change.

Hmm, mine seems to do this too, but my fermentation came out great. I'm wondering what you all attach the fridge probe to while the unit is underway? Beer line probe in the Thermowell and what, fridge probe in a glass of water? Taped to the side wall?
 
Hmm, mine seems to do this too, but my fermentation came out great. I'm wondering what you all attach the fridge probe to while the unit is underway? Beer line probe in the Thermowell and what, fridge probe in a glass of water? Taped to the side wall?

Because the software uses the fridge temp to accurately "learn" your system and control the PID values, I would not insulate (or isolate) the fridge temp sensor. If you do, it may negatively impact the control constants. That's just my (uneducated) guess.

I would (and do) leave the sensor hanging in the open air out of the way
 
Yup. You don't want to add thermal mass to slow the response time of the fridge probe, so stick it out in free air where it won't rest against anything...

Cheers!
 
Any one know what might cause my chambers temp sensors (beer and refrigerator) to jump up to around the 105 marks. This happens on both probes. But when I open up the chamber its around 50. After I turn it back off the temp drops back down and matches the garage temp around 75.
 
Did you happen to plug the sensors in after the brew pi was already powered on?
 
Status
Not open for further replies.
Back
Top