How I made my Brewpi wifi with esp8266

Australia & New Zealand Homebrewing Forum

Help Support Australia & New Zealand Homebrewing Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Mattrox

Well-Known Member
Joined
7/1/13
Messages
430
Reaction score
171
I thought I'd document what worked for me here rather than in the multi-chamber thread as to keep discussion about that topic there.



I am running Wheezy on an old computer connected to the home network. I installed the LAMP server as per instructions in point 1 here :
http://docs.brewpi.com/index.html

I did a manual install (point 3) except you need to do these two commands instead of the ones listed as Brewpi via arduino is not the current version. But it works and is proven and so far still supported.

At section 4. "Using Git for BrewPi", after running
$ sudo apt-get install git-core
use this command instead of the command at 4.2.1


$ sudo -u brewpi git clone -b legacy https://github.com/BrewPi/brewpi-script /home/brewpi
Then


$ sudo rm /var/www/*
and at 4.3.1

$ sudo -u www-data git clone -b legacy https://github.com/BrewPi/brewpi-www /var/www
to install the legacy version of BrewPi




I got the pictured Arduino compatible wifi board from ebay.

espboard.jpg



From the esp-link github page I followed the directions.

https://github.com/jeelabs/esp-link/releases/tag/v2.1.7



I just followed the instructions verbatum to install esptool.py



1)install ez_setup.py









2)install esptool.py


$ git clone https://github.com/themadinventor/esptool.git

$ cd esptool

$ python setup.py install

$ cd ..

$ esptool.py -h








The instructions to flash the esp8266 board are as follows:

$ curl -L https://github.com/jeelabs/esp-link/releases/download/v2.1.7/esp-link-v2.1.7.tgz \tar xzf -



$ cd esp-link-v2.1.7



$ esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash -fs 32m -ff 80m \0x00000 boot_v1.4\(b1\).bin 0x1000 user1.bin 0x3FE000 blank.bin



Now, I actually had to install "curl" 1st

I used this as a guide

http://www.jasom.net/how-to-install-curl-command-manually-on-debian-linux



$ cd /usr/local/src



$ wget http://curl.haxx.se/download/curl-7.36.0.tar.gz



$tar -xvzf curl-7.36.0.tar.gz

$rm *.gz

$cd curl-7.6.0



$apt-get install build-essential



$ ./configure



$ sudo make

$ sudo make install



$ /etc/init.d/apache2 restart




Then I ran







then plugged in the wifi unit and used the command




$ esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash -fs 32m -ff 80m \0x00000 boot_v1.4\(b1\).bin 0x1000 user1.bin 0x3FE000 blank.bin
 

Attachments

  • esp_wierd.jpg
    esp_wierd.jpg
    890.7 KB · Views: 371
  • esp_link.jpg
    esp_link.jpg
    765.6 KB · Views: 301
I found the esp-link web interface. I think I found the IP from looking on my smart phone, can't remember. but typed the IP into the browser on my computer to configure the esp settings


On the wifi tab I logged I set my ip to fixed and chose 10.1.1.15 to be consistent with the home network addressing and I selected my home network SSID and entered the password.



I then went to the modem/router web interface and made sure I found the esp device and set it as a static IP on the network too.



On the home tab on the esp-link interface

View attachment 86449

I used the pin assignments

reset - gpio12

conn led - gpio0

serial led - gpio14

UART - normal

rx pull up tick-box ticked



Then I did:



$ sudo nano /home/brewpi/BrewPiUtil.py

and changed

"ser = serial.Serial(port, baudrate=baud_rate, timeout=time_out, write_timeout=0)"



to



ser = serial.serial_for_url(port, baudrate=baud_rate, timeout=1, write_timeout=0)



and then




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




and changed

"port = /dev/ttyACM0" (mine was actually port = /dev/ttyUSB0)

to



port = socket://10.1.1.15:23





I then wired the esp board to the arduino and started the python script again.



$ sudo -u brewpi python /home/brewpi/brewpi.py



Wiring from Arduino to esp8266 board.

5V --> VIN

GND --> GND

tx --> rx

rx --> tx

RES --> D12

View attachment 86448

To flash the Arduino you have to go to uC Console tab on the esp web interface and change the baud from 57600 which is what is required to run Brewpi to 115200. After flashing change it back to 57600.

I was able to flash the Uno with the hex this is the command I used


$ sudo /usr/share/arduino/hardware/tools/avrdude -F -e -p m328p -c arduino -b 115200 -P net:10.1.1.15:23 -U flash:w:/home/brewpi/Downloads/brewpi-arduino-uno-revC-0_2_10.hex -C /usr/share/arduino/hardware/tools/avrdude.conf



note the m328p is slightly different than others used in this thread, but that is what my version of avrdude needed.

You get the HEX file from here.
https://github.com/BrewPi/firmware/releases

For the Uno you want to download the file with this file name, make sure you are under the 0.2.10 release
brewpi-arduino-uno-revC-0_2_10.hex


If you don't have the wifi running to flash the Arduino Uno, you will probably need to download and use Xloader to flash the hex file from a Windows machine.


It wouldn't let me do this in one post because of too many quotes....
 
That's just crazy man :)
..is there a "TV Repair" van parked across the road from your house at the moment?
 
Benn said:
If there is, I'd say your under surveillance.
If there is, he can smell my super hoppy APA with Columbus and Simcoe wafting out of the kitchen from the kits and bits I just put together with way too many IBUs for a 5.2% beer.
 
Wow!! That's awesome.
I'm ordering 6 tonight!!
Can't wait to get this up and running too.
 
Tex N Oz said:
Wow!! That's awesome.
I'm ordering 6 tonight!!
Can't wait to get this up and running too.
The best bit is "Imnotevenworriedmeme.jpg" about the 5V Arduino and 3.3V esp chip and having to build up circuitry so they can talk. It is easy as.

And I knew sweet FA about linux systems before November/December.
 
Mattrox said:
The best bit is "Imnotevenworriedmeme.jpg" about the 5V Arduino and 3.3V esp chip and having to build up circuitry so they can talk. It is easy as.

And I knew sweet FA about linux systems before November/December.
I'm impressed it's all hardware driven (on the Arduino at least).
The temptation is there to give the blue-tooth a go as well but I'm thinking it's not that easy and might have to load libraries. That's impossible to do on with a HEX flash.
I'll have to research it up a bit.
 
That's far too complex for what it should be. Most of that could be eliminated by eliminating the Arduino; if only the BrewPi project would realise that a RasPi is actually stable enough to not need the Arduino, when it's powered by proper power.
 
CmdrRyekr said:
That's far too complex for what it should be. Most of that could be eliminated by eliminating the Arduino; if only the BrewPi project would realise that a RasPi is actually stable enough to not need the Arduino, when it's powered by proper power.
Yes but 3 or four chamber could get a bit costly.
 
CmdrRyekr said:
That's far too complex for what it should be. Most of that could be eliminated by eliminating the Arduino; if only the BrewPi project would realise that a RasPi is actually stable enough to not need the Arduino, when it's powered by proper power.
I don't think I'd trust a Raspberry Pi to do the job of a controller. They are just too unstable. There are not many micro-processors I would trust. Why risk your brew over $20 in gear that will be rock solid for years and years? Elco Jacobs, the original programmer and designer of the Brewpi completely dismissed using a micro-processor for just that reason. Each unit stand-alone and independent of what the other controllers or the RPi is doing.
 
CmdrRyekr said:
That's far too complex for what it should be. Most of that could be eliminated by eliminating the Arduino; if only the BrewPi project would realise that a RasPi is actually stable enough to not need the Arduino, when it's powered by proper power.
It's really a moot point. This is the way the designers thought best. And it's proven and stable.

And even if a RPi solution were more elegant, I don't think there is one I've seen around the traps that is widely available and supported by the developer. And I couldn't develop one myself.

Being able to run it from a Linux machine has meant it was really cheap to set up.

The computer was free, Chinese Uno $6, relay $3, one wire probes $10 for 5 or something. The optional wifi was $15. The rest is going to be the same as the STC 1000 eg Box, power points, etc. Pretty good for PID control of a ferment, remotely accessable. Even if it is clunkier than it could be.
 
All I can say is well done Mattrox, stepping into Linux is a great choice, I only use Windoze at work now and run three Ubuntu boxes at home. Plus for the price you have spent and what you have learned, it is a great project.
 
Tex N Oz said:
I don't think I'd trust a Raspberry Pi to do the job of a controller. They are just too unstable. There are not many micro-processors I would trust. Why risk your brew over $20 in gear that will be rock solid for years and years? Elco Jacobs, the original programmer and designer of the Brewpi completely dismissed using a micro-processor for just that reason. Each unit stand-alone and independent of what the other controllers or the RPi is doing.
They are absolutely not unstable when powered correctly, as the BrewPi 'developer' seems to think. We use RasPis in our house for delivering media to our TVs with Kodi. Kids watch for hours during the day, then we watch content at night. They run 24x7 and are never shut down. After the initial couple of months (mentioned below) I could count perhaps 5 occasions where it's been what I would call unstable in the past 4 years we've been using them.

When they first came out, we used a Samsung phone charger to power them as was the suggestion at the time - and yest it was kind of flaky. Needed a reboot occasionally. Phone chargers are not designed to run constantly day in day out, and if you're doing that - then of course you're going to have issues.

With a dedicated 5v supply, we've had no issues for years.

Also, you're aware Arduino is micro-controller based too, yeah?
 
I decided that when I FINALLY get this into a box, having the LCD option to look at when I open the fridge would be useful.

I followed the instructions to build a DIY shield.... (and while the parts were on thier way from china someone designed a PCB which would have been far easier)... but anyway, I got time today to complete the build.

1475633382392.jpg
 
I have been working on a native Python version of the BrewPi controller, which basically replaces the Arduino with a Python script (so, no Arduino needed).

If you are interested you can follow the thread here:
http://www.homebrewtalk.com/showthread.php?t=575724

There have also been some interesting developments using the ESP8266 modules to implement the BrewPi functionality with and without a Pi.
 

Latest posts

Back
Top