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.
finally got web access working! imaged over a clean raspbian install one more time and used nano instead of vi for all the editing. not exactly sure what the issue actually was. but my public page isn't updating the readout. any ideas there? copied the contents from fuzze on page 9.

http://hermanbrew.duckdns.org/public.php
 
Does anyone know how to change pin assignments in the .h files I've gotten close to what I need, but I'm no coder. I found a relay shield at RadioShack that I've been doing my testing with. Only problem is it uses pins 4 5 6 and 7 for actuators and I'd like to move my door switch to a pin other than d4.

ImageUploadedByHome Brew1405356406.027669.jpg
 
Error opening serial port: could not open port /dev/ttyATCM0: [Errno 13] Permission denied '/dev/ttyATCM0' .

I had already changed ownership of /dev/ttyATCM0 to brewpi:

rob@fermtemp:~$ ls -l /dev/ttyA*
crw-rw---T 1 brewpi brewpi 166, 0 Jul 14 12:36 /dev/ttyACM0


My Arduino has steady green light and flashing yellow light. I tried three different USB ports on the PC with the same result.

What am I missing here?
 
Does anyone know how to change pin assignments in the .h files I've gotten close to what I need, but I'm no coder. I found a relay shield at RadioShack that I've been doing my testing with. Only problem is it uses pins 4 5 6 and 7 for actuators and I'd like to move my door switch to a pin other than d4.

View attachment 211091

You can assign whatever function you like to pins 2,4,5,6 in the Device Configuration page.

The defaults there are merely suggestions.
 
Not when I try all I get available to set up are A0 A1 A2 A3. Which is retarded. Then if I try to setup those devices anyway they will not let me setup a function. My only option so far has been to remove the shield and run leads from D2 on the arduino to d7 on the relay shield and so on and so fourth. Another thing I can't understand is why A5 is setup as an actuator. If I was going to use all 4 relays (and I still might) I would use 4 digital pins and besides A5 is supposed to be setup for 1wire I thought.
 
Error opening serial port: could not open port /dev/ttyATCM0: [Errno 13] Permission denied '/dev/ttyATCM0' .

I had already changed ownership of /dev/ttyATCM0 to brewpi:

rob@fermtemp:~$ ls -l /dev/ttyA*
crw-rw---T 1 brewpi brewpi 166, 0 Jul 14 12:36 /dev/ttyACM0


My Arduino has steady green light and flashing yellow light. I tried three different USB ports on the PC with the same result.

What am I missing here?

Did you edit your config file?
It shows that its trying to access ATCM0 which isnt a thing. It should be ACM0.
 
Did you edit your config file?
It shows that its trying to access ATCM0 which isnt a thing. It should be ACM0.

That's a typo. I couldn't copy and paste, so I tried to do it from memory. That issue was solved by logging in as brewpi. Now I'm getting line 620 error in /home/brewpi/brewpi.py, lines 71 and 45 in /home/brewpi/programarduino.py

Is there a browser better than Iceweasel that will let me copy brewpi messages and paste them here?
 
Okay, Chromium was better for copy and paste. These are the errors I get:

**** Arduino Program script started ****

Traceback (most recent call last):
File "/home/brewpi/brewpi.py", line 620, in
{'settings': restoreSettings, 'devices': restoreDevices})
File "/home/brewpi/programArduino.py", line 71, in programArduino
boardsFile = loadBoardsFile(arduinohome)
File "/home/brewpi/programArduino.py", line 45, in loadBoardsFile
return open(arduinohome + 'hardware/arduino/boards.txt', 'rb').readlines()
IOError: [Errno 2] No such file or directory: '/usr/share/arduino/hardware/arduino/boards.txt'
Jul 14 2014 13:30:02 Notification: Script started for beer 'My First BrewPi Run'
Jul 14 2014 13:30:29 Warning: Cannot receive version number from Arduino. Your Arduino is either not programmed or running a very old version of BrewPi. Please upload a new version of BrewPi to your Arduino.
 
