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.
The Zero and Zero W both sport the same single-core small RAM SOC that was used on the original B, so it gets easily bogged down on rather mundane loads. Thus almost any other board would be a huge improvement as the 2B, 3B, 3B+ and 4B all use quad core SOCs, have larger memory, and in most cases increasing clock speeds.

2019-01-28%2014_54_29-Window.png


fwiw, I think the 3B+ is the sweet spot of features + performance vs power (the 4B is a pig - and not shown in the table)...

Cheers!
 
Hold off until tonight, and I’ll get the PCB I have for this one up. It has extra wide solder pads for attaching wires from the XLR jacks. Hopefully wide enough, depending on the size of your wires.

Happy new year !!

Did you finish design the board ?
 
Does the Pi model make a difference?
My existing build uses a Pi Zero W and Web access is very slow (and feels like it gets progressively slower after a week or so of logging) would a faster Pi improve this or is that not the bottle neck?
Not really. I mean when you get to where you have a lot of very long logs it will slow down a little. You may be happier with a faster Pi but the Zero will certainly work fine for most folks. I'd probably not run out and buy a new one now and wait to see - it's not going to save you money by getting it now, and (re) installation is very easy.
 
Well...all I can say is if you pull up a temperature plot (ala BrewPi, or my own multichannel logger) that's a few weeks long on a Zero you'll be waiting awhile, vs on a 2B or 3B where it's way quicker. As well, my Raspberry Pints tap list pour updates happen within an eye-blink on 2B and 3B where on a B or Zero it can take a couple of seconds.

More cores, more memory, faster clocks, still pretty cheap in the scheme of things.
What's not to love? :D

Cheers!
 
The Zero and Zero W both sport the same single-core small RAM SOC that was used on the original B, so it gets easily bogged down on rather mundane loads. Thus almost any other board would be a huge improvement as the 2B, 3B, 3B+ and 4B all use quad core SOCs, have larger memory, and in most cases increasing clock speeds.

2019-01-28%2014_54_29-Window.png


fwiw, I think the 3B+ is the sweet spot of features + performance vs power (the 4B is a pig - and not shown in the table)...

Cheers!
Could you please explain what you mean when you say the 4b is a pig, i have just purchased one and so far is behaving as expected
 
Does the Pi model make a difference?
My existing build uses a Pi Zero W and Web access is very slow (and feels like it gets progressively slower after a week or so of logging) would a faster Pi improve this or is that not the bottle neck?

I run a 3B+ for my Fermentrack, and a Zero W for my Raspberry Pints (flow meters aren’t even installed yet) and I can say, without a doubt, the Zero W has a much slower response time. I really like the Zero W, but I’m already contemplating moving to a 3B+ and my RPints build hasn’t even made it off my desk.

Is that your bottle neck? It’s documented above that the Pi choice contributes, yes, but I know you can help your system by modifying your log intervals. If you have something you want to monitor/graph for a long time, changing your log interval to 5 or 10 minutes may alleviate some of your issues and you may be happy sticking with the Zero W.
 
Thanks all.

To be clear, yes it works with a Pi Zero W and does everything it should.

It is however slow to display pages and very slow after a week or 2 of logging (I've already changed the logging to 5 mins)

As I'm buying an additional Pi anyway I wanted to know if the extra few quid on a 3 would result in slightly quicker responce times.

It seems they will so the order has been placed.
 
Having used Fermentrack for quite a few brews now I'm completely sold, it just works my thanks to everyone who enabled something this awesome to be set up by a complete novice like me for free

That said there's a few tweaks if love to see if possible.

1) a watchdog timer.
It seems pretty bomb proof but every so often it does seem to fall over. Temp control remains and the LCD works but the Web displays says 'can't receive display' (or something to that effect) and restarting the Pi always seems to fix it. Is it possible to have it auto restart if it detects that state for an hour or something similar?

