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.
@Thorrak,

First of all, thanks for sharing this project with us.

I have been running the original Raspberry/Arduino Brewpi setup for more than two years now, and it has been rock solid. I want to expand the setup with another fermentation chamber, and decided to try Fermentrack.

What kind of SSR (board) is recommended for this setup?
 
@Thorrak,

First of all, thanks for sharing this project with us.

I have been running the original Raspberry/Arduino Brewpi setup for more than two years now, and it has been rock solid. I want to expand the setup with another fermentation chamber, and decided to try Fermentrack.

What kind of SSR (board) is recommended for this setup?


There are two options I use both on different set ups.

https://www.sainsmart.com/arduino-pro-mini.html 2 relays one board really easier to set up.

Or 2x https://store.brewpi.com/temperature-control/solid-state-relays-ssr/ssr-10a-194 (or any similar 10 a ssr) I think these are gentler on the fridge compressor. Slightly move convoluted to set up.

To be honest if you're running brewpi already you should be able to just use all your existing parts (even the arduino)
 
I`m back in the darkness. Has been away this weekend. Now chamber two is out of reach again.

stderr:
Apr 23 2017 16:40:35 Connection type WiFi selected. Trying TCP serial (WiFi)
Apr 23 2017 16:40:35 Connecting to BrewPi esp1659303.local on port 23
Apr 23 2017 16:40:47 Unable to connect to BrewPi esp1659303.local on port 23. Exiting.
Apr 23 2017 16:40:49 Connection type WiFi selected. Trying TCP serial (WiFi)
Apr 23 2017 16:40:49 Connecting to BrewPi esp1659303.local on port 23

From SSH on pi:
ping esp1659303.local
ping: unknown host esp1659303.local

Not able to ping by mDNS name.

Ping by ip is ok.

pi@raspberrypi:~ $ ping 192.168.8.119
PING 192.168.8.119 (192.168.8.119) 56(84) bytes of data.
64 bytes from 192.168.8.119: icmp_seq=1 ttl=128 time=84.1 ms
64 bytes from 192.168.8.119: icmp_seq=2 ttl=128 time=107 ms
64 bytes from 192.168.8.119: icmp_seq=3 ttl=128 time=28.7 ms
 
Think I'm getting that too. Was running but now getting alot of this

Screenshot_20170423-192457.jpg
 
Restarting works with mixed results, but doesn't last.

I`m back in the darkness. Has been away this weekend. Now chamber two is out of reach again.

stderr:
Apr 23 2017 16:40:35 Connection type WiFi selected. Trying TCP serial (WiFi)
Apr 23 2017 16:40:35 Connecting to BrewPi esp1659303.local on port 23
Apr 23 2017 16:40:47 Unable to connect to BrewPi esp1659303.local on port 23. Exiting.
Apr 23 2017 16:40:49 Connection type WiFi selected. Trying TCP serial (WiFi)
Apr 23 2017 16:40:49 Connecting to BrewPi esp1659303.local on port 23

From SSH on pi:
ping esp1659303.local
ping: unknown host esp1659303.local

Not able to ping by mDNS name.

Ping by ip is ok.

pi@raspberrypi:~ $ ping 192.168.8.119
PING 192.168.8.119 (192.168.8.119) 56(84) bytes of data.
64 bytes from 192.168.8.119: icmp_seq=1 ttl=128 time=84.1 ms
64 bytes from 192.168.8.119: icmp_seq=2 ttl=128 time=107 ms
64 bytes from 192.168.8.119: icmp_seq=3 ttl=128 time=28.7 ms

I think we're getting closer. My current hypothesis is that while the work I did earlier fixes the controller disconnecting/staying disconnected, it doesn't cause it to resume announcing itself via mDNS.

I could fix this by trying to tweak the firmware (and probably will at a later date) but instead, I went ahead and added a new feature to Fermentrack which causes the last known IP address to be cached every time Fermentrack successfully resolves the specified hostname. The change is pushed to GitHub and should be available by updating Fermentrack.

