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.
Ok, so I am bowing out and asking for help. I have been fighting getting my setup running for 2 weeks and 2 arduino boards. I have my raspberry pi running, have installed brewpi without problems, but no matter what I do I cannot get brewpi to connect to the arduino board (either of them, or with any of the 4 cables I have tried).

I have tried using the updater with the ask command to use legacy mode, and when it gives the option to update the controller I choose yes, but it always fails after trying to open serial port saying it can't connect to the controller.

Does anyone have any ideas how to resolve this. I am usually tech savvy, but this has kicked my ass.

Thanks!
 
Honestly i'd image your RPI, then start over following my instructions on the Wiki and see if you can even get 1 working.

Your Arduino not being detected by the RPI though seems like a very basic problem, if it doesnt show up in /dev/TTYACM0 when you plug it in its possibly just ****ed...or your USB port is, have you tried plugging a keyboard into it the USB ports to see if they function?
 
Honestly i'd image your RPI, then start over following my instructions on the Wiki and see if you can even get 1 working.

Your Arduino not being detected by the RPI though seems like a very basic problem, if it doesnt show up in /dev/TTYACM0 when you plug it in its possibly just ****ed...or your USB port is, have you tried plugging a keyboard into it the USB ports to see if they function?


I agree, and it must not be that difficult since it doesn't seem to be a common problem. I have checked and the arduino does show up as TTYACM0, and I have keyboards and wireless dongles in the USB ports without problems. I will go ahead and reload the raspian software and start over based on the wiki. Thank you for the advice.

fwiw,



Code:
$ sudo pip install pyserial --upgrade



has gotten a few folks off the schnide lately...



Cheers!


Thank you, I will go ahead and give that a go prior to reinstalling raspian.
 
Honestly i'd image your RPI, then start over following my instructions on the Wiki and see if you can even get 1 working.

Your Arduino not being detected by the RPI though seems like a very basic problem, if it doesnt show up in /dev/TTYACM0 when you plug it in its possibly just ****ed...or your USB port is, have you tried plugging a keyboard into it the USB ports to see if they function?


So I just did a fresh install of raspian and brewpi and it still fails on the update of the controller software due to not being able to connect. I checked and it sees /dev/ttyAMC0. I do have a wireless dongle plugged in, could that be throwing off anything?
 
So I just did a fresh install of raspian and brewpi and it still fails on the update of the controller software due to not being able to connect. I checked and it sees /dev/ttyAMC0. I do have a wireless dongle plugged in, could that be throwing off anything?

No. My twin RPi2 R'Pints/BrewPi/Much More systems are festooned with dongles and can still find their built-in USB Unos.
Something else is missing - you're likely right at the same place that a lot of other folks have landed lately...
 
So I just did a fresh install of raspian and brewpi and it still fails on the update of the controller software due to not being able to connect. I checked and it sees /dev/ttyAMC0. I do have a wireless dongle plugged in, could that be throwing off anything?

Alright I got a few minutes to look into this and I realized there's a bug in the BrewPi code that snuck by those guys. Previously i didnt blank flash my Arduino and just used what was on it, but it had no problems opening and seeing it and told me it was up to date so i just assumed it would work from blank. This is not true.

