Installation on OS X

Hey Developers!

These are just rough notes for installation of brewpi on OS X (10.9):

I will come back and tidy them up -just posting for now since discourse allows only one active draft comment.

brew install python

sudo pip install pyserial

sudo pip install configobj

sudo pip install psutil

cd settings
mv config.cfg.example config.cfg

'cd ~/dev/brewpi/brewpi-www`
mv config_user.php.example config_user.php
edit location of scriptDir - for me it was /Users/mat/dev/brewpi/brewpi-script

sudo vi /etc/apache2/httpd.conf

  • search for php5
  • uncomment

LoadModule userdir_module libexec/apache2/

LoadModule php5_module libexec/apache2/

append configuration to httpd.conf

grant apache permission to the brewpi-www and brewpi-script repos

sudo chmod -R +a ‘_www allow read,write,delete,add_file,add_subdirectory,file_inherit,directory_inherit’ brewpi-www

enable apache
sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist

sudo apachectl restart

Would this effectively do away with the need for the Pi? So long as the mac was on all the time and connected via wireless?

Yes, although it’s intended for development rather than production use. Updates will not be as smooth as on the pi, and some aspects like the regular scheduling of tasks aren’t part of this setup, since for development, these things aren’t needed or are managed by hand.

(It’s already possible to run brewpi on Windows for development, this was just my notes after moving the system over to OS X.)

1 Like

I’m totally lost in the installation, at the moment it feels like I bought a fancy paper weight.

A few comments:

  • Start with all the git checkout commands. Took me a while to figure out what you had checked out, and I might be missing something.
  • Get the error chmod: Invalid permission type ‘addfile’
  • After restarting apache, then what? It’s not like it is now working on local host or port 8080

I’m so disappointed in the documentation.

In fairness Brewpi was never designed to run on OS X as mdma said the instructions are for development.

I used to have my Mac Pro always on so was contemplating setting it up but it offers no more than the Pi would.

@akalars - these notes are intentionally rough - they are for developers wanting to run brewpi on OS X. I just sketched out the notes as I made progress.

Brewpi for regular use should run on a raspberry pi. You’ll find much fuller instructions for how to do that at Software Install Guide

From somewhere I got the idea that I would be fine if I had a spare machine to run the web server, but apparently I was wrong. I guess I just have to look the other way and pull the visa card to get a raspberry pi.

You can run brewpi on OS X/Windows but it’s mainly aimed at expert users since there’s a lot of setup to be done. If you can find your way around the system then it’s possible.

For the smoothest and simplest experience, the RPi is the best choice since the installation/update process and operation have been optimized for that.

Here is what I did to get the site working on my Mavericks iMac. I tried running and quickly found it is pi specific, so I did most of this by just adapting the cmds and using the built in Apache before finding this thread. I plan to do some development, so hopefully I can update this when I can get scripts scheduled and communication with the Spark.

sudo git clone ~/home/brewpi
sudo git clone /Library/WebServer/Documents

According to

PHP is already installed for you in OS X 10.9 Mavericks. It’s as simple as modifying the httpd.conf file again.

    On line 118, uncomment the LoadModule for PHP:
    LoadModule php5_module libexec/apache2/
    On line 231, add index.php as a default document if a directory is requested:
    DirectoryIndex index.html index.php
    Lastly, we need to tell Apache to use the PHP handler when requesting files that end in .php or .phps. Append the following code to the end of your httpd.conf file.
    <IfModule php5_module>
        AddType application/x-httpd-php .php
        AddType application/x-httpd-php-source .phps

curl -O
sudo python
sudo pip install pyserial psutil simplejson configobj gitpython --upgrade

cd settings
mv config.cfg.example config.cfg
edit these lines:
scriptPath = ~/home/brewpi/ wwwPath = /Library/WebServer/Documents

cd /Library/WebServer/Documents/brewpi
sudo mv config_user.php.example config_user.php
sudo vi config_user.php
edit these lines:
$scriptPath = '/Users/guh/home/brewpi';

Maybe a silly question, but is there any way to mock the arduino or spark when running the python script? I’m trying to play around with the web app for development purposes but don’t actually have a brewpi at the moment and was wondering if there is some kind of test harness for this.

The web app seems to work fine locally otherwise but it would be nice to have some fake communication happening.

We used to have a simulator build which compiled the firmware to an executable. I’ve not looked at it for some time, but we should probably resurrect it at some point.

1 Like