2) Support for a hardware reset button.
If the Pi does need restarting I hate just yanking the power but starting up a PC to SSH in is a right pain. Be great if grounding a pin restarted the Pi. I'm aware I can probably add this seperatly but would be nice to have it all integrated.

3) yes gravity based profiles would be ace but I think that's on your 'to do' list somewhere already.

4) additional configurable logging channels.
I assume gravity logging is done tilt to pi rather than tilt to controller to Pi? If so would additional channels connected directly to the Pi be that complex? I'm aware displaying them graphically would be challenging but would displaying the current value be possible?


Finally. Something that I assume isn't possible but would be ace. Any chance of showing the current gravity on the LCD? I assume to do so the display would need to be driven from the Pi rather than the controller?
 
Well, I know Dave is not a fan but I have two Pi4's and love them. Yes, I use active cooling ... which amounts to a $2 fan plugged into the pins on the Pi. For that egregious process, I am rewarded with quite a performer. If you buy the 4, get a case with a little fan. I have two of them next to me right now and my laptop cooling is making more noise than they are.

The Zero is without a doubt slower - I was answering from the POV of getting something running. If that's what you have, it's more than enough to get going. If however, you want to buy a faster Pi, I ain't gonna be the one to tell you that you won't notice the difference. :)
 
That said there's a few tweaks if love to see if possible.

1) a watchdog timer.
It seems pretty bomb proof but every so often it does seem to fall over. Temp control remains and the LCD works but the Web displays says 'can't receive display' (or something to that effect) and restarting the Pi always seems to fix it. Is it possible to have it auto restart if it detects that state for an hour or something similar?
Well, first, what you are talking about is not Fementrack but the Raspberry Pi in general. As such it's outside of the scope of the project.

That said, I would also draw your attention to what it is you are trying to accomplish. "I want my Raspberry Pi to know if it is unresponsive for more than > amount of time." If the Pi is unresponsive, it's not gonna know. :)

While the Raspberry Pi does have an internal watchdog that can be used, it is notoriously unreliable. A working solution would need to be external electronics coupled with an internal heartbeat. Again, outside the scope of Fermentrack. I'm not the author however so John is free to take on whatever he wants.

An easy solution for you would be to create a schedule that reboots the Pi on a regular basis - preferably before it goes unresponsive because this is unlikely to fix that if it is hung. Create a file in the cron.d directory:

Code:
$ sudo nano /etc/cron.d/reboot

Paste in the following:

Code:
# m h dom mon dow user command
00 2 * * * root /sbin/shutdown -r now

Save and exit with Chrl-X and "Y" to save. This will create a job that reboots your Pi every morning at 2:00 AM. If you want to know how to customize that, Google "cron" and you will have more than you ever wanted in the way of information.

2) Support for a hardware reset button.
If the Pi does need restarting I hate just yanking the power but starting up a PC to SSH in is a right pain. Be great if grounding a pin restarted the Pi. I'm aware I can probably add this seperatly but would be nice to have it all integrated.
Again, this is a Pi thing and not a Fermentrack thing so see the note about scope above.

That said, I am warning you now if you continue to yank the power without shutting down you will corrupt your SD card and lose everything. It will happen. It's not a matter of "if." If you think starting up a PC so you can shut the Pi down is a pain, you'll really hate having to start over.

