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.
OP
FuzzeWuzze

FuzzeWuzze

I Love DIY
Joined
Jun 19, 2012
Messages
3,140
Reaction score
458
Location
Newberg
Yea I see that fuzze reworked the single instance wiki and hopefully he can get to the multi because something is screwy in Denmark
I did run the pyserial code and was told it was already installed
Really at a loss here. I had this running a few weeks back but the second instance wasn't picking up any probes so I started over and the rug got pulled out from under me.

Thanks for the effort everyone
I didnt ever do a multi instance setup that was Wbarber and others who wrote those instructions. I really have no insight on it sorry :(
 

redman67

Well-Known Member
Joined
Feb 11, 2010
Messages
421
Reaction score
22
Location
Taunton
HALLELUJAH HALLELUJAH

i finally figured this freaking thing out

For inquiring minds I needed to run

$ sudo pip install pyserial --upgrade
For the script to finally start

Tried to load hex with web interface and I got the cannot receive controller number message

So I loaded rev c hex with xloader, plugged the the arduinos back in and I can see my devices

Needed to also run
echo -ne 'E\n' > /dev/ttyACM0
To get the devices to show up in detected area

Thanks so much to all who have helped me out with this
You guys are alright
 

day_trippr

"This Space For Rent"
Joined
May 31, 2011
Messages
37,471
Reaction score
20,325
Location
Stow, MA
HALLELUJAH HALLELUJAH

i finally figured this freaking thing out

For inquiring minds I needed to run

$ sudo pip install pyserial --upgrade
For the script to finally start

Tried to load hex with web interface and I got the cannot receive controller number message

So I loaded rev c hex with xloader, plugged the the arduinos back in and I can see my devices

Needed to also run
echo -ne 'E\n' > /dev/ttyACM0
To get the devices to show up in detected area

Thanks so much to all who have helped me out with this
You guys are alright
Excellent!

The '--upgrade' definitely answers something, though why pyserial needed upgrading for BrewPi is unknown to me. And there's still the apparent issue with the serial eeprom requiring out-of-Brewpi initialization as well. Neither of these was an issue in 2014...

Cheers!
 

redman67

Well-Known Member
Joined
Feb 11, 2010
Messages
421
Reaction score
22
Location
Taunton
maybe if I had run the echo -ne 'E\n' > /dev/ttyACM0 command after I did sudo pip install pyserial --upgrade i could have used the web interface to flash the hex
but i did it the other way around so the world may never know
 

CaptnDelta

Well-Known Member
Joined
May 7, 2014
Messages
164
Reaction score
26
i tried it said it downloaded i hooked it back up and the script is still not running

i tried to start it manually and i got this



[email protected] ~ $ sudo -u brewpi python /home/brewpi/chamber1/brewpi.py

Traceback (most recent call last):

File "/home/brewpi/chamber1/brewpi.py", line 21, in <module>

from BrewPiUtil import printStdErr

File "/home/brewpi/chamber1/BrewPiUtil.py", line 22, in <module>

import autoSerial

File "/home/brewpi/chamber1/autoSerial.py", line 6, in <module>

from serial.tools import list_ports

ImportError: No module named tools

Try a

sudo pip install pyserial --upgrade

the existing lib may be wrong rev.

Cheers,
-Th
 

thyirishmen

Well-Known Member
Joined
Sep 27, 2011
Messages
177
Reaction score
8
Location
Sycamore
So I was having the module tool issue as well. I did this

sudo apt-get install build-essential python-dev python-pip
sudo pip install psutil --upgrade

i did all python installs as per instructions but for some reason I was missing one of the extensions this fixed it for me.

What worked for me was I uploaded the hex version with the xloader, the script did not start still, i then went into the brewpi uploader and retried flashing with hex, at that point it worked and started working.

Also I was having an issue with cron job working , I am using this in my file and its working perfect.

try using this in your cron file:

stderrpath="/home/brewpi/logs/stderr.txt"
stdoutpath="/home/brewpi/logs/stdout.txt"
scriptpath="/home/brewpi"
entries="brewpi wifichecker"
# entry:brewpi
* * * * * brewpi python $scriptpath/brewpi.py --checkstartuponly --dontrunfile $scriptpath/brewpi.py 1>/dev/null 2>>$stderrpath; [ $? != 0 ] && python -u $scriptpath/brewpi.py 1>$stdoutpath 2>>$stderrpath &
# entry:wifichecker
*/10 * * * * root sudo -u brewpi touch $stdoutpath $stderrpath; $scriptpath/utils/wifiChecker.sh 1>>$stdoutpath 2>>$stderrpath &

feel free to PM me redman and I can try to help.

I started this last night and working great so far with a 5gal water test

test.png
 

FISTfullaBEER

Member
Joined
Jan 13, 2016
Messages
8
Reaction score
4
I read over doing a multiple chamber setup, and I'm curious why there needs to be more than one Arduino? Is there a reason you can't use another pair of GPIOs to control an 8-relay board on a three chamber setup?
 

GrogNerd

mean old man
Joined
Oct 3, 2012
Messages
8,233
Reaction score
6,379
Location
Sterling, VA
I read over doing a multiple chamber setup, and I'm curious why there needs to be more than one Arduino? Is there a reason you can't use another pair of GPIOs to control an 8-relay board on a three chamber setup?
think it's an issue with the size of the HEX and the limit to what will fit on the Arduino. it's packed in there as it is for 1 chamber, which is why they switched to the Spark

from my understanding the Pi can control more than 1 Arduino and you certainly can use multiple Arduinos thru the 8-relay board
 

day_trippr

"This Space For Rent"
Joined
May 31, 2011
Messages
37,471
Reaction score
20,325
Location
Stow, MA
I read over doing a multiple chamber setup, and I'm curious why there needs to be more than one Arduino? Is there a reason you can't use another pair of GPIOs to control an 8-relay board on a three chamber setup?
There is a hella lot going on inside the AVR to get those GPIOs to do their thing properly.
It takes nearly every bit of the chip to manage a single instance.
No way could it manage more than that...

Cheers!
 
OP
FuzzeWuzze

FuzzeWuzze

I Love DIY
Joined
Jun 19, 2012
Messages
3,140
Reaction score
458
Location
Newberg
Also Arduinos are dirt cheap, you can get a chinese knockoff for like $4 on Ebay.
 

cegan09

Supporting Member
HBT Supporter
Joined
Dec 16, 2015
Messages
934
Reaction score
354
I'm trying to setup a second fridge, and i'm stumped. I cannot make the pi see the arduino. What I have right now:

Working setup:
Pi 2 with an official Arduino uno R3 that has been running since december.

New setup
Pi B+ with an official arduino uno R3 that refuses to work.

Both Pi work, I have tested them both with the arduino from the working setup and both start the script and run.

The new arduino will program, I can throw any number of sample sketches on it and it all works fine. However the pi refuses to see it. I can't program through the web interface. I've loaded the hex with xloader, and still, nothing. The logs just say
Feb 02 2016 21:53:06 Opening serial port
Feb 02 2016 21:53:17 Errors while opening serial port:
Could not find compatible serial devices

I'm at a complete loss. No matter what I do the arduino can't be seen by the pi. I've loaded a few different versions of the hex file through xloader, and nothing works.

Do I just have a faulty board? Or has anyone else seen this?
 

day_trippr

"This Space For Rent"
Joined
May 31, 2011
Messages
37,471
Reaction score
20,325
Location
Stow, MA
[...]Both Pi work, I have tested them both with the arduino from the working setup and both start the script and run.
[...]
I would not assume that both Pi systems will "see" an Uno as the same device.
Ie: what might be /dev/ttyACM0 on the 2 might be /dev/ttyUSB0 on the B+.

To that end, as long as you can xload the BrewPi hex file on it, could you try the new Uno on the Pi 2?

Cheers!
 

cegan09

Supporting Member
HBT Supporter
Joined
Dec 16, 2015
Messages
934
Reaction score
354
Bad USB cable
I have tried swapping cables. Both cables work with the existing setup, neither make a difference with the new one.

I would not assume that both Pi systems will "see" an Uno as the same device.
Ie: what might be /dev/ttyACM0 on the 2 might be /dev/ttyUSB0 on the B+.

To that end, as long as you can xload the BrewPi hex file on it, could you try the new Uno on the Pi 2?

Cheers!
I have tried the new uno with both Pi, to the same result. Both Pi see both arduino boards as ttyACM0. The existing uno comes up and runs fine on either pi. The new uno gives the same "Could not find compatible serial devices" error on both pi.

I've tried the new uno on both Pi with a couple variants of the uno revC hex (2.8, 2.9, 2.10), again, no change.

I'm to the point of admitting the new board is faulty (even though every example sketch I throw on it from the Arduino software works perfectly) and will order a new one.
 

day_trippr

"This Space For Rent"
Joined
May 31, 2011
Messages
37,471
Reaction score
20,325
Location
Stow, MA
I wonder if that BrewPi message is referring to the serial eeprom.
Theoretically that could be borked but still let you load sketches and even hex code.

So, just for grins, did you try "manually" clearing the eeprom?

Code:
$ echo -ne 'E\n' > /dev/ttyACM0
Cheers!
 

redman67

Well-Known Member
Joined
Feb 11, 2010
Messages
421
Reaction score
22
Location
Taunton
You could also try

$ sudo pip install pyserial --upgrade

Worked for me with a different problem, but it can't hurt
 

cegan09

Supporting Member
HBT Supporter
Joined
Dec 16, 2015
Messages
934
Reaction score
354
I wonder if that BrewPi message is referring to the serial eeprom.
Theoretically that could be borked but still let you load sketches and even hex code.

So, just for grins, did you try "manually" clearing the eeprom?

Code:
$ echo -ne 'E\n' > /dev/ttyACM0
Cheers!
Interesting thought. I'll give that a try tonight. Thanks.


You could also try

$ sudo pip install pyserial --upgrade

Worked for me with a different problem, but it can't hurt
I did try that. I've spent a few days now searching other problems and trying their solutions to see if I can make this work. pyserial is definitely up to date.
 

wbarber69

Well-Known Member
Joined
Oct 13, 2013
Messages
2,191
Reaction score
263
I'd open up arduino ide plug in the faulty uno and run the clear eeprom sketch. then try to load the hex again and see what happens.
 

cegan09

Supporting Member
HBT Supporter
Joined
Dec 16, 2015
Messages
934
Reaction score
354
Nothing makes a difference, new uno still refuses to talk. I've accepted that something is wrong with it and a new one will be in my mailbox tomorrow. Hopefully that one works without issue and I can get my second fridge running. Thanks for all the suggestions from everyone.
 

ame

Well-Known Member
Joined
Oct 25, 2015
Messages
378
Reaction score
60
Hello there,

I took a look at the code. The error message "Could not find compatible serial devices" is emitted by BrewPiUtil.py when it looks for an Arduino on a USB serial port.

Line 127 here:
https://github.com/BrewPi/brewpi-script/blob/a49bd74983d7cef2c4c75c5b92307def52280887/BrewPiUtil.py

It looks like this should only occur if the port is set to "auto" in the config file, but I didn't look too deeply at the code.

The "auto" port setting seems to look for valid VID/PID pairs for the USB devices attached.

The valid IDs are:
known_devices = {
(r"USB VID\:pID=2341\:0010.*"): "Arduino Mega2560",
(r"USB VID\:pID=2341\:8036.*"): "Arduino Leonardo",
(r'USB VID:pID=2341:0043.*'): "Arduino Uno",
(r"USB VID\:pID=1D50\:607D.*"): "Spark Core",
(r"USB VID\:pID=2B04\:C006.*"): "Particle Photon",
}

What USB IDs does your UNO report? You can find out by plugging it in and typing:

lsusb

in a command window (that's lowercase "l", so ell-ess-you-ess-bee). It will show the VID and PID of all attached USB devices. If your UNO has a different ID for some reason that could be the problem. But if your UNO VID and PID is in the list above then the problem is elsewhere.

I think this feature was new in July last year, so versions before that may not check IDs and therefore may not throw up the error.
 

cegan09

Supporting Member
HBT Supporter
Joined
Dec 16, 2015
Messages
934
Reaction score
354
Both of my arduinos return the same ID, 2341:0043*. So no idea on that.

I am running the legacy branch of code, but I forget what build that bumps it back to.
 

Elkoe

Well-Known Member
Joined
Nov 21, 2011
Messages
86
Reaction score
29
Location
Eindhoven
Hello there,
known_devices = {
(r"USB VID\:pID=2341\:0010.*"): "Arduino Mega2560",
(r"USB VID\:pID=2341\:8036.*"): "Arduino Leonardo",
(r'USB VID:pID=2341:0043.*'): "Arduino Uno",
(r"USB VID\:pID=1D50\:607D.*"): "Spark Core",
(r"USB VID\:pID=2B04\:C006.*"): "Particle Photon",
}
That is not the latest version of the code. I refactored the code afterwards. Make sure you are running the latest version. Run this and show the output:

Code:
 python /home/brewpi/autoSerial.py
 

cegan09

Supporting Member
HBT Supporter
Joined
Dec 16, 2015
Messages
934
Reaction score
354
for what it's worth, new arduino showed up and works flawlessly. Got the fridge running and a fermentation up to temp.

Then I went and screwed with it trying to make the pi run multiple arduinos and broke it all. Yay me. Flashing back an image of the SD card I was smart enough to make when the single instance was working. I'll try again in the morning.
 

Phischy

Well-Known Member
Joined
Oct 20, 2011
Messages
82
Reaction score
19
Location
Houston
This is a huge thread and daunting due to its size. Where's the best place for a noob to start?
 

cegan09

Supporting Member
HBT Supporter
Joined
Dec 16, 2015
Messages
934
Reaction score
354
This is a huge thread and daunting due to its size. Where's the best place for a noob to start?
At the beginning.

If you're really just starting out trying to build one read through post 1 a number of times, it's really well written. That should get you started. Also read the official brewpi documentation, it's a great resource. For all the problems I've had with my second build, just using those two things got my first build up and running quickly.

http://docs.brewpi.com/

If you then get stuck you can search for your specific problem, or ask.
 

Effinbrewer

Member
Joined
Oct 10, 2010
Messages
19
Reaction score
2
Location
Blackpool, UK
And then take a look at post 478? . . .can't remember which one as that will tell you how to load the legacy branch. . . You can't follow the automatic install instructions at the BrewPi Docs page any more but the manual ones work.
 

cegan09

Supporting Member
HBT Supporter
Joined
Dec 16, 2015
Messages
934
Reaction score
354
excellent point. FWIW, you can use the auto install still, you just need to switch to the legacy branch after the install. Follow the automatic install instructions, and then run this command:

sudo ~/brewpi-tools/updater.py --ask

That runs the update script with prompts and lets you pick the legacy branch which will get you up and running. This is what I did on the latest install, and it worked great. Once you've swapped to the legacy branch you can program the arduino and get going.
 

wbarber69

Well-Known Member
Joined
Oct 13, 2013
Messages
2,191
Reaction score
263
That is not the latest version of the code. I refactored the code afterwards. Make sure you are running the latest version. Run this and show the output:



Code:
 python /home/brewpi/autoSerial.py

Apparently everyone is having issues with the new code so everyone here is running legacy for the time being. from what we can tell Pyserial is messed up as well. I haven't done anything with my setup in awhile so I can't really relate to what's going on but that's why it seems no one is running legacy.
 
OP
FuzzeWuzze

FuzzeWuzze

I Love DIY
Joined
Jun 19, 2012
Messages
3,140
Reaction score
458
Location
Newberg
This is a huge thread and daunting due to its size. Where's the best place for a noob to start?

All the up to date instructions are in the Wikia now for the most part. The link got added to the top of the first page. All new people should start there. I still need to move the Setting up your probes in BrewPi to the Wiki, so for now use the thread for setting up the devices.
 
OP
FuzzeWuzze

FuzzeWuzze

I Love DIY
Joined
Jun 19, 2012
Messages
3,140
Reaction score
458
Location
Newberg
Apparently everyone is having issues with the new code so everyone here is running legacy for the time being. from what we can tell Pyserial is messed up as well. I haven't done anything with my setup in awhile so I can't really relate to what's going on but that's why it seems no one is running legacy.
Im having no issues i just did it all from scratch last weekend on a blank RPI and Arduino.

I wrote it all down on the Wiki what needs to be run, i had no issues with PySerial or anything really, but i can only speak to the commands i wrote for a single instance bare bones setup like in the OP, not how things change when your doing LCD's/Bluetooth/Multiple instances or the other mods people have been doing and how that effects things.
 

Phischy

Well-Known Member
Joined
Oct 20, 2011
Messages
82
Reaction score
19
Location
Houston
Let me ask this because this will be my setup:
DIY coldroom with 2 fermentation chambers adjacent. They will pull cold air via pc fans and pvc ducting and will be warmed by a heat blanket. I'd like to have each chamber with 2 probes (ambient air and fermenting temp) and a probe into the cold room just to log temps. Just a coldbot to control the AC unit

Is this possible?
 

Phischy

Well-Known Member
Joined
Oct 20, 2011
Messages
82
Reaction score
19
Location
Houston
Cool, I wasn't sure how the power supply to the fans or heater worked. I'm using dual stage ranco's now but I really want data logging.
 
OP
FuzzeWuzze

FuzzeWuzze

I Love DIY
Joined
Jun 19, 2012
Messages
3,140
Reaction score
458
Location
Newberg
Cool, I wasn't sure how the power supply to the fans or heater worked. I'm using dual stage ranco's now but I really want data logging.
You'd basically have two Arduino's replacing the Ranco's, they report into your RPI/PC that hosts the webpage and logs the data the Arduino sends it.

In your case one Arduino would have 2 probes, the other would have 3(w/ Room).

It should also be noted that the Room sensor does not affect the operation of BrewPi in any way, only the Fridge/Beer sensors actually affect the PID algorithm and how it controls your heater/cooler..the room temp is just a "Nice to know" thing.
 

Phischy

Well-Known Member
Joined
Oct 20, 2011
Messages
82
Reaction score
19
Location
Houston
From what I read I need to have a PC running 24/7 to log the data? I need to read more, love building stuff and this and the cold room are my last two items for the home brewery.
 
OP
FuzzeWuzze

FuzzeWuzze

I Love DIY
Joined
Jun 19, 2012
Messages
3,140
Reaction score
458
Location
Newberg
Yes, which is why most people use RPI's because they are super small and take almost zero power. You could just stick one to the outside of your ferm chamber inside your cold room with some velcro, put a Wifi dongle in it or wire it up to Ethernet and be done with it.
 

Elkoe

Well-Known Member
Joined
Nov 21, 2011
Messages
86
Reaction score
29
Location
Eindhoven
Apparently everyone is having issues with the new code so everyone here is running legacy for the time being. from what we can tell Pyserial is messed up as well. I haven't done anything with my setup in awhile so I can't really relate to what's going on but that's why it seems no one is running legacy.
Sigh, that's what the legacy branch is for. It has all the things that are backwards compatible with Arduino, including the new pyserial. If you just update to pyserial 3.0,the new default, it should work just fine.

I keep the legacy branch up to date with things that are not Photon specific.

Also, resetting EEPROM can be done via the web interface now (advanced settings --> factory defaults button). If you can't start the script, the EEPROM is not the problem.
 
Status
Not open for further replies.

Latest posts

Top