I created an empty boards.txt and assigned ownership to brewpi. Progress:

**** Arduino Program script started ****

Settings will not be restored

Devices will not be restored

Checking old version before programming.

Warning: Cannot receive version number from Arduino. Your Arduino is either not programmed yet or running a very old version of BrewPi. Arduino will be reset to defaults.

Loading programming settings from board.txt

Checking hex file size with avr-size...

avr-size error: /bin/sh: 1: avr-size: not found


Jul 14 2014 14:22:46 New program uploaded to Arduino, script will restart
Jul 14 2014 14:22:51 Notification: Script started for beer 'My First BrewPi Run'
Jul 14 2014 14:23:19 Warning: Cannot receive version number from Arduino. Your Arduino is either not programmed or running a very old version of BrewPi. Please upload a new version of BrewPi to your Arduino.


Okay, these are the errors you get if you neglect to install arduino-core like a *******
I was blowing through the install to get the web interface up because I didn't have all my parts. Bad move. Very bad.

Maybe someone else can be saved from wasting half a day.
 
Does anyone know how to change pin assignments in the .h files I've gotten close to what I need, but I'm no coder. I found a relay shield at RadioShack that I've been doing my testing with. Only problem is it uses pins 4 5 6 and 7 for actuators and I'd like to move my door switch to a pin other than d4.

I believe all of the pin assignments are in Pins.h

https://github.com/BrewPi/brewpi-avr
 
[...]Okay, these are the errors you get if you neglect to install arduino-core like a *******

I was gonna say there was a library missing :D

Maybe someone else can be saved from wasting half a day.

Perhaps, though if past is prologue folks will keep coming up with unique ways to break their installations.
So far, aside from the typical permissions/ownership thing, I haven't seen many repeats...

Cheers!
 
I believe all of the pin assignments are in Pins.h

https://github.com/BrewPi/brewpi-avr

never mind I was looking in the wrong place. Apparently I was experiencing a bug. Elco put me on the right path and I reconfigured my whole pinout using his advice.

Ah, that is a bug! You should be able to pick more functions for the door pin.

For a quick fix for you, change this line:

https://github.com/BrewPi/brewpi-script/blob/master/pinList.py#L47

Change:

{'val': 4, 'text': ' 4 (Door)', 'type': 'door'},
to

{'val': 4, 'text': ' 4 (Door)', 'type': 'free'},
Then restart your script and see if the web interface gives you more options.

While i was in there I messed around with all my pins and got my relay shield working. I also use the proto shield they have at radioshack its been a dream when it comes to using an arduino for the first time ever.

July 14, 2014 at 0609PM.jpg


IMG_9110.jpg
 
Ok I wired mine up today and this may be a stupid question, but why is there not a data wire going into the arduino from each thermoprobe. They both meet and then go into the unit as one right?
 
is this normal?

I put in the command:

pi@raspberrypi /usr/sbin $ sudo apache2ctl -k graceful

and get this

apache2: Syntax error on line 268 of /etc/apache2/apache2.conf: Syntax error on line 31 of /etc/apache2/sites-enabled/000-default: </VirtualHost> without matching <VirtualHost> section
Action '-k graceful' failed.
The Apache error log may have more information.
 
Nope, that's Abby Normal.

When you edited /etc/apache2/sites-available/default you bodged the first line, which should look something like this:

<VirtualHost *:80>

Cheers!
 
Now I wish I had bought at least 1 temp probe from a us retailer. I have everything else figured out and ready to go. USPS says it'll be 2 more days it feels like forever. I'm gonna do it right though I'm brewing this weekend and kludging together the beginnings of my brewpi. I'm gonna go hard and test it out for the first time with wort. Hopefully nothing bad happens…
 
Now I wish I had bought at least 1 temp probe from a us retailer. I have everything else figured out and ready to go. USPS says it'll be 2 more days it feels like forever. I'm gonna do it right though I'm brewing this weekend and kludging together the beginnings of my brewpi. I'm gonna go hard and test it out for the first time with wort. Hopefully nothing bad happens…