Separately, I'm working on a "debug connection" script which should help to provide some feedback on what issues are affecting a disconnected controller (and hopefully (eventually), suggestions on how to resolve them!). For the curious, the GitHub issue tracking this feature is here.
 
I have a lot of esp8266, so - I`l try to setup a couple of them and let them be "on" and see if it works or not. Wifi is not a must, but realy nice - if it works :)

Edit.

Serial is still running fine by the way :)
 
I have a lot of esp8266, so - I`l try to setup a couple of them and let them be "on" and see if it works or not. Wifi is not a must, but realy nice - if it works :)

Edit.

Serial is still running fine by the way :)

Good - I would hope so. mDNS was always a bit of a hack. It's amazing when it works, but tends to inexplicably break for no apparent reason. I managed to fix some of the issues -I- was having awhile back (v0.6 and thereabouts) and things have run well since then, but I also live in NYC which means my router is line of sight from my controllers whether I like it or not. What I need to do is take a controller on a walk around the block hooked up to a battery and see if it experiences the same issues.
 
Good - I would hope so. mDNS was always a bit of a hack. It's amazing when it works, but tends to inexplicably break for no apparent reason. I managed to fix some of the issues -I- was having awhile back (v0.6 and thereabouts) and things have run well since then, but I also live in NYC which means my router is line of sight from my controllers whether I like it or not. What I need to do is take a controller on a walk around the block hooked up to a battery and see if it experiences the same issues.

Strangest thing is - it only happens when more than one esp is connected.

EDIT:
I just remembered I never have mentioned this earlier. Each board is 100% stable, if they are "single" when on Wifi.
 
I've successfully flashed my esp, then went through the WIFI setup process. I've gone to my router and I know the IP address of the esp.

My question is, should I be able to point my browser to the esp and get to it? When try to hit http://<esp-ip-address>:23 the browser won't connect. However when I try to telnet to <esp-ip-address> 23 I do connect and get some garbage back when I type anything.

If it's possible to use this standalone, how do I pull information from it?
 
So in diagnosing the issue last night I went through the code associated with the WiFi AP generation, and I have a hypothesis -- for both why this is happening, and why I haven't yet seen the same exact issue on my side.

There's a "protected" part of the flash memory that stores Wifi credentials which isn't cleared automatically when the ESP is flashed. What I think is happening is that it stores both the WiFi network info (SSID and password) -- as well as the connection type (access point vs. connected to an actual network). That is, if you flash the WiFi firmware, let it boot, and flash the serial firmware before you connect to a network, it will save the configuration of being an access point.

Where I think I went wrong was assuming the WiFi libraries were where the WiFi connection code lived. Apparently, it's in the boot loader which we don't overwrite. Since we don't overwrite the boot loader, and we don't overwrite the WiFi connection settings, we end up seeing what you and @stbernts are describing -- "ghost" access points, or pingable, inactive controllers.

The solution is simple at least - I'll add the WiFi libraries to the Serial firmware, and just explicitly disable everything (and delete any saved credentials for good measure). Should be a relatively quick fix - I'll attempt to get it in tonight.



I don't know if you can explicitly overwrite the area of memory where the WiFi credentials are saved unfortunately from esptool. The reset firmware does it (as well as testing a few other issues). If you want, flash the reset firmware, hit the reset button, wait a minute or two, and then flash the WiFi firmware. That should get you as close to a "factory" reset as you can get.

I've successfully flashed my esp, then went through the WIFI setup process. I've gone to my router and I know the IP address of the esp.

My question is, should I be able to point my browser to the esp and get to it? When try to hit http://<esp-ip-address>:23 the browser won't connect. However when I try to telnet to <esp-ip-address> 23 I do connect and get some garbage back when I type anything.

If it's possible to use this standalone, how do I pull information from it?