To fix Brewpi so that you can flash the hex you need to edit /home/BrewPi/BrewPi.py
Goto Line 636 (which should be bg_ser.stop(), delete the entire line
Save the file
Run sudo apt-get install arduino-core to install avrdude and some other Arduino tools for flashing.
Go download the latest Arduino image Uno image from https://github.com/BrewPi/firmware/releases/download/0.2.10/brewpi-arduino-uno-revC-0_2_10.hex
Using the BrewPi webpage, go into Maintenence panel->reprogram controller. Give it your hex file, select Uno, select No for both questions and hit Program..you should see it run AVR dude, and reboot the Arduino.

I'll talk to Elco about fixing the bug so future people wont have to do this and the updating to legacy script that programs should then work for future people, but if your in a hurry to get it working do that :)
 
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

Hey Elkoe,

I believe found a bug in BrewPi.py on the Legacy branch thats breaking all new setups using Arduinos. I submitted it to the Git Repo as well.

On line 636 you are using bg_ser.stop(). The problem is that bg_ser is of type None, it only gets defined on line 374 if the Arduino detected a hwVersion is not none. I think this hwVersion is the brewpi revision? So right now basically you can only run the programArduino case if the arduino is already programmed and returns a hwVersion earlier in the script and thus has a valid bg_ser. Atleast this is what i believe from spending 30 minutes looking at it.

When this code runs on a blank Arduino it errors out that bg_ser.stop does not exist because bg_ser is of NoneType. Simply removing this line fixes the problem, but obviously you do want it to stop if there is a hwVersion so some extra if logic maybe needed here:mug:

Hopefully that makes sense, if not maybe the Git bug will.
 
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

Not sure if you got your setup working or not but check my post here for programming the Arduinos. Theres currently a bug in the BrewPi software for flashing blank Arduinos.

https://www.homebrewtalk.com/showpost.php?p=7387465&postcount=4807
 
Ok, so I am bowing out and asking for help. I have been fighting getting my setup running for 2 weeks and 2 arduino boards. I have my raspberry pi running, have installed brewpi without problems, but no matter what I do I cannot get brewpi to connect to the arduino board (either of them, or with any of the 4 cables I have tried).

I have tried using the updater with the ask command to use legacy mode, and when it gives the option to update the controller I choose yes, but it always fails after trying to open serial port saying it can't connect to the controller.

Does anyone have any ideas how to resolve this. I am usually tech savvy, but this has kicked my ass.

Thanks!

I fought for a few days with mine (see the past couple pages) and it turned out to be something really dumb. check the config file (/home/brewpi/settings/config.cfg) and see what arduino version is listed. I had that line uncommented but left as leonardo, so it failed every time. As soon as i set it to uno the pi could talk to the arduino.

I also had the hex file pre-loaded onto the uno through xloader, so that helped.
 
Short answer is yes. Setting up a Multiple chamber BrewPi is a bit more involved but its documented on the Wiki and quite a few people have experience with it. That said i think there are some issues people trying to setup Multiple chambers are having right now.

http://diybrewpi.wikia.com/wiki/Multiple_Fermentation_Chamber_Control_with_BrewPi

So just a note. When following those instructions I kept running into a hiccup when trying to git pull the files. It told me I couldn't place them into /home/brewpi/whatever because it didn't exist, and it wouldn't let me make the folder. I ended up having to skip to step 10 and setup the brewpi user first and then go back. Not sure if this was something i was doing wrong on my end, or what.

I still haven't gotten multiple to work, but i haven't given up.
 
So just a note. When following those instructions I kept running into a hiccup when trying to git pull the files. It told me I couldn't place them into /home/brewpi/whatever because it didn't exist, and it wouldn't let me make the folder. I ended up having to skip to step 10 and setup the brewpi user first and then go back. Not sure if this was something i was doing wrong on my end, or what.



I still haven't gotten multiple to work, but i haven't given up.


The walkthroughs are kinda put together using different parts of other walkthroughs for different apps and features you need. it's not unlikely that a portion of one doc might be referred to out of flow for a perfect install. at least there are plenty of resources for you guys today. it's definitely a project that will get you into arduinos and pis to the point where you are trying to find d a way to hook one up to every appliance you have. be careful it's a slippery slope.
 
So just a note. When following those instructions I kept running into a hiccup when trying to git pull the files. It told me I couldn't place them into /home/brewpi/whatever because it didn't exist, and it wouldn't let me make the folder. I ended up having to skip to step 10 and setup the brewpi user first and then go back. Not sure if this was something i was doing wrong on my end, or what.

I still haven't gotten multiple to work, but i haven't given up.

If you see things wrong and figure out how to fix them like this please edit the wiki, that's why it's there :)
 
I finally got my brewpi working last night! Thanks for all the help and the wonderful guide made by fuzze. I had to use the Xloader to bipass the error in the code that fuzze posted above. After everything was properly configured I had a problem with the temp sensors. They were reading the proper values, however they weren't installing. I used the command "sudo echo 'E\n' > /dev/ttyACM0". This allowed me to install the temp sensors! Thanks again everyone.
 
Here are two pictures of my setup to maybe give others ideas.:mug:

20160207_125529.jpg


20160207_125519 (1).jpg
 
I finally got my brewpi working last night! Thanks for all the help and the wonderful guide made by fuzze. I had to use the Xloader to bipass the error in the code that fuzze posted above. After everything was properly configured I had a problem with the temp sensors. They were reading the proper values, however they weren't installing. I used the command "sudo echo 'E\n' > /dev/ttyACM0". This allowed me to install the temp sensors! Thanks again everyone.
 
Off topic but

"Sudo echo" has to be the funkiest command in Linux.






Ok, I'll see my way out.....
 
I'm having a little bit of an issue with my brewpi. I had a perfectly working brewpi setup then had to move and during the move my brewpi setup was disassembled. Somewhere in that process I had to redo all software. I have everything running but my script will random stop running which let's my beer stray away from the set point. I think it's my arduino needs to be released done. Any help would be greatly appreciated!
 
was all working fine, working GREAT, until last week, it just crapped out, script stopped

tried to reprogram Arduino and getting errors on opening serial port

Feb 08 2016 10:04:12 Errors while opening serial port:
[Errno 2] No such file or directory: '/dev/ttyACM0'
[Errno 2] No such file or directory: '/dev/ttyACM1'