I will give you some ideas though, some, all or none may work for you:
  1. If you have a Pi 2 or B+ there is a "Run" header on the board. If you solder a couple of DuPont pins onto that, you can use a bit of wire and a momentary switch as a "reset button." I think there's still a danger of corrupting individual files, but the risk is far less than tanking the little beast. If you have an old PC case, the reset button from that would be perfect.
  2. Set up the Raspberry Pi watchdog. It's better than nothing. Instructions are here.
  3. Just in case someone with some extreme skills is reading and wants a "cool method" you can short the SoC end of R15 to ground momentarily to initiate a reset. This is not for the faint of heart. :) I have not looked to see if this was still available/working on the Pi 4. Maybe @day_trippr can have a look and bless this method?
  4. You can set up a hardware/software solution by creating a script to run in the background that will shut down the Pi based on GPIO input. You can run this script on boot and when you short GPIO 3 to ground (see #1) the Pi will shutdown cleanly (provided it is functional enough to be running the script.)

4) additional configurable logging channels.
I assume gravity logging is done tilt to pi rather than tilt to controller to Pi? If so would additional channels connected directly to the Pi be that complex? I'm aware displaying them graphically would be challenging but would displaying the current value be possible?
Pretty sure this is already done? Either that or I don't understand what you mean.

Finally. Something that I assume isn't possible but would be ace. Any chance of showing the current gravity on the LCD? I assume to do so the display would need to be driven from the Pi rather than the controller?
The display is connected to the controller so there's no straightforward way to display them on the controller. Using a permanent display on the Pi is a better idea. See this little TFT screen which puts a display on the top of the case. You can then use a browser and a customized web page to cobble it together. This is rather fiddly and I'm not sure John will want to do it.

A better solution I think would be to use Tiltbridge as a separate gravity display.
 
Thanks @LBussy

Re the watchdog timer :
I don't mean the whole Pi crashes which is why I think it can catch it itself (see below pic as an example) while rebooting on a regular basis would solve this it doesn't seem like an elligant solution.


Re a hardware reset button:
I don't have a 2 or B+ I'm afraid. The script you describe is what I had in mind it just seemed neater to have it bundled but I get what you mean about scope.

Re additional logging channels:
I didn't mean log gravity I just meant as that's been done I guess some of the work involved has already been done.
What I meant was user definable inputs, say I wanted to log pressure from a pressure sensor, could this be hooked up to one of the Pi GPIO pins?
Screenshot_20200101_172604_com.android.chrome.jpg
 
The 4B can't get out of the way of its own power consumption and thermal dissipation. Without significant cooling it rate-limits itself...

Cheers!
mmmm i see i have added heat sinks to processor ram and lan plus a fan should this now be ok
 
Re the watchdog timer :
I don't mean the whole Pi crashes which is why I think it can catch it itself (see below pic as an example) while rebooting on a regular basis would solve this it doesn't seem like an elligant solution.
You'd need to determine a testable condition in order to address it. My first guess would be to try a local web request to see if it fails when it's in that condition. If it fails, you have something that's testable. Try this:
Code:
curl --silent --output /dev/null http://localhost;echo $?
That line will show nothing but the exit code. A "0" is a success, anything else is a failure. If it does register a failure, you can script decisions based on that. For instance, restarting nginx. The codes are listed in the man page.
Re a hardware reset button:
I don't have a 2 or B+ I'm afraid. The script you describe is what I had in mind it just seemed neater to have it bundled but I get what you mean about scope.
If option 3 above is viable (someone smarter than me needs to dig in the schematic) then that's a possibility for a guy not afraid to use a soldering iron.
Re additional logging channels:
I didn't mean log gravity I just meant as that's been done I guess some of the work involved has already been done.
What I meant was user definable inputs, say I wanted to log pressure from a pressure sensor, could this be hooked up to one of the Pi GPIO pins?
Well, sure, you can. I think right now you'd be stuck writing it. :) Fermentrack is written in Django and I think a motivated person could figure out how to google an exemplary tutorial in short order. Once you get it to work outside of Fermentrack (even to the point where you display a number on the web page) getting it into Fermentack is easier.
 
Just started to assemble some bits.
The logic level converters hadn't turned up but I threw everything togetger anyway and he displays work anyway
Assume there's no issue leaving it like this if it works?
 
Hi, I am using fermentrack with brewpi in an ESP8266. Don’t know if this issue has been addressed before, but I am having this problem: every time I get some kind of power shortage that restarts both the esp and my wifi router, the esp is not reconnecting to the wifi. It seems that the router takes too long to restore the wifi and the ESP stops searching for the network. Any way to solve this?
 
