Native ESP8266 BrewPi Firmware - WiFi BrewPi, no Arduino needed!

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.

From reading this, it sounds to me like the primary issue is the use of GPIO 0 (D3). Switching away from both GPIO 0 (D3) and 2 (D4) doesn't sound like a bad idea though, even if it would mean we'd be using GPIO15.

Alternatively, I could swap the "door" pin to GPIO15 which would free up D5, and then have D5/D7 as heat/cool, D3 with nothing connected, and D4 as the "buzzer" pin (where we wouldn't be concerned about the state at startup).

Or we could connect the buzzer to D3, and enjoy buzzing at startup. :)
 
Hah sounds like a good implementation, you definitely won't get annoyed at that when there's a thunderstorm surging the power!
 
I don't mind if it beeps on startup. consider it a design feature. If your device is constantly rebooting you will get some chirping out of it at least.
 
Here's what I'm thinking at the moment:

D0 - Heat
D3 - Buzzer
D4 - N/C
D5 - Cool
D7 - Door
D8 - N/C

I can test all of these shortly except "door". Assuming this works, I'll release updated firmware and documentation.
 
Here's what I'm thinking at the moment:

D0 - Heat
D3 - Buzzer
D4 - N/C
D5 - Cool
D7 - Door
D8 - N/C

I can test all of these shortly except "door". Assuming this works, I'll release updated firmware and documentation.
I test door with a jumper wire ....
 
v0.3 is now posted. Changes:
  • Updated LogMessages.h to remove an error message at statup
  • Now forcing default chamber/beer to prevent device setup issues
  • Substantially changed pinouts

The new pinout is as follows:
D0 - Heat
D1 - I2C SCL
D2 - I2C SDA
D3 - Buzzer (currently unsupported)
D4 - N/C
D5 - Cool
D6 - OneWire Data
D7 - Door (Untested)


Note - To upgrade, you will need to both re-pull the brewpi-script repo from GitHub as well as install the v0.3 firmware. Very important!
 
v0.3 is now posted. Changes:

Dude, you rock. Thank you so much for the time and (continued) effort here :mug:

I updated everything but I'm running out the door and won't be able to fire it all up until tomorrow. I'll let you know how it works out.
 
Just a quick update, tried a few more times flashing from the pi, with different cables, different power supplies and different flash settings (baud etc) all with the same error.

Worked first time from my desktop pc using https://github.com/nodemcu/nodemcu-flasher :s

Now hopefully I can find some time to get the hardware wired up for next weekend (3 day weekend for bank holiday) when I'll get my second brew done.
 
As I mentioned earlier, one of my goals is to get a shield built for this to help replace some of the wiring. Here is the first iteration of the design:

https://PCBs.io/share/zMGb8

This version ticks the following boxes:
  • No dupont connectors/SMD - Screw terminals/through hole only
  • Supports dedicated 5V in (as opposed to USB)
  • Supports heat/cool connection to Sainsmart board
  • Supports RJ-11 jack for door/onewire
  • No LCD support, No Buzzer
  • Awkwardly placed screw holes

So in summary, there are some advantages and some disadvantages to this design. The main advantage is that it's $2.22/ea, unpopulated ($8.85/4). The main disadvantage is that the screw holes are very awkwardly placed, and mostly just will prevent it from sliding around.

Any other thoughts? Comments? Requests for the next version? The schematic is attached below.

D1 Breakout - TH Screws Schematic.png
 
As I mentioned earlier, one of my goals is to get a shield built for this to help replace some of the wiring. Here is the first iteration of the design:
Man, look at you go!

No dupont connectors/SMD - Screw terminals/through hole only
So, the power and relay connectors use these?
Best-Selling-PCB-Screw-Terminal-Block-WJ301-5-0-10-0mm-.jpg


Supports dedicated 5V in (as opposed to USB)
And that also powers the ESP8266, right? In this case I wonder if having a USB would be better? I don't know. Trying to envision a finished application.

