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.
Attach ssr to arduino and follow the installation instructions on brewpi.com
 
Just wanted to check. I have everything hooked up except the 120V parts to the relay. I thought I had an extra outlet around, but no go. I would think this only needs to be wired to the 120v to test the solinoids and the outlets not to test the temp sensors. When I pull this up on a LAN web page I get BrewPi reporting for duty. I have downloaded the brewpi-uno-revC.hex into the SaniSmart UNO. The progress window had a lot of stuff go through it. I read down the script and I would have to say that it loaded correctly. I did not see any error lines in it.

Then Under the Maintenence Panel, select Device Configuration and I Check Read Values, and press the Refresh Select Device button in the script panel I get the following message:
No installed devices found
Parsing available devices
Device list updated for Arduino standard with a revC shield

I have double checked all of the wiring. I tested senor wires and they are correct per the vendor I got them from.
Output lead:red (VCC), yellow(DATA) , black(GND)

I took it apart and tested every wire for continuity. They all tested fine. I put them all back together again and I still get the same "No device installed".

I thought it might be the connection from the wire to the male or female pin, so I test for continunity from the bottom of the Uno to the bottom solder pins of the relay.

I have the 4.7k resistor wired between the 5v to the data wires.

And still nothing. I'm running out of ideas. Here is a picture of the wiring.

20140814_153153.jpg
 
When u say you get continuity do you mean u tested for continuity and you got continuity by way of an audible beep? Because that's not good. You should be testing for ohms, not continuity. And in continuity mode you should have a reading of resistance but it will not beep reading full continuity.
 
But since it doesn't appear to have caused a short I'd give swapping the a4 and 5v pins and see if that helps. I personally have not really noticed if it matters, being one-wire and all, but when you programmed the uno, did you have the temp probes attached? Also you should see at least 5 devices under detected no matter what, since the actuator pins are hard coded into the arduino from the hex file. Those same pinouts are manipulated by pins.py in /home/brewpi/
 
Maybe I have my terms mixed up. When I put the selector to 2k and touch the two leads together the reading goes down to .000 from 1. The reading does the same thing when I put the lead on the opposite ends of the same wires.
 
No you should be checking the wires from the temp probe put the lead attached to (on min far right) ohms to what you assume is ground and the other lead (common) on one of the other wires. You should get a value somewhere between .45 and .80. If you don't get any reading then the wire they told you is ground is not ground. Once you figure out which one is ground then it's just a matter of flipping the other 2 between 5v and data until it works.
 
I'll switch the 4A and the 5v wires and see what that does.

I did the test you wrote on here about testing the wires. The black one was the ground and between the other two the red one had a higher value, so I used that one for the 5v and the lower one for the data.
 
But as I said you should have actuators showing up under detected devices if you haven installed them already
 
None of the BrewPi "actuators" are actually detected, they are all coded to appear automagically in the Detected Device list as a quasi-standard configuration. There's no mechanism for the Arduino to detect an opto-coupler on a relay card, for example, or the input to an SSR.

In any case, no devices will ever appear in the "Installed" list until they are configured...

Cheers!
 
Just wanted to check. I have everything hooked up except the 120V parts to the relay. I thought I had an extra outlet around, but no go. I would think this only needs to be wired to the 120v to test the solinoids and the outlets not to test the temp sensors. When I pull this up on a LAN web page I get BrewPi reporting for duty. I have downloaded the brewpi-uno-revC.hex into the SaniSmart UNO. The progress window had a lot of stuff go through it. I read down the script and I would have to say that it loaded correctly. I did not see any error lines in it.

Then Under the Maintenence Panel, select Device Configuration and I Check Read Values, and press the Refresh Select Device button in the script panel I get the following message:
No installed devices found
Parsing available devices
Device list updated for Arduino standard with a revC shield

I have double checked all of the wiring. I tested senor wires and they are correct per the vendor I got them from.
Output lead:red (VCC), yellow(DATA) , black(GND)

I took it apart and tested every wire for continuity. They all tested fine. I put them all back together again and I still get the same "No device installed".

I thought it might be the connection from the wire to the male or female pin, so I test for continunity from the bottom of the Uno to the bottom solder pins of the relay.

I have the 4.7k resistor wired between the 5v to the data wires.

And still nothing. I'm running out of ideas. Here is a picture of the wiring.