EDIT.
Read this one wrong --
 
I've successfully flashed my esp, then went through the WIFI setup process. I've gone to my router and I know the IP address of the esp.

My question is, should I be able to point my browser to the esp and get to it? When try to hit http://<esp-ip-address>:23 the browser won't connect. However when I try to telnet to <esp-ip-address> 23 I do connect and get some garbage back when I type anything.

If it's possible to use this standalone, how do I pull information from it?

Hey there. After you've set up your ESP8266 to connect to WiFi, it's ready to be used by either Fermentrack or BrewPi-www, running on a Raspberry Pi. You shouldn't be able to connect to it with a web breowser.

If you connect to it via telnet, it should respond like a normal BrewPi controller - which is to say it should be sending back lightly altered JSON. Basically, a bunch of strings that contain data between curly braces.

If you are looking to replace the Raspberry Pi and log data directly to the ESP you would need to take a look at @pocketmon 's BrewPiLess project. There are advantages and disadvantages to both approaches - it's all about what works best for you.
 
If you connect to it via telnet, it should respond like a normal BrewPi controller - which is to say it should be sending back lightly altered JSON. Basically, a bunch of strings that contain data between curly braces.

Yup, that's exactly what I was seeing. I misunderstood the purpose of the ESP component--thought it did a bit more than data collection. Just ordered a second Pi to host Fermentrak, so I think I'm going to be just fine now.

Thank you, Thorrak, for all of the time you've put into these projects! So many of us benefit from your hard work.
 
Just leaving some feedback. Serial (USB) is running smooth, absolutly noe hickups of any kind so far with the v0.9 firmware.
 
As an update to these bug fixes for flaky connections, mine is working a lot better now.

I sometimes connect to the pi and see the message "cannot receive LCD text from controller/script" but at least it comes back after waiting a while.

Once this beer is finished I plan to move my router to get better connection with my fridge, but its been very helpful to have it reconnect thankyou Thorrak.
 
I was having much better luck after a recent update. I now have it torn apart so I can box it up. I have the parts for a second one so I'm going to build it. Maybe I'll give it to my buddy. If I can figure out how to update the WiFi on the esp that is.
 
I was having much better luck after a recent update. I now have it torn apart so I can box it up. I have the parts for a second one so I'm going to build it. Maybe I'll give it to my buddy. If I can figure out how to update the WiFi on the esp that is.

Nice! Definitely share the love!

As an aside, to reset the WiFi you can either flash the WiFi reset image to the Pi, wait a minute or so, and then reflash the main BrewPi image, or telnet into the controller and type a "w".

At some point, I need to add a button to Fermentrack that lets you do this. Maybe as an extra switch on the "uninstall" screen. We'll see.
 
Nice! Definitely share the love!

As an aside, to reset the WiFi you can either flash the WiFi reset image to the Pi, wait a minute or so, and then reflash the main BrewPi image, or telnet into the controller and type a "w".

At some point, I need to add a button to Fermentrack that lets you do this. Maybe as an extra switch on the "uninstall" screen. We'll see.

It will look like this. Did this with a pi zero and Craftbeerpi. I may swap out the zero with this other esp and just have it all on one pi. Though I've always thought the brewpi algorithm was a bit much for a keezer.

IMG_20170408_224426151.jpg


IMG_20170331_113422637.jpg
 
Nice! Definitely share the love!

As an aside, to reset the WiFi you can either flash the WiFi reset image to the Pi, wait a minute or so, and then reflash the main BrewPi image, or telnet into the controller and type a "w".

At some point, I need to add a button to Fermentrack that lets you do this. Maybe as an extra switch on the "uninstall" screen. We'll see.

does this mean we can flash the ESP OTA?
 
It will look like this. Did this with a pi zero and Craftbeerpi. I may swap out the zero with this other esp and just have it all on one pi. Though I've always thought the brewpi algorithm was a bit much for a keezer.