Awkwardly placed screw holes
Are those holes under the ESP8266 or does it just look like that? The board certainly would not need much to keep it fixed.

Any other thoughts? Comments? Requests for the next version? The schematic is attached below.
I'm sure folks using the LCD would like to see an I2C connector. I actually ordered an LCD from Ali so maybe y'all will convert me.

The only other thing I can see that's missing vs. your list of pinouts is a buzzer. I assume that would change the size and correspondingly the price of the board to place one on the surface? You could always leave a pair of dupont pins there and a person could mount one remotely if the size is a real issue. That way if the pin was used for something else entirely the board might still be appropriate. The other side of that argument is putting it on the board makes for one really nice compact and complete package.

What's the reason to power the temp probe from 3v3 rather than 5v? Both are readily available there. I thought the DS18B20 used 5v.

ETA: I see it can use 3v - 5.5v. Still curious about the choice. I don't see anything in the spec sheet that implies one would be better than the other.

I'm getting real excited about this!
 
So, the power and relay connectors use these?
Best-Selling-PCB-Screw-Terminal-Block-WJ301-5-0-10-0mm-.jpg

Yep, exactly. Should be able to use 3x 2 connector terminals, attaching two using the small slot on the side of the screw terminal module. Just need to be careful to get one with the correct pin spacing.

And that also powers the ESP8266, right? In this case I wonder if having a USB would be better?

Yep. You can still power everything via USB if you want, however the main reason I have it set up this way is in case you want to have everything in a single enclosure and use one of these if you are so inclined. Options!

Are those holes under the ESP8266 or does it just look like that? The board certainly would not need much to keep it fixed.

You are correct. The idea is that with the D1 mini you get the male pin headers as well as female. Solder the female pin headers to this board, the male pin headers facing down to the D1 mini, and you're good to go. If something happens to the D1 mini and you need to replace it, just pop it off, pop a new one on, and you're good to go.

This configuration also provides the clearance necessary for the screws. You're still only going to have 2 screws, but as you mentioned, the point is more to keep it from sliding around than anything. Zip ties would probably work just as well.

I'm sure folks using the LCD would like to see an I2C connector. I actually ordered an LCD from Ali so maybe y'all will convert me.

That revision of the board is coming. :) One with the socket for the level
shifter as you suggested, one with the level shifter integrated on the board.

The only other thing I can see that's missing vs. your list of pinouts is a buzzer. I assume that would change the size and correspondingly the price of the board to place one on the surface?

You got it. I agree though - I've got the space to add connections for the buzzer - worst case it remains unpopulated. I'll add that before the final revision.

What's the reason to power the temp probe from 3v3 rather than 5v? Both are readily available there.

The data lines are all 3v3 so I figured I'd use 3v3 when possible. More practically, if the wiring shorts out somewhere you don't run the risk of burning up the board.

Also, that's what's on the Raspberry Pi GPIO pins which is where my DS18b20 sensors all started out, so I was used to it. :)

I'm getting real excited about this!

It's getting pretty close, if I may say so myself!
 
(Picture an old Kung-Fu movie with out-of-sync voiceover:)

"Ah, so you have attempted to out-multi-quote me! Now you shall die!"

Yep. You can still power everything via USB if you want, however the main reason I have it set up this way is in case you want to have everything in a single enclosure and use one of these if you are so inclined. Options!
I see you are way ahead of me there. That seems like a great idea.

You are correct. The idea is that with the D1 mini you get the male pin headers as well as female. Solder the female pin headers to this board, the male pin headers facing down to the D1 mini, and you're good to go. If something happens to the D1 mini and you need to replace it, just pop it off, pop a new one on, and you're good to go.
Way ahead of me again! That makes a ton of sense.

The data lines are all 3v3 so I figured I'd use 3v3 when possible.
I wondered if that was not the case after I posted.