You probably have it setup properly as it is. When you hit refresh scroll down and it should list DETECTED devices. If you checked read values you should have two that have a value in celcius(like 17-21C at room temp). Those are your two probes.

Assign them to a chamber and a beer, then decide pick one(doesnt matter) to be your beer and one to be your fridge ambient temp. You'll have to figure out which is which with some water or just hold one between your fingers for 20S and see which one is warmer.

Then find the devices that are listed as Arduino Pin 5(Act2) and Pin 6(Act1). These are your hot and cold, again assign them to a chamber and beer. Then click invert for both(if you followed my schematic) and assign one to chamber heater and chamber cooler. Again when you wire up your plug you'll have to test to figure out which is which.

Also make sure to hit apply after you set up each device.

The message your seeing is the standard message you get when on a fresh install, your just getting the term Installed Devices confused with Detected. All of your things are detected and dont show up under Installed until you add them yourself.
 
Thanks for your help wbarber69. Sorry to have waisted you time.

For me trying to do electronic stuff on a normal basis is challenging. It's a love/hate relationship. Add to that getting home from work this AM and going right into this and working on my WiFi, RaspberryPints and Modem is a recipe for disaster. Nothing seems to be easy or if it is I must have done something wrong. I just make it too complicated. Looking back on it this was easy and I was too ignorant to see it. I had the wires hooked up correctly the first time. I saw the No installed devices and thought something was wrong. I did see temp sensors under the Detected devices. When I switched the yellow and red wires the temp sensors detected went away. I have everything back the way it was. Moving those wires did assure me that everything was hooked up correctly the first time. That was a long time consuming lesson.

I was holding the sensors looking for a change in the reading and did not see anything, so I assumed something was wrong. It had to be it was too easy.

I wanted to try and figure out the "problem" by doing research on this site and others. How else am I going to learn.

FuzzeWuzze did a good write up. When he says. When you do so a big list of devices will show up under Detected Devices. Don't go looking for Installed devices.

I've been going through a place online C_o d e A_c a d e m y tutorilas tyring to lean a little about coding (Python). It's a work in progress since I have not grown up with coding.

Thanks again for all the help.

Now, time to go drown my sorrows in multiple glasses of homebrew, floating in the pool and licking my **** like a dog. No offence to dogs I have two dogs.
 
Hey everyone. It's been a few days since I've posted here. I finally got things mostly squared away.

Thank you to MongooseMan, Geo, and Elco for being kind enough to chat with me and help me solve these issues. I never would have been able to figure it out.

If anyone ever has issues with Ubuntu or interference, and finds this post, I'll try to write about my experience to hopefully help out.

I had an older version of Ubuntu installed on my netbook and BrewPi was working for the most part. At midnight, when the script (?) creates a new JSON file, it would completely corrupt my charts. I decided to remove my linux partition and start again. This installed the latest Ubuntu and it was not functioning with BrewPi. After speaking with Elco, he recommended either I install Debian, or try the manual install. I install Debian and it has been working for a few days without chart issues.

I also had interference issues. I tried ferrite beads, and coiling my cables, but nothing seemed to work. It seems my laptop charger was emitting too much interference. My last resort was to power the Arduino externally, but I have read on this forum that people tried it with little success. Then I came across the post below:

Everyone who said the cable was right.

As a temporary fix, I took the USB cable, wound and ziptied it, wrapped it in some aluminum foil to block interference and covered with electrical tape so it wouldn't short anything.

It's been up now for 12+ hours with zero issues.

I had a very long USB cable hooked up from my netbook to my Arduino, so I coiled it up, and wrapped it in aluminum foil. I also had my netbook charger coiled around a ferrite bead like a toroid. I wrapped the ferrite bead and transformer in aluminum foil as well. My BrewPi logs haven't shown the "temp sensor disconnected" error message in over an hour and I've tried provoking it by turning the relay on. I think it drastically reduced the interference. I was initially concerned that I would trap heat in the foil around the laptop transformer but I wrapped it tightly and I believe it will act as a heat sync and actually drive away some of the heat. Still, I will be monitoring it for the next few hours.

I hope this helps someone, rather than just be a useless rant.

Once again thank you to all that helped me along the way. I still have to monitor it to make sure all my problems are gone, but it hasn't worked this well since I started.
 
My turn to join the fray, and of course I must begin by expressing my gratitude to FuzzeWuzze for tackling this. Much appreciations, sir!