I've got a BrewPi controller running my keezer as well at the moment. It's absolutely overkill - but I love it.

does this mean we can flash the ESP OTA?

Not yet -- but @rocket4x4 was toying with the feature earlier, so it might be coming soon! The initial flash will have to be via serial, of course, but upgrades would be greatly simplified.
 
I've got a BrewPi controller running my keezer as well at the moment. It's absolutely overkill - but I love it. .

What are your cycle times like? The Craftbeerpi setup has roughly a 2.25 hr cycle with .25hr on and 2 hrs off. That's with it set at +/- .5°f. that's about .5 to hour better off to.e than my stc was doing.
 
I just pushed out a new feature for Fermentrack that makes some significant changes to the way that devices connected via serial work.

Previously, when you set a device up you would set it up to be associated with a serial port (Something like /dev/ttyUSB0). The problem with this is that if you have multiple devices connected to one Raspberry Pi the serial port might change unexpectedly. This could lead to Fermentrack no longer being able to control your device - or even potentially confusing one controller for another.

To avoid this, going forward when a device is set up the device will have its "USB serial number" stored and Fermentrack will use that to identify which device is which. You can connect/disconnect devices to your heart's content, and everything should work exactly as expected.

If any of you previously had a "multi-chamber" setup with BrewPi-www, this is designed to accomplish something similar to @day_trippr 's suggestion of creating a 99-arduino.rules file to map the device's serial number to a serial port manually.
 
I just pushed out a new feature for Fermentrack that makes some significant changes to the way that devices connected via serial work.

Previously, when you set a device up you would set it up to be associated with a serial port (Something like /dev/ttyUSB0). The problem with this is that if you have multiple devices connected to one Raspberry Pi the serial port might change unexpectedly. This could lead to Fermentrack no longer being able to control your device - or even potentially confusing one controller for another.

To avoid this, going forward when a device is set up the device will have its "USB serial number" stored and Fermentrack will use that to identify which device is which. You can connect/disconnect devices to your heart's content, and everything should work exactly as expected.

If any of you previously had a "multi-chamber" setup with BrewPi-www, this is designed to accomplish something similar to @day_trippr 's suggestion of creating a 99-arduino.rules file to map the device's serial number to a serial port manually.

Well, after i did an upgrade to this version - my fermentrack is now (for the first time) actually doing what this update should fix. Both chambers are now getting same temp when I change one of them.

EDIT,

Both where assigned to USB1 - will delete both chambers, add everything all over, and see if the problem go away.
 
What are your cycle times like? The Craftbeerpi setup has roughly a 2.25 hr cycle with .25hr on and 2 hrs off. That's with it set at +/- .5°f. that's about .5 to hour better off to.e than my stc was doing.

Well, after i did an upgrade to this version - my fermentrack is now (for the first time) actually doing what this update should fix. Both chambers are now getting same temp when I change one of them.

EDIT,

Both where assigned to USB1 - will delete both chambers, add everything all over, and see if the problem go away.


My apologies for that - Since this is a new feature, I had it autodetect the USB serial number associated with the serial_port that you had set if there wasn't a USB serial number set (which, obviously, there wouldn't be). Let me know if you run into any additional issues going forward.

As a side note, I've also rolled out some connection debug options in case anyone has further connection issues. To debug what is going on, go to:

Device Dashboard > Device Menu (at the top) > Manage Device/View Logs

Then click "Debug Device Connection".

Hopefully this helps to clarify some of the causes for why a device may appear disconnected.
 
Will try to switch ports, to see if it handles changing of usb ports.
 
@thorrak Up and running on the latest, had to do the same thing (remove the cabinets, and add them again) - went straight up.
 
Hi All,
I have now put together a full "dummy" loose system of the Brewpi-ESP8266 currently using all Wifi, and is made up of a Raspberry PI 3, a D1 Breakout - LCD TH Screws from PCBs.io, LCD etc. and all is working using Fermentrack.