Hi, I am using fermentrack with brewpi in an ESP8266. Don’t know if this issue has been addressed before, but I am having this problem: every time I get some kind of power shortage that restarts both the esp and my wifi router, the esp is not reconnecting to the wifi. It seems that the router takes too long to restore the wifi and the ESP stops searching for the network. Any way to solve this?

How long is it taking your router to come up? The ESP8266 should keep searching for at least ~5 minutes if memory serves before reverting to the fallback mode where it just controls your temps. I don't have a good solution for this offhand if it's taking longer to come up, but I can see if there is anything out there to let the ESP try to reconnect in the background.
 
How long is it taking your router to come up? The ESP8266 should keep searching for at least ~5 minutes if memory serves before reverting to the fallback mode where it just controls your temps. I don't have a good solution for this offhand if it's taking longer to come up, but I can see if there is anything out there to let the ESP try to reconnect in the background.

I don’t think the router is taking more than 5 min to come back, but I will check it. However, the behavior is exactly what you describe: it does not connect to the wifi but the ESP keeps controlling the temperature to the last temperature setting.
 
Thorrak said:
How long is it taking your router to come up? The ESP8266 should keep searching for at least ~5 minutes if memory serves before reverting to the fallback mode where it just controls your temps. I don't have a good solution for this offhand if it's taking longer to come up, but I can see if there is anything out there to let the ESP try to reconnect in the background.

Similar thing here when I have a power outage. My router start up sequence just isn’t fast enough to catch my ESPs as they’re searching for my network.

It took me a couple power outages, but I figured out, if I have one...once the router is running, cycle the power on my control box, and it all connects.
 
Yes, that is what I have been doing. The problem is when I travel and leave a beer fermenting hoping it is in cold crash when I return!
 
I have been running successfully the esp8266 for couple of brews!! Now happy with it I would like to clean a little bit the install and plan to put it in a box with connectors for the temp prob. Any advice for connectors? I feel RJ11 or 45 is overkill but I would like a solid connector.
 
I have been running successfully the esp8266 for couple of brews!! Now happy with it I would like to clean a little bit the install and plan to put it in a box with connectors for the temp prob. Any advice for connectors? I feel RJ11 or 45 is overkill but I would like a solid connector.

RJ-45. :)

Alternatively, if you want a permanent connection to the main PCB I’ve heard of people using Mini XLR jacks with success. I’ve got a few on order but haven’t yet tested them myself.
 
How long is it taking your router to come up? The ESP8266 should keep searching for at least ~5 minutes if memory serves before reverting to the fallback mode where it just controls your temps. I don't have a good solution for this offhand if it's taking longer to come up, but I can see if there is anything out there to let the ESP try to reconnect in the background.

In the UK an increasing number of routers may take >5mins to come into sync. Vectored fibre to the cab circuits take a while to measure the crosstalk from other circuits in the group and there's been an increase in multi-texh supporting routers which will attempt to sync one tech and, if unsuccessful try a different tech.
 
In the UK an increasing number of routers may take >5mins to come into sync. Vectored fibre to the cab circuits take a while to measure the crosstalk from other circuits in the group and there's been an increase in multi-texh supporting routers which will attempt to sync one tech and, if unsuccessful try a different tech.
Why would this slow down reconnecting to the router from the LAN side?
 
Yes, that is what I have been doing. The problem is when I travel and leave a beer fermenting hoping it is in cold crash when I return!

I built a new version of the firmware that attempts to incorporate a new timer that will connect to WiFi (if there is a saved SSID/password) every ~3 minutes or so if the controller detects that it is not connected. This is in addition to the existing autoreconnect logic for flaky routers.