I have built this up using an old Acer laptop running Wheezy and all the BrewPi components. I use a Sainsmart Uno, Sainsmart dual relay board, some DS temp probes, and have it all wired up on a breadboard for testing. My heater and fridge are just LEDs connected to the relays (for now).

Breadboard photo and wiring diagram attached.

The good news (for me) is that it almost all works. Brewpi is happy, the sensors are sensing, the Uno is responding as expected and the configuration went as planned.

The bad news is that one thing isn't working and I can't figure out why. The relay board never gets a signal to 'turn on' the fridge or heater LEDs. I can manually short the inputs to ground to force the relay board to turn them on, so I know the relay board works, but the Uno doesn't seem to send them any such signal.

Any idea on how I can troubleshoot this? I'm an electronics guy but just barely handy enough with Linux to get all this running.

Cheers.

..tj

breadboard1.jpg


ARDUINO.gif
 
You see where brewpi says idling. In the lcd status display in the webui. If it never leaves idle then you may not have it set to change the temperature or you haven't set it low enough to decide to turn on. If you can invert the pins and cause the led to light up, then it's all functioning as it should. Go to fridge constant and turn it down to like 10-15 degrees lower than room temp. Then it will take somewhere around 10 minutes for it to turn on sometimes. It'll say "wait to cool" or "wait to heat" or "waiting for peak". Then after the time or conditions have been met it should click on.
 
Thank you, wbarber69.

Where can I find some docs about how to run the software? I searched all over Brewpi website and all I can find is install and configuration docs, nothing about how to run the software. I must be blind.

..tj
 
Right under the graph there are tabs for profile beer constant and fridge constant. You can either enter the settings or use the arrows to increase or decrease the setting. Then hit apply when your ready and it will start up.
 
And it shouldn't be a problem, but until your sure everything is working as it should I wouldn't share the arduinos ground with the live current ground. There shouldn't be any problem with it but if something were to rattle loose you could potentially have live current trace back through your arduino and potentially into the laptop. The reason you see all those little chips on the relay board between the arduino pins and the relays themselves is because the relays are opto-coupled to the arduino in this configuration. Essentially controlling the relays with a tiny beam of light instead of an actual wire to wire contact. Preventing any possible high current voltage to trace back to the arduino. and what you've done has potentially circumvented that safety mechanism.
 
I wanted to share some data now that this got me thinking about it. Earlier when I mentioned using multiple arduinos with 1 8-relay board. We discussed sharing a common ground between arduinos. I've found that it doesn't mean that we need to connect each arduinos grounds together. As long as they are all hooked up to the same pc, they share ground over USB. So no additional wires are needed to make it work. In fact I'm controlling one board with 4 arduinos attached to 4 separate ds2413s. With only 1 sending 5v and ground to the relay board. No extra parts are needed. I bought the adafruit ds2413 breakout boards. And hooked io pins directly to the relay board. Simple and it works with brewpi without altering anything but 2 lines in the hex file.
 
Got a late package today! My reversing driver board for an old laptop screen. ImageUploadedByHome Brew1408152404.833942.jpg
 
My turn to join the fray, and of course I must begin by expressing my gratitude to FuzzeWuzze for tackling this. Much appreciations, sir!

I have built this up using an old Acer laptop running Wheezy and all the BrewPi components. I use a Sainsmart Uno, Sainsmart dual relay board, some DS temp probes, and have it all wired up on a breadboard for testing. My heater and fridge are just LEDs connected to the relays (for now).

Breadboard photo and wiring diagram attached.

The good news (for me) is that it almost all works. Brewpi is happy, the sensors are sensing, the Uno is responding as expected and the configuration went as planned.

The bad news is that one thing isn't working and I can't figure out why. The relay board never gets a signal to 'turn on' the fridge or heater LEDs. I can manually short the inputs to ground to force the relay board to turn them on, so I know the relay board works, but the Uno doesn't seem to send them any such signal.

Any idea on how I can troubleshoot this? I'm an electronics guy but just barely handy enough with Linux to get all this running.

Cheers.

..tj

I cant tell how you have your relay wired, can you get a better shot?

My guess is you didnt click the Invert button in the device configuration for your relays. If you wire it to the same pins i did you need to Invert the pins.
 