I would advise against that ;) Atleast run a profile on some water for 8-12 hours to make sure it does what it should without crapping out.
 
I've been building out my eHERMS system since September. I've made 3 beers since then. I'm ready to go into full production. I have 4 empty fermenters and 6 empty kegs. I can't wait any longer
 
Doing a test on cooling down a carboy of hot water. About every 2-3 hours the script stops running because it gets permission denied on /dev/ttyACM0. Each time I SSH in and do a "sudo chown brewpi: /dev/ttyACM0". Script starts back up, but only for a few hours.

How does one get past accessing the port when root wants to be a pushy ***** and keep claiming ownership? Something else I didn't install?:drunk:
 
Doing a test on cooling down a carboy of hot water. About every 2-3 hours the script stops running because it gets permission denied on /dev/ttyACM0. Each time I SSH in and do a "sudo chown brewpi: /dev/ttyACM0". Script starts back up, but only for a few hours.

How does one get past accessing the port when root wants to be a pushy ***** and keep claiming ownership? Something else I didn't install?:drunk:

I'm going to go with "probably" ;)

Obviously, that behaviour is whacked. I'm wondering if the 2-3 hour period is related to the BrewPi script running from /etc/cron.d/brewpi that checks to see if the brewpi runtime script is already running, restarting if not.

Could you post the brewpi log file leading up to one of these events?

Cheers!
 
ok got that fixed. had an "a" sitting in front of my script. now

I put in the command:

pi@raspberrypi /usr/sbin $ sudo apache2ctl -k graceful

and get this

apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

and this on my site I'm trying to send it to:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Apache/2.2.22 (Debian) Server at xxxxxxxxxx.com Port 80
 
I'm going to go with "probably" ;)

Obviously, that behaviour is whacked. I'm wondering if the 2-3 hour period is related to the BrewPi script running from /etc/cron.d/brewpi that checks to see if the brewpi runtime script is already running, restarting if not.

Could you post the brewpi log file leading up to one of these events?

This is the first few lines of stderr.txt. The lines beginning "error opening" repeat about 20 times before the script exits.

Jul 14 2014 17:15:09 Fresh start! Log files erased.
Traceback (most recent call last):
File "/home/brewpi/brewpi.py", line 674, in <module>
ser.write('l')
File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 485, in write
raise SerialException('write failed: %s' % (v,))
serial.serialutil.SerialException: write failed: [Errno 5] Input/output error
Jul 14 2014 17:50:01 Error opening serial port: could not open port /dev/ttyACM0: [Errno 13] Permission denied: '/dev/ttyACM0'. Trying alternative serial port /dev/ttyACM0.
Jul 14 2014 17:50:01 Error opening alternative serial port: could not open port /dev/ttyACM0: [Errno 13] Permission denied: '/dev/ttyACM0'. Script will exit.
 
About all I can figure out is that line 674 of brewpi.py is the brewpi host asking the arduino for LCD text update, so it's sending an "l" out the serial port. Which apparently returned an exception. What isn't obvious is the permissions thing being the cause or the effect.

If you're seeing lots of communication dialog in the Maintenance Panel log display in between these events I would be tempted to bin this to a sudden USB failure causing the OS to yank the port out of service. Are you using a hub or directly attaching your Arduino board to your peecee?

Cheers!
 
This is the first few lines of stderr.txt. The lines beginning "error opening" repeat about 20 times before the script exits.

Jul 14 2014 17:15:09 Fresh start! Log files erased.
Traceback (most recent call last):
File "/home/brewpi/brewpi.py", line 674, in <module>
ser.write('l')
File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 485, in write
raise SerialException('write failed: %s' % (v,))
serial.serialutil.SerialException: write failed: [Errno 5] Input/output error
Jul 14 2014 17:50:01 Error opening serial port: could not open port /dev/ttyACM0: [Errno 13] Permission denied: '/dev/ttyACM0'. Trying alternative serial port /dev/ttyACM0.
Jul 14 2014 17:50:01 Error opening alternative serial port: could not open port /dev/ttyACM0: [Errno 13] Permission denied: '/dev/ttyACM0'. Script will exit.

