BrewPi on Windows under WAMP

BrewPi was developed to run under Rasperry Pi.  As such, tools and supporting libraries were developed to run optimally underneath that platform.  It can be made to run under Windows for testing, however you will find that there are certain compromises at times, and things may not be as polished on Windows as they are on Rasperry Pi.  That’s not to say some amount of customization may not be possible.

This list of steps will cover the bare minimum necessary to enable BrewPi on Windows with an Arduino.  Further “polish” is left to the reader.  Certain assumptions about the reader’s abilities are made such as the ability to navigate the command line and install software to other than standard locations.

  1. Install Arduino to C:\Arduino: https://www.arduino.cc/en/Main/Donate (needed for flashing Arduino only)
  2. Install Python 2.7.x: https://www.python.org/downloads/release/python-2712/
  3. Add Python to path (e.g. C:\Python27)
  4. Upgrade pip:
    python -m pip install --upgrade pip
  5. Install support libraries in Python
    python -m pip install pyserial
    python -m pip install configobj
    python -m pip install simplejson
    python -m pip install psutil
    python -m pip install pygit
  6. Install Visual C++ Support files below for WAMP.  Note:  If you have a 64-bit Windows, you must install both 32 and 64bit versions, even if you do not use Wampserver 64 bit.  This is item number 20 of TROUBLESHOOTING TIPS of Wampserver: http://forum.wampserver.com/read.php?2,134915
  7. Install WAMP:  http://www.wampserver.com/en/
  8. Install git for Windows:  https://git-scm.com/download/win
  9. Clone BrewPi website:
    git clone https://github.com/BrewPi/brewpi-www C:\wamp64\www\brewpi
    cd c:\wamp64\www\brewpi
    git checkout legacy
    git pull
  10. Create virtual host within WAMP for brewpi
  11. Download BrewPi scripts:
    git clone https://github.com/BrewPi/brewpi-script c:\brewpi
    cd c:\brewpi
    git checkout legacy
    git pull
  12. Copy c:\brewpi\settings\config.cfg.example to c:\brewpi\settings\config.cfg
  13. Edit c:\brewpi\settings\config.cfg
    # ======= settings above this line have been added automatically =======
    # uncomment settings here, these override the settings in defaults.cfg
    # scriptPath = /home/brewpi/
    wwwPath = C:\wamp64\www\brewpi
    port = COM3
    # altport = /dev/ttyACM1
    # boardType = leonardo
    # startupDelay = 1.0
    # debug = true
    
    # On a standard pi installation, the defaults should work.
    # If you are using a different linux flavor or Windows, you can set the tool locations here
    arduinoHome = C:\Arduino\
    avrdudeHome = C:\Arduino\hardware\tools\avr\bin
    avrsizeHome = C:\Arduino\hardware\tools\avr\bin
    avrConf = C:\Arduino\hardware\tools\avr\etc
    
    # on Windows, the scripts defaults to an Internet socket instead of a system socket.
    # useInetSocket=true
    # socketPort=6332
    # socketHost=127.0.0.1
  14. Copy C:\wamp64\www\brewpi\config_user.php.example to C:\wamp64\www\brewpi\config_user.php
  15. Edit C:\wamp64\www\brewpi\config_user.php:
     $scriptPath = 'c:\brewpi';
  16. Download proper 0.2.10 firmware (Uno, Leonardo, Spark): https://github.com/BrewPi/firmware/releases
  17. Execute c:\brewpi\start.bat
  18. Add a virtual host in WAMP pointing to brewpi and restart WAMP.
  19. Open a web browser:  http://brewpi

At this point, an Arduino with BrewPi firmware will communicate with the script provided the COM port is correctly configured in c:\brewpi\settings\config.cfg.  I was unable to upload the firmware with the maintenance panel tool.  Two options are:

  • XLoader:  http://russemotto.com/xloader/
  • AVRDude: Part of the Arduino software.  Command line I used (single line):
    bin\avrdude -U flash:w:brewpi-arduino-uno-revC-0_2_10.hex:i -C etc\avrdude.conf -v -p atmega328p -b 115200 -c arduino -P COM3