So a big thanks to @Thorrak for putting together a brilliant piece of kit to share with us all.

Therefore, the last thing I need to put everything into a box / case to make my second Fermenter Controller.

As I have added a Wifi Range extender to my Brewshed, which I then linked to my current Raspberry / Brewpi (Elco&#8217;s) Spark with a wire network, to avoid dropouts, I was then thinking if I could do the same with the Brewpi-ESP8266?

Therefore, though this may sound like a daft question, but can I just link the Raspberry to the wired network and then usb link to the Wemos, which is on the D1 Breakout Board to control everything including power, or do I still need a separate 5v power supply as well? Or is this a non-starter?

Thanks in advance for your help.
 
As I have added a Wifi Range extender to my Brewshed, which I then linked to my current Raspberry / Brewpi (Elco’s) Spark with a wire network, to avoid dropouts, I was then thinking if I could do the same with the Brewpi-ESP8266?

Therefore, though this may sound like a daft question, but can I just link the Raspberry to the wired network and then usb link to the Wemos, which is on the D1 Breakout Board to control everything including power, or do I still need a separate 5v power supply as well? Or is this a non-starter?

Thats actually a matter of some debate. The problem you have with that setup (if I'm understanding correctly) is that you're powering the Raspberry Pi through a USB power supply, then using the Raspberry Pi to power the Wemos. That shouldn't be an issue - the Wemos doesn't draw much current. The issue would be with the relay. I'm assuming you're then powering the relay off the D1 breakout board, which would pull the +5v from your Raspberry Pi as well.

This may be fine - It's not dissimilar from the setup used for @ame 's Fuscus build which I can confirm works pretty well. It will cause noise though as the relays switch on and off which - longer term - could lead to either the Wemos resetting unexpectedly or issues with the Raspberry Pi.

A suggested addition from a quick google search (to be clear - I haven't tested this) is to get a 10,000uF capacitor and put it across the 5v lines. If you're using my breakout board and aren't using a separate power supply, you should have a vacant screw terminal that would work perfectly for this. ;)
 
T If you're using my breakout board and aren't using a separate power supply, you should have a vacant screw terminal that would work perfectly for this. ;)

Hi Thorrak,
Yes, I am using one of your boards, which made life easier to solder. On my current set up I use SSRs rather than relays, and could do the some here if that works better? Do I also need to wipe clean the Wemos and re-install with the serial firmware to make it work?

Thanks for your help.
 
Hi Thorrak,
Yes, I am using one of your boards, which made life easier to solder. On my current set up I use SSRs rather than relays, and could do the some here if that works better? Do I also need to wipe clean the Wemos and re-install with the serial firmware to make it work?

Thanks for your help.

If you want to switch from WiFi to Serial, then yes - you would need to reflash with the serial firmware. If you have it hooked up to the Raspberry Pi anyways, there's no real advantage to using WiFi. The advantage to WiFi is not having to have it wired to the Pi -- but for that you'd be back to needing a +5v power supply.

I would actually recommend against SSRs in this sense, as SSRs tend to have more ongoing power draw than standard relays. If you go that route, you'd probably want to have a direct connection to the power supply.
 
Got Fermentrack up and running with serial. Really liked the automatic install AND the setup wizzard!!

Just something small I noticed, when on the 'Dashboard' the green button labelled 'Load Past Log' brings up the 'Set Temp Control' screen instead of the prior logs. Also shouldn't the button be called the same as 'Load Prior Log' ?
 
Got Fermentrack up and running with serial. Really liked the automatic install AND the setup wizzard!!

Just something small I noticed, when on the 'Dashboard' the green button labelled 'Load Past Log' brings up the 'Set Temp Control' screen instead of the prior logs. Also shouldn't the button be called the same as 'Load Prior Log' ?

...I've been staring at that screen for months now, and never noticed that. I'll take a look later tonight & get that corrected. Thanks - and good catch!
 
Back
Top