Any intermittent issues with ACM0 like this are because of a bad USB connection.

Either your cable is super long, your USB cable is too close to your power cables, your USB port on your PC sucks or a list of other things. I saw this quite a bit when i was using a PC with a longish(3 feet) USB cable, but never when using a RPI.

I suggest powering your Arduino via external power and or buying a USB cable with a ferrite choke/bead on it to prevent this external noise from bringing down your USB connection.

Its basically electrical noise getting onto your USB cable, killing power to it and then BrewPi tries to read it and its not there anymore...then it comes back up a few seconds later and keeps doing its thing.

External power may be your best option, its possible the USB port is just crap and not capable of supplying constant power that the Arduino needs.
 
The Arduino is connected directly to the PC USB. I had the problem with the 1-foot USB cable that came with the the board, and also with a longer cable I needed to put it in service. Also been through about three of the PC's six ports. External power is doable, I'll give that a try.

But why would a hinky USB port cause the ownership of /dev/ttyACM0 to change from brewpi to root?
 
I could be totally wrong but I believe that happens when the OS detects what it believes is an unrecoverable device error and stuffs the device in the "Shall Not Be Used Bin".

Definitely try powering the Arduino card from something other than a powered host or hub and see if the bad behavior resolves. I use 9VDC wall warts on my Unos even though they're plugged into a powered hub and they've been freakishly stable for months now...

Cheers!
 
Got bored tonight, decided to revisit getting BrewPi to run on an AlaMode card connected to my development 'Pi while the two Unos continue running via USB. I cloned one of the setups for my two Unos which made adding yet another BrewPi instance a piece of cake, just had to edit folder and file pointers and change the device name from a virtual USB port to the serial port connection.

And it came up running! Except the temperature probes kept coming and going, coming and going...ad infinitum. "WTF, over?"

I dug into the schematics for the Uno and the AlaMode and discovered the AlaMode essentially ties the AVR pin for AD4 to the Raspberry Pi I2C SDA signal - which is also connected to the Real Time Clock chip on the AlaMode. So while the AVR is trying to use its AD4 pin for the One Wire bus, the 'Pi is using its wire to talk to the RTC chip.

Damn.

I could bend the AVR chip pins outward so they are outboard of the IC socket and wire them to my One-Wire bridge cards, but I don't need to get this working that badly. When R'Pints V2 comes out the AlaMode will be dedicated to running the flow meter sketch and won't have room to run BrewPi anyway.

Short of asking the BrewPi folks to spin a sketch that uses different AVR pins for the One-Wire stuff this otherwise pretty elegant solution is a No Go...

Cheers!
 
Regarding USB, I continue to use ancient and venerable (?) dell lappy instead of rpi and when I switched from standard USB to choked USB cable, things got...better but not perfect. Moving power wires around helped some more. The clincher was providing power to arduino separately--after all those things, it ran great for weeks, until thunderstorms shut power to whole house down, but I'll work on the patented Gen-Beer-Ator later:) .
 
Depending on what you are trying to do. Look for pins.py You may need to make some changes to pins.h in the source code in atmel studio. I just had a similar problem over the weekend trying to get my relay shield setup because it uses different pins than the revc shield.
 
Regarding USB, I continue to use ancient and venerable (?) dell lappy instead of rpi and when I switched from standard USB to choked USB cable, things got...better but not perfect. Moving power wires around helped some more. The clincher was providing power to arduino separately--after all those things, it ran great for weeks, until thunderstorms shut power to whole house down, but I'll work on the patented Gen-Beer-Ator later:) .


My setup is dellappy also. Lol. Not running external power as yet but left the arduino power port clear in case of power issue. Maybe I have one one the few magic usb leads.


Sent from my iPhone using Home Brew
 
Status
Not open for further replies.
Back
Top