ran

sudo pip install pyserial --upgrade

echo -ne 'E\n' > /dev/ttyACM0

sudo /home/brewpi/utils/fixPermissions.sh

and now getting

Feb 08 2016 10:23:02 Opening serial port
Feb 08 2016 10:23:12 Errors while opening serial port:
[Errno 13] could not oopen port /dev/ttyACM0: [Errno 13] Permission denied: '/dev/ttyACMO'
[Errno 2] could not open port /dev/ttyACM1: [Errno 2] No such file or directory: '/dev/ttyACM1'
 
Try sudo echo -ne 'E/n' > /dev/ttyACM0 and see what happens also check /dev/ when the arduino is plugged in to see if it's actually there
 
did the echo command, ttyACM0 and ttyACM1 are both in the /dev/ folder

i get
Feb 08 2016 12:59:02 Opening serial port
Feb 08 2016 12:59:12 Errors while opening serial port:
[Errno 13] could not oopen port /dev/ttyACM0: [Errno 13] Permission denied: '/dev/ttyACMO'
[Errno 13] could not oopen port /dev/ttyACM1: [Errno 13] Permission denied: '/dev/ttyACM1'

ran fixPermissions again but no joy

can run and load Blink
 
It may be worth manually setting permissions as it will let you see if there are errors. Right from the manual install instructions, the commands to run:

sudo chown -R www-data:www-data /var/www
sudo chown -R brewpi:brewpi /home/brewpi
sudo find /home/brewpi -type f -exec chmod g+rwx {} \;
sudo find /home/brewpi -type d -exec chmod g+rwxs {} \;
sudo find /var/www -type d -exec chmod g+rwxs {} \;
sudo find /var/www -type f -exec chmod g+rwx {} \;

http://docs.brewpi.com/manual-brewpi-install/setup-users-permissions.html
 
Wbarber, if he cannot acces the serial port, resetting thr EEPROM on the arduino wont do anything. It is not the magic fix for all problems and the command won't even work.

Make sure the brewpi user is added to the dialout group. Otherwise it wont have access to serial ports.

If you see acm0 and acm1, do you have two Arduino's connected? Try disconnecting and connecting only one to start
 