Right under the graph there are tabs for profile beer constant and fridge constant. You can either enter the settings or use the arrows to increase or decrease the setting. Then hit apply when your ready and it will start up.

Actually, the question was where can I find some documentation for all of these brewing parameters. Maybe it's in there with the installation instructions and I just haven't found it.

I wouldn't share the arduinos ground with the live current ground. ... The reason you see all those little chips on the relay board between the arduino pins and the relays themselves is because the relays are opto-coupled to the arduino in this configuration.

I'm an old-school electronics guy. (I design retro audio/guitar amplifiers) I didn't realize those relays were opto-coupled, in fact I didn't even think about that. Anytime I see a board with line voltage on it, I automatically want it grounded to earth. But yeah, not needed here. Thanks! :mug:

..Todd
 
Brewing parameters? Basically brewpi will calculate all the algorithms . You shouldn't really need to change anything unless your unhappy with the results. But if you need more info there are forums overview at brewpi.com that can help you more. Also a brewpi ask site. And a wiki page.
 
I cant tell how you have your relay wired, can you get a better shot?

My guess is you didnt click the Invert button in the device configuration for your relays. If you wire it to the same pins i did you need to Invert the pins.

The diagram shows how its wired.

And you're probably right about the inverting parameter. I thought of that, but I didn't see any documentation mention configuring the the relay board or Uno outputs at all, only the inputs, so I didn't even know they need configuration in the device manager.

Thanks folks, I have plenty of things to look into now.

..tj
 
Brewing parameters? Basically brewpi will calculate all the algorithms . You shouldn't really need to change anything unless your unhappy with the results. But if you need more info there are forums overview at brewpi.com that can help you more. Also a brewpi ask site. And a wiki page.

I haven't found a wiki page, unless it's the docs page. There's no link to one on Brewpi.com, at least not in their site's menu. I know where docs, ask and forum.brewpi.com is. But the docs page is exclusively hardware (including fridges), OS and Brewpi software installation instructions. No user guide.

I suspect this info is mixed into the installation instructions and I've missed it.

..tj
 
I cant tell how you have your relay wired, can you get a better shot?

Oh wait, did you mean the LEDS? They work fine and are really straightforward, just a current limit resistor, 9v battery and the relay switch. They trigger fine if I force their input LOW.

..tj
 
There. Got it. I just didn't have the UNO outputs configured as heater and cooler. Thanks everyone.

Also updated the diagram to remove that power ground.

Time to get a project box and do it up right.

..tj

ARDUINO.gif
 
Banging my head against the wall for 2 days. Trying to get more than one instance if the brewpi script to start up. Followed the documentation. Looked for all the problems found on the forum already. Started over following the documentation very closely. I'm even using the same folder names and everything. Cannot get another instance to start it says this script is already running and the current instance will now exit. I can figure out what I'm missing.
 
Wait - I thought you had four Unos running? Is this a new problem?

I used the multiple manual install mode after setting up the USB port definitions. I may be able to pull together a soup-to-nuts "how to" if needed...

Cheers!
 
Give this a look, it's what I used while connecting two Unos via a USB hub plus the AlaMode shield via serial port. I'm pretty sure everything is in there but it's definitely a mixture of cut'n'paste from the BrewPi site and my own thinking out loud as I went along. You'll have to cope with the latter ;)

Cheers!

Note: the script assumes the default RaspberryPi user name is 'pi'.
If you chose a different user name be sure to change all pertinent instances of 'pi' to your actual default user name.

Also, be sure to set the system date/time before the apt-get commands as otherwise security certificate errors may occur (security certificates are time sensitive).

=================================================
Multiple Arduino BrewPi Installation (2 USB, 1 Serial)

1.1.1. Determine the USB hub port identifiers
With only one Arduino connected, issue the following command to see which device node the Arduino is currently using:

$ ls /dev/ttyACM*

/dev/ttyACM0

$ udevadm info -a -n /dev/ttyACM0 | less

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)" (note the section for the Uno)

move Arduino to next USB port and repeat
KERNELS=="1-1.3.3"


1.1.2. Write the udev rules
Now that the identifier for each USB hub port has been obtained, the udev rules can be written.

KERNELS=="1-1.3.4" [Port 1]
KERNELS=="1-1.3.3" [Port 2]

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