To test, flash the "BrewPi /w WiFi (Beta)" firmware from within Fermentrack. Let me know if you have any issues (or if it seems to work for you!).
 
I built a new version of the firmware that attempts to incorporate a new timer that will connect to WiFi (if there is a saved SSID/password) every ~3 minutes or so if the controller detects that it is not connected. This is in addition to the existing autoreconnect logic for flaky routers.

To test, flash the "BrewPi /w WiFi (Beta)" firmware from within Fermentrack. Let me know if you have any issues (or if it seems to work for you!).

Great! I will try it!
 
I built a new version of the firmware that attempts to incorporate a new timer that will connect to WiFi (if there is a saved SSID/password) every ~3 minutes or so if the controller detects that it is not connected. This is in addition to the existing autoreconnect logic for flaky routers.

To test, flash the "BrewPi /w WiFi (Beta)" firmware from within Fermentrack. Let me know if you have any issues (or if it seems to work for you!).


Good timing! I was just searching esp8266 delay options. My esp8266s were not reconnecting to my RPi 3 / Fermentrack after a power loss. I'll give it a go as well.
 
.....

To test, flash the "BrewPi /w WiFi (Beta)" firmware from within Fermentrack. Let me know if you have any issues (or if it seems to work for you!).

Weirdness when I flashed the WiFi (Beta) the only new AP that came up was a locked BrewPiAP which I've never seen before. There wasn't any ESP_ showing, so I went back to the normal flash for Wifi and the usual ESP_******* came up and I was able setup the Wifi access.
 
Weirdness when I flashed the WiFi (Beta) the only new AP that came up was a locked BrewPiAP which I've never seen before. There wasn't any ESP_ showing, so I went back to the normal flash for Wifi and the usual ESP_******* came up and I was able setup the Wifi access.

That's expected, that's one of the new changes (there were other changes beyond just the WiFi reset in that firmware)

It should display the AP name and password on the LCD when you flash - the AP name should be BrewPiAP and the pass should be brewpiesp
 
That's expected, that's one of the new changes (there were other changes beyond just the WiFi reset in that firmware)

It should display the AP name and password on the LCD when you flash - the AP name should be BrewPiAP and the pass should be brewpiesp

That would explain it, I don't use LCDs. So I retried flashing the BETA version but this time instead of the BrewPiAP coming up in my scan for networks it just showed a new AP with a bunch of random asscii symbols which I couldn't connect to. When I went back to my dashboard for the Controller I had previously setup to see if I could see what normally would come up on a LCD, if I had one, I saw "script starting up" and then it connected. I confirmed with my router that there was an active wifi connection to the ESP.

Now how it kept the credentials for the SSID and pwd through the flashing process I do not know. It seems to be communicating so we will see.

I'm going to simulate a power failure and I'll let you know if the ESP reconnects.
 
That would explain it, I don't use LCDs. So I retried flashing the BETA version .......

I'm going to simulate a power failure and I'll let you know if the ESP reconnects.

Yup. It reconnected with the BrewPi /w WiFi (Beta) - 2.4.2 - 0.12 - Beta - firmware. Although this test is not with the same router the it will be hooked up to in my brewery the BETA flash seems to be behaving.
 
That's expected, that's one of the new changes (there were other changes beyond just the WiFi reset in that firmware)

It should display the AP name and password on the LCD when you flash - the AP name should be BrewPiAP and the pass should be brewpiesp

Flashed another Mini with the BETA firmware. This time I saw the BrewPiAP come up and added the brewpiesp pwd. The only weirdness was when I tried to add the mini as a new temp controller the scan DNS function didn't detect it. So I used advanced flow and added it by IP address and it came up.
 
To reference the above, I also had some weirdness with the level shifter and screen. I was swapping parts and didn't power off. I noticed I had issues with only the bad level shifter I had, if I had a good one plugged in, I could remove it and it would be fine and still report. But booting it without a shifter wouldn't work. Lol
 
Back
Top