It's getting pretty close, if I may say so myself!
I'm going to finish my Arduino off before I come back to this so it may be a week or so. At the rate you are going you'll have all of this complete in a week. Maybe by then my other parts from Ali express will be here.

I keep kicking around ideas for a box for this. If you could find a double (or triple) handy box in PVC rather than metal:

s-l225.jpg

... you could have an outlet on one side and the boards on the other. Put a jack in frame outlet on one side like this:
01-single-modular-jack_4094.jpg

... and a rectangular outlet:
t5325-w.jpg

... and one of these:
66RR_300dpi.jpg

... and you are all set.

Not sure how large the LCD is but if it is the same size as those holes you could find a triple and go the same route? Just spitballing.
 
The brewpi site have one wire boards for SSRs using the same RJ11 socket (not sure on their pinout), but if you did use the same pin out, you could have your controller with only two cables coming out, and only one wire and I2C on the board. That would also leave spare pins for the rotary encoder. Also using SSRs will help avoid screen scrambles.

Ed: Also most are using these to control fridges, previous iterations of this controller have been quite large requiring lots of wires going to different devices. Now if this had only the two cables, you could, with a little bit of work mount this in the door of the fridge. Most fridge doors are around an inch and a half thick, route the 5v and onewire through where the door switch is, and mount the SSRs with the compressor. Nice neat and simple note the fridge skin would knock the wifi signal a little but I recon you get a good 30-40 feet range anyway.
 
Last edited:
Can this system be setup using the beer profile? I am having issues with it not working properly. I get the device configuration set up and try and run, but it never fires the cooling output. Thoughts?
 
I like the idea!

One of these days I'm gonna stop having to pay for printing and get my own 3d printer.

Where/how do you envision the cables coming out?

I am trying to figure out if I want to mount the outlet to the box, or have that be a separate part. Thoughts?

Would having an rj11 port be desirable?

Just a hole on the bottom?
 
So I finished up the box, thank you again Thorrak for your update, those pins work perfectly!

So first things first, the finished product
IMG_20160821_195928.jpg
The switch lets me shut the LEDs off separately. Here it is with all lights on
IMG_20160821_195918.jpg

This is my Cat5e spliced DS18B20 Probes
IMG_20160821_195950.jpg

The internals were cleaned up a little bit from this pic...
IMG_20160815_185830.jpg
I probably should have used a larger enclosure than a 6x6x4, but it works. The rail is protected with electrical tape, I pulled apart a cell phone charger that provided enough current for the ESP8266 and Sainsmart 2-Channel Relay to function no problem The ESP8266 is in a shell I 3D printed.

Again, to everyone, thank you for the help in making this work. I'm excited to put my fermentation chamber back in use. Once I saw this project, I ordered up my ESP8266, and when it arrived, my Arduino Uno was pulled form service (perhaps a bit premature, but I've no patience or self-control here!)
 

Attachments

  • IMG_20160821_195958.jpg
    IMG_20160821_195958.jpg
    303.4 KB · Views: 359
I am trying to figure out if I want to mount the outlet to the box, or have that be a separate part. Thoughts?

Would having an rj11 port be desirable?

Just a hole on the bottom?
Looking at @jabib 's build, I'd say yes to both. The power outlet on one side (similar to the original "unofficial" Sainsmart BrewPi case) with the phone jack on an adjoining edge or the other side. A design decision would be whether to use a "wart" like this:
4625A-24I.jpg