brewpi was in dialout group, but my main login was not. I was incorrect earlier in saying it would load blink. I could do it from Windows, but not Wheezy (I'm running VirtualBox)

so, that's now fixed

next up was bitching about python-pip and pyserial --upgrade

fixed that

now it's saying it's an old version of BrewPi, but I have the latest HEX.

it's also complaining about wlan0 not configured
 
brewpi was in dialout group, but my main login was not. I was incorrect earlier in saying it would load blink. I could do it from Windows, but not Wheezy (I'm running VirtualBox)

so, that's now fixed

next up was bitching about python-pip and pyserial --upgrade

fixed that

now it's saying it's an old version of BrewPi, but I have the latest HEX.

it's also complaining about wlan0 not configured

Don't worry about having an old version of brewpi, I believe it does that whenever you're on the legacy branch.

wlan0 is wifi, if you're on virtualbox it'll think you're hardwired, which is fine. It should work anyway. If you ever move to a real pi with a wifi adapter that error goes away.

All that said, if you're running inside virtualbox, your arduino may not show up on the default /dev/ttyACM*. If you have issues programming you may need to do some deep diving to figure out what the virtual pi sees the arduino as and change that in the config files.
 
boof me bloody

Traceback (most recent call last):
File "/home/brewpi/brewpi.py", line 629, in
bg_ser.stop()
AttributeError: 'NoneType' object has no attribute 'stop'
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 1 to reach 10.0.2.2 failed (Tue Feb 9 10:20:01 EST 2016)
Feb 09 2016 10:20:02 Opening serial port
Feb 09 2016 10:20:02 Notification: Script started for beer 'My First BrewPi Run'
Feb 09 2016 10:20:12 Checking software version on controller...
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 2 to reach 10.0.2.2 failed (Tue Feb 9 10:20:16 EST 2016)
Feb 09 2016 10:20:22 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.
ping: unknown iface wlan0
BrewPi: wifiChecker: Unable to reach router. Restarting wlan0 interface... (Tue Feb 9 10:20:31 EST 2016)
/sbin/ifdown: interface wlan0 not configured
Ignoring unknown interface wlan0=wlan0.
 
There are two different things going on there. The first is the wifi issue. See above where since you're in a virtual box you aren't really on wifi.

The second is just that whatever hex you threw on the arduino is old, or it thinks it's old. What version of the arduino code did you upload to the board?
 
I did have to change config to ttyACM1, the port used to upload blink (which is working fine now)

I started this VBox from scratch last night, manual install of BrewPi this morning, including download of brewpi-arduino-uno-revC-0_2_10.hex from GitHub
 
Disable the wifi checker by editing /etc/cron.d/brewpi
change:

entries="brewpi wifichecker"

to:

entries="brewpi ~wifichecker"

Then run updateCron.sh


[Errno 13] could not oopen port /dev/ttyACM0: [Errno 13] Permission denied: '/dev/ttyACMO'

That last digit is a letter, not a number. It should be a number zero.
 
Hi guys. I have tried to search this thread, but to no avail. Simple question: is it possible to make the Arduino Uno communicate with the web server, in my case a VM on a NAS, over ethernet rather than USB using, for instance, a Ethernet Shield W5100? My NAS is in another room and I already have RJ45 sockets in my fermentation room.
 
I did have to change config to ttyACM1, the port used to upload blink (which is working fine now)

I started this VBox from scratch last night, manual install of BrewPi this morning, including download of brewpi-arduino-uno-revC-0_2_10.hex from GitHub

Have you tried the automated installer?

The only thing i can think that you'd probably need to do to get a Automated install working as i describe on the blog is you need to create a user named pi with password raspberry.

From that error message your getting back im pretty sure your Arduino isnt even programmed.
 
what I'm trying to do, program the Arduino.

tried the automated install (I did mention this is on a PC running VirtualBox?)

oh, for ****s sake, this **** again

ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 1 to reach 10.0.2.2 failed (Tue Feb 9 16:30:01 EST 2016)
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 2 to reach 10.0.2.2 failed (Tue Feb 9 16:30:16 EST 2016)
ping: unknown iface wlan0
BrewPi: wifiChecker: Unable to reach router. Restarting wlan0 interface... (Tue Feb 9 16:30:31 EST 2016)
/sbin/ifdown: interface wlan0 not configured
Ignoring unknown interface wlan0=wlan0.
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 1 to reach 10.0.2.2 failed (Tue Feb 9 16:40:01 EST 2016)
ping: unknown iface wlan0
BrewPi: wifiChecker: Attempt 2 to reach 10.0.2.2 failed (Tue Feb 9 16:40:16 EST 2016)
ping: unknown iface wlan0
BrewPi: wifiChecker: Unable to reach router. Restarting wlan0 interface... (Tue Feb 9 16:40:32 EST 2016)
/sbin/ifdown: interface wlan0 not configured
Ignoring unknown interface wlan0=wlan0.
 
Honestly, just program the arduino on your windows machine with xloader. Use the 2.10 version of the hex. I got sick of fighting with the web programming interface and the xloader method works great. Will help you avoid any other complications from the virtualbox setup.
 
To fix Brewpi so that you can flash the hex you need to edit /home/BrewPi/BrewPi.py
Goto Line 636 (which should be bg_ser.stop(), delete the entire line
Save the file...

THANK YOU!!!! SO much frustration lifted. :mug:
 
[...]I'll talk to Elco about fixing the bug so future people wont have to do this and the updating to legacy script that programs should then work for future people, but if your in a hurry to get it working do that :)

Has Elco followed up with you on this yet?

Cheers!
 
Just setup the BrewPi entirely in a Virtualbox running Wheezy with little trouble using the automated installer. I documented the few changes required to get it to work such as installing git on the Wiki. Now there should be no issues getting new systems up regardless, unless your charting into the multiple chamber off one RPI territory.

BrewPi-VirtualBox.png
 
Hi guys. I have tried to search this thread, but to no avail. Simple question: is it possible to make the Arduino Uno communicate with the web server, in my case a VM on a NAS, over ethernet rather than USB using, for instance, a Ethernet Shield W5100? My NAS is in another room and I already have RJ45 sockets in my fermentation room.

Get a usb cable and an rj45 cable. Cut both in half. Solder and heat shrink the 4 wires in the usb cable to 4 wires in the cat5/6 cable, cut the other 4 short. Go into the other room and connect those same 4 usb wires to the same colored cat5/6 colored wires from the first time. Now you have 2 usb to rj45 cables. I've done this with a 20' long cable. Not sure what the max distance is.
 
Get a usb cable and an rj45 cable. Cut both in half. Solder and heat shrink the 4 wires in the usb cable to 4 wires in the cat5/6 cable, cut the other 4 short. Go into the other room and connect those same 4 usb wires to the same colored cat5/6 colored wires from the first time. Now you have 2 usb to rj45 cables. I've done this with a 20' long cable. Not sure what the max distance is.

Uhm you cant just connect a USB cable to ethernet like that. Your basically just making a USB cable with a Ethernet connector on the end, or an ethernet cable with a USB cable on the end. They are two totally different standards..
 
Status
Not open for further replies.
Back
Top