SUBSYSTEM=="tty", KERNEL=="ttyACM*", KERNELS=="1-1.3.4", SYMLINK+="brewpi1"
SUBSYSTEM=="tty", KERNEL=="ttyACM*", KERNELS=="1-1.3.3", SYMLINK+="brewpi2"

[My third AVR is actually an AlaMode shield and connects via the RPi serial port so the above doesn't apply]


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

$ sudo /etc/init.d/udev reload


1.2. Install BrewPi

Install the BrewPi script and web interface manually as described in the manual installation process, noting the following changes:

$ git clone brewpi-script into subdirectories of /home/brewpi instead of directly into /home/brewpi.
[I used /home/brewpi/brewpi1, /home/brewpi/brewpi2 and /home/brewpi/brewpi3]

$ git clone brewpi-www into subdirectories of /var/www instead of directly into /var/www.
[I used /var/www/brewpi1. /var/www/brewpi2 and /var/www/brewpi3 to match each script installation directory]

Fix the permissions manually.

UNTESTED alternative to manual permission editing:
It looks like utils/fixPermissions.sh should work when run from each script instance
[My note: this does indeed work - and the per-instance execution is shown in Step 3 further along in this script where they belong]

If you have other content in /var/www, you will likely want to update webPath in fixPermissions.sh
to the directory of the corresponding web interface instance.

Do not use utils/updateCron.sh or the cron job string in the manual installation instructions.
Instead follow the directions in the cron section below.

INSTALLING BREWPI:

Backup RPints files:

backed up /var/www to /var/www_backup
backup up /var/www/index.php to rpints_index.php

Update all packages:

$ sudo apt-get update
$ sudo apt-get upgrade (FINALLY completed)

rebooted

Install missing PHP5 packages:

$ sudo apt-get install php5-cgi

Install missing MYSQL packages:

$ sudo apt-get install libapache2-mod-auth-mysql

Install missing PYTHON packages:

$ sudo apt-get install python-serial python-simplejson python-configobj python-psutil python-git

rebooted


3. Setting up users and permissions

Create user brewpi and group brewpi

$ sudo useradd -m -k /dev/null -G www-data,dialout brewpi
$ sudo passwd brewpi (set password = xxxxxxx)

Check brewpi rights

$ id brewpi

uid=1001(brewpi) gid=1004(brewpi) groups=1004(brewpi),20(dialout),33(www-data)

Add user pi to www-data and brewpi group

$ sudo usermod -a -G www-data pi
$ sudo usermod -a -G brewpi pi

NOTE: If you get the error "usermod: user 'pi' does not exist" then add user 'pi' then execute the usermod commands.

$ adduser pi
$ passwd pi (set the password twice)



Set the ownership of all files and subdirectories to brewpi and www-data (first two lines)
Give the group all permissions on all files (third and fourth line)
Give the group all permissions and set the sticky bit on all directories (fifth and sixth line).

$ 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 {} \;

4. Installing BrewPi
4.2.1. Cloning the remote repository

For BrewPi1:
$ sudo -u brewpi git clone https://github.com/BrewPi/brewpi-script /home/brewpi/brewpi1

For BrewPi2:
$ sudo -u brewpi git clone https://github.com/BrewPi/brewpi-script /home/brewpi/brewpi2

For BrewPi3:
$ sudo -u brewpi git clone https://github.com/BrewPi/brewpi-script /home/brewpi/brewpi3


4.3. The web interface: brewpi-www
4.3.1. Cloning the remote repository

Target www directory should be empty (automatic installer may delete it!)

$ sudo -u www-data git clone https://github.com/BrewPi/brewpi-www /var/www/brewpi1
$ sudo -u www-data git clone https://github.com/BrewPi/brewpi-www /var/www/brewpi2
$ sudo -u www-data git clone https://github.com/BrewPi/brewpi-www /var/www/brewpi3

4.3.3. Fixing permissions after git commands

Edit the fixPermissions script in each BrewPi instance to match up with its path:


$ sudo nano /home/brewpi/brewpi1/utils/fixPermissions.sh

change webPath to point to subordinate brewpi1 folder:

webPath="/var/www/brewpi1"

Save the file and exit


$ sudo nano /home/brewpi/brewpi2/utils/fixPermissions.sh

change webPath to point to subordinate brewpi2 folder:

webPath="/var/www/brewpi2"

Save the file and exit


$ sudo nano /home/brewpi/brewpi3/utils/fixPermissions.sh

change webPath to point to subordinate brewpi3 folder:

webPath="/var/www/brewpi3"

Save the file and exit



Then execute each of the bash scripts:

$ cd /home/brewpi/brewpi1/utils
$ sudo bash fixPermissions.sh (for BrewPi1)

$ cd /home/brewpi/brewpi2/utils
$ sudo bash fixPermissions.sh (for BrewPi2)

$ cd /home/brewpi/brewpi3/utils
$ sudo bash fixPermissions.sh (for BrewPi3)

1.3. Modify the config files
1.3.1. Edit the script config files

The settings/config.cfg needs to be created in each script instance to properly configure them.


BrewPi1:

$ sudo nano /home/brewpi/brewpi1/settings/config.cfg

scriptPath = /home/brewpi/brewpi1/
wwwPath = /var/www/brewpi1/
port = /dev/brewpi1
altport = /dev/null
boardType = uno

Save the file and exit


BrewPi2:

$ sudo nano /home/brewpi/brewpi2/settings/config.cfg

scriptPath = /home/brewpi/brewpi2/
wwwPath = /var/www/brewpi2/
port = /dev/brewpi2
altport = /dev/null
boardType = uno

Save the file and exit


BrewPi3:

$ sudo nano /home/brewpi/brewpi3/settings/config.cfg

scriptPath = /home/brewpi/brewpi3/
wwwPath = /var/www/brewpi3/
port = /dev/ttyAMA0
altport = /dev/null
boardType = uno

Save the file and exit


1.3.2. Edit the web interface config files
config_user.php needs to be created in each web interface instance to properly configure them. Here are the config files I’m using.

1. /var/www/brewpi1/config_user.php

<?php
// The default settings in config.php are overruled by the settings in config_user.php
// To use custom settings, copy this file to config_user.php and make your changes in config_user.php
// do not add a php closing tag, because newlines after closing tag might be included in the html

// Do not include a trailing slash on the path
$scriptPath = '/home/brewpi/brewpi1';


Save the file and exit


2. /var/www/brewpi2/config_user.php

<?php
// The default settings in config.php are overruled by the settings in config_user.php
// To use custom settings, copy this file to config_user.php and make your changes in config_user.php
// do not add a php closing tag, because newlines after closing tag might be included in the html

// Do not include a trailing slash on the path
$scriptPath = '/home/brewpi/brewpi2';


Save the file and exit


3. /var/www/brewpi3/config_user.php

<?php
// The default settings in config.php are overruled by the settings in config_user.php
// To use custom settings, copy this file to config_user.php and make your changes in config_user.php
// do not add a php closing tag, because newlines after closing tag might be included in the html

// Do not include a trailing slash on the path
$scriptPath = '/home/brewpi/brewpi3';


Save the file and exit


1.4. Set up cron jobs to start the scripts
Create cron job files for each script instance.

1.4.1. brewpi1

$ sudo nano /etc/cron.d/brewpi1

PYTHON=/usr/bin/python
SCRIPTPATH=/home/brewpi/brewpi1
MAILTO=""
* * * * * brewpi $PYTHON $SCRIPTPATH/brewpi.py --config $SCRIPTPATH/settings/config.cfg --checkstartuponly --dontrunfile; [ $? != 0 ] && $PYTHON -u $SCRIPTPATH/brewpi.py --config $SCRIPTPATH/settings/config.cfg 1>$SCRIPTPATH/logs/stdout.txt 2>>$SCRIPTPATH/logs/stderr.txt &


Save the file and exit



1.4.1. brewpi2

$ sudo nano /etc/cron.d/brewpi2

PYTHON=/usr/bin/python
SCRIPTPATH=/home/brewpi/brewpi2
MAILTO=""
* * * * * brewpi $PYTHON $SCRIPTPATH/brewpi.py --config $SCRIPTPATH/settings/config.cfg --checkstartuponly --dontrunfile; [ $? != 0 ] && $PYTHON -u $SCRIPTPATH/brewpi.py --config $SCRIPTPATH/settings/config.cfg 1>$SCRIPTPATH/logs/stdout.txt 2>>$SCRIPTPATH/logs/stderr.txt &


Save the file and exit



1.4.1. brewpi3

$ sudo nano /etc/cron.d/brewpi3

PYTHON=/usr/bin/python
SCRIPTPATH=/home/brewpi/brewpi3
MAILTO=""
* * * * * brewpi $PYTHON $SCRIPTPATH/brewpi.py --config $SCRIPTPATH/settings/config.cfg --checkstartuponly --dontrunfile; [ $? != 0 ] && $PYTHON -u $SCRIPTPATH/brewpi.py --config $SCRIPTPATH/settings/config.cfg 1>$SCRIPTPATH/logs/stdout.txt 2>>$SCRIPTPATH/logs/stderr.txt &


Save the file and exit


Restart CRON:

$ sudo /etc/init.d/cron restart

REBOOTED!

[ALL UNOS HAVE HEARTBEATS!]

http://xx.xxx.xxx.xxx:85/brewpi1/index.php
http://xx.xxx.xxx.xxx:85/brewpi2/index.php
http://xx.xxx.xxx.xxx:85/brewpi3/index.php

All functions on brewpi1 are operational
All functions on brewpi2 are operational
AlaMode is operational on brewpi3 but One-Wire pin assignment conflicts with AVR pins committed to the on-board RTC I2C port
- will need to modify the pins definitions in the sketch and in the web interface)