Or something meant to mount into a box like this (called a "jack in frame":

leviton-inserts__96907.jpg


I think I prefer the latter, where one, two, or three outlets can be presented on the outside. It's also a form factor similar to the outlet so it sort of matches.
 
Big ol multiquote coming

So I am slightly confused. How did you get two temp sensors on your system?
You can do it with cat5 splitters, but really you only need 4-core flat telephone cable and telephone splitters.

I've been debating how best to implement the One-Wire physically and settled on using Cat5e long enough to build this. I feel like Cat5 is more robust than 4 wire telephone cable though, but not as cheap either. I doubt there's going to be any real-world benefit of having Cat5, but it's done now. I just made sure that when I spliced everything together I kept the colors in mind.
Code:
Vcc Red - Cat5 Orange Pair
Data Yellow - Cat5 Blue Pair
Ground Black - Cat5 Brown Pair
N/A - Cat5 Green Pair
And my pull-up 4.7K resistor is right in the keystone jack, no soldering necessary which was nice.

I just threw a case design up on thingiverse.

Let me know what you guys think. I haven't printed it yet.

http://www.thingiverse.com/thing:1730607

I would suggest putting in some posts for the relay and ESP8266 to mount on the inside like the original one, orient the relay so the outputs are closer to the outlet box. Otherwise, clean simple case, doubt anything could go wrong with it.

Holy crap, that looks fantastic! Well done!

You did all the legwork here, I'm just a mooch who made a pretty box! Seriously though, thank you! One of the reasons I was so excited about your project was being able to multitask my Raspberry Pi, changing it from just the webserver for BrewPi to being both a webserver for BrewPi and Strangebrew Elsinore (a RPi/Java based Brewery controller) and have my fermenter physically separated.

I'll stick around and help out with any issues that come up for people. FYI I clean installed with your v0.3 update, and I could program the ESP8266 from the Pi on /dev/ttyUSB0 no problem, so I'm not really sure why I had that flashing issue before...
 
Can this system be setup using the beer profile? I am having issues with it not working properly. I get the device configuration set up and try and run, but it never fires the cooling output. Thoughts?

Hm. Are you still having this issue? Beer profile is strange - it's technically controlled by the Raspberry Pi, only a single temperature is stored on the controller (and the fact that it's in profile mode).
 
Hm. Are you still having this issue? Beer profile is strange - it's technically controlled by the Raspberry Pi, only a single temperature is stored on the controller (and the fact that it's in profile mode).

Beer profile is strange.
I can't agree anymore. I didn't understand it until I studied the source code.

I would suggest to check the "start time" of the profile. If current time is out of the time window of the profile, BrewPi won't do anything.
Another common problem is the internet connection. The RPI must have access to the internet to get the correct time. This is sort of FAQ of BrewPi.
 
Looking at @jabib 's build, I'd say yes to both. The power outlet on one side (similar to the original "unofficial" Sainsmart BrewPi case) with the phone jack on an adjoining edge or the other side. A design decision would be whether to use a "wart" like this:
4625A-24I.jpg