Made all web pages (index.php) password protected
- used same procedure as multiple files
- apparently the scope of .htaccess includes subdirectories

Done and done!

[edit: I've been cleaning this up and hopefully making the steps clearer]
 
Thanks at first I was like… he's just quoting the same useless documentation I've been using. Then I saw all the good stuff and I'm like, cool thanks bro.
 
Yeah, I know. But I gave fair warning ;)

It's definitely all in there. I think your issue might be in the whole cron setup - it's a bit different than just running random cron tasks from a user account, there's a process affinity that's set up the way the BrewPi folks did it that keeps tasks from appearing to be identical to BrewPi...

Cheers!
 
I think so too, but everything I have is setup exactly to the specs in the online documentation.
 
I also speculate that I'm having issues because in my test setup (vm Debian wheezy) the pi user has different default permissions than the pi user in the raspbian setup. Really the only thing I see in your changes that I haven't tried yet, is adding the pi user to groups. I'll re-run my setup in a few minutes using your changes and I'll post up my findings. If it all gives me no problems after that. Then maybe you should look into posting a walk through thread here and on the brewpi forums to kinda update the process.

Btw how did you fare with changing alamode pin assignments? I've tried moving around pins for other reasons in the past and either failed miserably at it or nearly had it in a working state. But there was always some line of code in another .h file somewhere I was always chasing and just got fed up with it and went in a more mainstream direction to lessen my headaches. Seeing as how whatever I change I have to remember to change 3 more times.
 