Or something meant to mount into a box like this (called a "jack in frame":

leviton-inserts__96907.jpg


I think I prefer the latter, where one, two, or three outlets can be presented on the outside. It's also a form factor similar to the outlet so it sort of matches.

I have update the drawing to include a quickport, 110v outlet, and main incoming power. Still haven't printed. Should be doing that in the next day or two.

http://www.thingiverse.com/thing:1730607

Will be adding adding breadboard mount in the coming revisions.

cn6xSLM.png
 
Looks great. I'll be interested in the clearance between the QuickPort connectors and the LCD, as well as the outlet and the cord coming in. Some things you can only see after you print.

There will be plenty of room inside I think.

Here is a link to the QuickPort plate, and here is a link to the inserts.

ETA: Do you intend to glue nuts into the base to attach the cover?
 
Last edited by a moderator:
Well I just can't seem to catch a break on this.

Soldered the header pins on and connected up a temperature sensor with a 4.7k pull up resister in parallel between the live and data wire. But when I refresh the device I only get back the hardcoded output devices/pins, I don't get the temperature sensor back.

I've tried swapping the data and ground wires, and also attempted live wire on 3v3 and 5v. And I also tried 2 of the 5 temperature sensors that I have.

Really don't know what to do know, brew 2 is tomorrow so I guess it'll be sans temperature control again (to be fair the warm flat gravity sample for brew 1 didn't taste off so hopefully it'll be fine).
 
Well I just can't seem to catch a break on this.

Soldered the header pins on and connected up a temperature sensor with a 4.7k pull up resister in parallel between the live and data wire. But when I refresh the device I only get back the hardcoded output devices/pins, I don't get the temperature sensor back.

I've tried swapping the data and ground wires, and also attempted live wire on 3v3 and 5v. And I also tried 2 of the 5 temperature sensors that I have.

Really don't know what to do know, brew 2 is tomorrow so I guess it'll be sans temperature control again (to be fair the warm flat gravity sample for brew 1 didn't taste off so hopefully it'll be fine).
Hmm. Try resetting the EEPROM data. It's a button near the bottom of one of the setting screens that reads something like "Reset to factory configuration" or something like that.

The firmware does not use parasitic mode so you will need to power your sensors on 3v3. What pin are you using for data in this case?
 
Well I just can't seem to catch a break on this.

Soldered the header pins on and connected up a temperature sensor with a 4.7k pull up resister in parallel between the live and data wire. But when I refresh the device I only get back the hardcoded output devices/pins, I don't get the temperature sensor back.

I've tried swapping the data and ground wires, and also attempted live wire on 3v3 and 5v. And I also tried 2 of the 5 temperature sensors that I have.

Really don't know what to do know, brew 2 is tomorrow so I guess it'll be sans temperature control again (to be fair the warm flat gravity sample for brew 1 didn't taste off so hopefully it'll be fine).
You could have a mislabeled db18b20. Bunch of us over in the Brewpi thread had bad sensors.There is a sketch to run on a arduino that can check the sensors in the Brewpi thread.
 
I feel your pain. After a few months of "bench work" where everything was spot-on, I tried this morning to put it in a box (this was an Arduino). I spent three hours taking it apart and pitting it together trying to get the damned temp sensor to work. Finally after giving up and taking a picture to post online asking for help, I noticed I had the temp sensor plugged into D4 instead of A4. I mean they are on different sides of the board!!!!

Anyway, here's hoping your issue is something small and maybe something that will be obvious after a brief break.
 
One thing that I'm having issue with currently is using .htaccess / .htpasswd to password protect my Apache2 server. It seems when I installed BrewPi previously, it was an older version of Apache, and the instructions on Fuzze's post worked fine, but there are a few differences in the configuration files that make the two incompatible. Still working through it; its password protected, but I can't seem to allow anybody access to a viewing panel.

Side note, I was a bit overzealous with my wiring of the switch, and turning it off to shut the LEDs off completely seemed to allow a complete circuit through the heater and cooler outlets without the relay running. The switch now just controls the power LED and it works as expected. Don't ask how I managed that.
 
One thing that I'm having issue with currently is using .htaccess / .htpasswd to password protect my Apache2 server. It seems when I installed BrewPi previously, it was an older version of Apache, and the instructions on Fuzze's post worked fine, but there are a few differences in the configuration files that make the two incompatible. Still working through it; its password protected, but I can't seem to allow anybody access to a viewing panel.

Side note, I was a bit overzealous with my wiring of the switch, and turning it off to shut the LEDs off completely seemed to allow a complete circuit through the heater and cooler outlets without the relay running. The switch now just controls the power LED and it works as expected. Don't ask how I managed that.


I'd not bother trying to password protect the website you can use an app called weaved for free that gives you access for 5mins to make any change etc. Which is enough to check and tweak your settings as well as view how the brew is getting on.
 
What benefits does Weaved have that .htaccess password protection doesn't give me? In FuzzeWuzze's post on a cheap BrewPi, someone posted up code to create a public access page with the current state and the graph, but removes the Start/Stop Script, Maintenance Panel, and the Temperature Control pane. I was really fond of that setup.
 
Back
Top