[...]Btw how did you fare with changing alamode pin assignments? I've tried moving around pins for other reasons in the past and either failed miserably at it or nearly had it in a working state. But there was always some line of code in another .h file somewhere I was always chasing and just got fed up with it and went in a more mainstream direction to lessen my headaches. Seeing as how whatever I change I have to remember to change 3 more times.

I tabled the effort as my AlaModes will shortly be dedicated to R'Pints V2. Plus I figured if I couldn't generate a hex file from the unmodified BrewPi AVR package that matched the released file on the site, something in my Atmel Studio configuration wasn't right to begin with, so any modification efforts would be gated by solving whatever was broken...

Cheers!
 
i think the only reason you get a slightly different hex file when you build your own, is because all the options are present in the git files, whereas the downloadable hex files are built specifically for the shield revision you have. in atmel studio you can choose to build for whatever shield you want to run.

I'm using a custom built hex file so I can run ds2413s. Right now all i've done is compile in the option, but if I wanted I could disable all the onboard actuator pins except for the one-wire ones and it would be slightly smaller.

BTW, just finished setting things up per your details. everything is working as it should now.

raspberry pi brewpi.png
 
i think the only reason you get a slightly different hex file when you build your own, is because all the options are present in the git files, whereas the downloadable hex files are built specifically for the shield revision you have. in atmel studio you can choose to build for whatever shield you want to run.

Ok, you hooked me: where can you select the shield version? For all I know it's defaulting to the Rev A shield.

And is the only Build Events configuration that works the Active(Debug) version?



BTW, just finished setting things up per your details. everything is working as it should now.

Excellent! :mug: What's your best guess what was wrong? I was thinking the cron.d instancing stuff...

Cheers!
 
Status
Not open for further replies.
Back
Top