• Please visit and share your knowledge at our sister communities:
  • If you have not, please join our official Homebrewing Facebook Group!

    Homebrewing Facebook Group

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

Homebrew Talk

Help Support Homebrew Talk:

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

The pi zero w only has one usb port so I would also need to setup a powered hub to connect both d1 minis. Might just upgrade the zero to an rpi3.

I might be misinterpreting (and therefore, we might be thinking the same thing here) but as long as you're using WiFi for the connection from Fermentrack to the ESP8266 you shouldn't need to have them connected to the Raspberry Pi W at all after the devices are flashed initially. All you would need is some kind of 5V power source (a powered USB hub being an option - I prefer 5V DC Power Supplies)
 
Thanks for the effort, either I do something wrong or it did not work.
Lost fermentrack also, when I tried to use those "names"

This is the answer from nginx restart:
[....] Restarting nginx (via systemctl): nginx.serviceJob for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.
failed!

To restart nginx, use "service nginx restart". It will probably fail based on what you said -- to see what the logs say, run "tail -50 /var/log/nginx/error.log" (I think it's there - may be mistaken) and look at the last few lines.

I'm going to guess the issue is that the default Fermentrack install doesn't specifically have a server_name set. You may need to add one if you want to run on port 80. Alternatively, you can switch TiltPi to a different port.
 
To restart nginx, use "service nginx restart". It will probably fail based on what you said -- to see what the logs say, run "tail -50 /var/log/nginx/error.log" (I think it's there - may be mistaken) and look at the last few lines.

I'm going to guess the issue is that the default Fermentrack install doesn't specifically have a server_name set. You may need to add one if you want to run on port 80. Alternatively, you can switch TiltPi to a different port.

You are right on that - but I changed and gave it a name in the server_name set. Everything is ok when I restore the original setting.

But no luck getting the tiltpi up and running side by side.

There is probably something I`m missing.
 
Fermentrack Updates:

I've been on vacation for the past few days, and ended up spending far more time consuming beer than thinking about brewing it. Regardless, I did end up with a bit of down time, and was able to get a few fixes/changes in. If you update Fermentrack from GitHub, you should notice the following:

  • Certain forms now have green buttons instead of gray
  • Deleting a device from the Django admin no longer presents an error
  • Devices can now be renamed/have their connection settings updated from a new "Manage Device" page
  • Devices can now be uninstalled from the "Manage Device" page

There is now also a link directly to "Update from GitHub" from the "App Settings" page (the gear in the upper right).

The next features I'm working on are Celery support, official support for serial-connected controllers, and support for Arduino-based controllers.
 
How do you set the time for the graph?

My times are out of whack (GMT+13 timezone). I believe it is on the esp8266 as the stdout log has the incorrect times, but I'm not sure how to set that.

If it's on the pi I have set the timezone offset and it is reporting correct time from the 'date' command via ssh.

Thanks
Chris
 
What error do you see in the nginx error log?

2017/03/28 10:26:39 [error] 2509#0: *4 directory index of "/home/fermentrack/tiltpi//" is forbidden, client: 192.168.8.194, server: _, request: "GET /tiltpi/ HTTP/1.1", host: "192.168.8.179"
2017/03/28 10:27:43 [error] 2627#0: *2 directory index of "/home/fermentrack/tiltpi//" is forbidden, client: 192.168.8.194, server: _, request: "GET /tiltpi/ HTTP/1.1", host: "192.168.8.179"
2017/03/28 10:27:45 [error] 2627#0: *2 directory index of "/home/fermentrack/tiltpi//" is forbidden, client: 192.168.8.194, server: _, request: "GET /tiltpi/ HTTP/1.1", host: "192.168.8.179"
2017/03/28 10:27:46 [error] 2627#0: *2 directory index of "/home/fermentrack/tiltpi//" is forbidden, client: 192.168.8.194, server: _, request: "GET /tiltpi/ HTTP/1.1", host: "192.168.8.179"
2017/03/28 10:27:47 [error] 2627#0: *2 directory index of "/home/fermentrack/tiltpi//" is forbidden, client: 192.168.8.194, server: _, request: "GET /tiltpi/ HTTP/1.1", host: "192.168.8.179"
2017/03/28 10:27:47 [error] 2627#0: *2 directory index of "/home/fermentrack/tiltpi//" is forbidden, client: 192.168.8.194, server: _, request: "GET /tiltpi/ HTTP/1.1", host: "192.168.8.179"
2017/03/28 10:27:48 [error] 2627#0: *2 directory index of "/home/fermentrack/tiltpi//" is forbidden, client: 192.168.8.194, server: _, request: "GET /tiltpi/ HTTP/1.1", host: "192.168.8.179"
2017/03/28 10:33:08 [error] 2627#0: *4 directory index of "/home/fermentrack/tiltpi//" is forbidden, client: 192.168.8.194, server: _, request: "GET /tiltpi/ HTTP/1.1", host: "192.168.8.179"
2017/03/28 10:35:09 [error] 2627#0: *5 directory index of "/home/fermentrack/tiltpi//" is forbidden, client: 192.168.8.194, server: _, request: "GET /tiltpi/ HTTP/1.1", host: "192.168.8.179"
2017/03/28 10:35:12 [error] 2627#0: *5 directory index of "/home/fermentrack/tiltpi//" is forbidden, client: 192.168.8.194, server: _, request: "GET /tiltpi/ HTTP/1.1", host: "192.168.8.179"
2017/03/28 10:37:22 [error] 2627#0: *7 "/home/fermentrack/fermentrack/fermentrack/tiltpi/index.html" is not found (2: No such file or directory), client: 192.168.8.194, server: _, request: "GET /fermentrack/tiltpi/ HTTP/1.1", host: "192.168.8.179"
2017/03/28 10:37:26 [error] 2627#0: *7 "/home/fermentrack/fermentrack/fermentrack/tiltpi/index.html" is not found (2: No such file or directory), client: 192.168.8.194, server: _, request: "GET /fermentrack/tiltpi/ HTTP/1.1", host: "192.168.8.179"
2017/03/28 10:38:06 [error] 2627#0: *7 directory index of "/home/fermentrack/tiltpi//" is forbidden, client: 192.168.8.194, server: _, request: "GET /tiltpi/ HTTP/1.1", host: "192.168.8.179"
2017/03/28 10:44:31 [error] 3353#0: *2 directory index of "/home/fermentrack/tiltpi//" is forbidden, client: 192.168.8.194, server: _, request: "GET /tiltpi/ HTTP/1.1", host: "192.168.8.179"
2017/03/28 10:44:32 [error] 3353#0: *2 directory index of "/home/fermentrack/tiltpi//" is forbidden, client: 192.168.8.194, server: _, request: "GET /tiltpi/ HTTP/1.1", host: "192.168.8.179"
2017/03/28 10:44:33 [error] 3353#0: *2 directory index of "/home/fermentrack/tiltpi//" is forbidden, client: 192.168.8.194, server: _, request: "GET /tiltpi/ HTTP/1.1", host: "192.168.8.179"
2017/03/28 10:44:34 [error] 3353#0: *2 directory index of "/home/fermentrack/tiltpi//" is forbidden, client: 192.168.8.194, server: _, request: "GET /tiltpi/ HTTP/1.1", host: "192.168.8.179"
2017/03/28 10:44:35 [error] 3353#0: *2 directory index of "/home/fermentrack/tiltpi//" is forbidden, client: 192.168.8.194, server: _, request: "GET /tiltpi/ HTTP/1.1", host: "192.168.8.179"
2017/03/28 21:16:19 [emerg] 27220#0: could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
2017/03/28 21:21:28 [emerg] 27493#0: could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
2017/03/28 21:22:39 [emerg] 27579#0: could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
 
Thorrak, you've done an excellent job here. Thanks very much for sharing all your hard work in getting the ESP board compatible with BrewPi. I work in IT and this has been my first step into the RPI scene, I'm so impressed with what is achievable.

I've got it all working, just waiting for my relays and temp probes. One thing which would not work for me is serial connection. Tells me that I may be running an old version of BrewPi. Does this work or has anyone got it working? I'm using a Pi Zero. Haven't tried serial on my Pi3. Same error as LBussy on page 3. Thanks
 
How do you set the time for the graph?

My times are out of whack (GMT+13 timezone). I believe it is on the esp8266 as the stdout log has the incorrect times, but I'm not sure how to set that.

If it's on the pi I have set the timezone offset and it is reporting correct time from the 'date' command via ssh.

Thanks
Chris

Should change time using "sudo raspi-config"

Although I'm not sure whether Fermentrack is using universal time, as I've just changed my time to reflect BST and it's still logging and hour behind.

I don't think the ESP actually holds a time it just gets the instruction from the RPI.
 
Thanks for the effort, either I do something wrong or it did not work.
Lost fermentrack also, when I tried to use those "names"

This is the answer from nginx restart:
[....] Restarting nginx (via systemctl): nginx.serviceJob for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.
failed!

You could check the startup log with:
journalctl -xn
in the console and check the nginx logfile:
/var/log/nginx/error.log
you can post the relevant part here and I can help.
 
You could check the startup log with:
journalctl -xn
in the console and check the nginx logfile:
/var/log/nginx/error.log
you can post the relevant part here and I can help.

Seems like this might be the problem.
2017/03/28 21:16:19 [emerg] 27220#0: could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
2017/03/28 21:21:28 [emerg] 27493#0: could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
2017/03/28 21:22:39 [emerg] 27579#0: could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
 
Thorrak, you've done an excellent job here. Thanks very much for sharing all your hard work in getting the ESP board compatible with BrewPi. I work in IT and this has been my first step into the RPI scene, I'm so impressed with what is achievable.

I've got it all working, just waiting for my relays and temp probes. One thing which would not work for me is serial connection. Tells me that I may be running an old version of BrewPi. Does this work or has anyone got it working? I'm using a Pi Zero. Haven't tried serial on my Pi3. Same error as LBussy on page 3. Thanks

I'm assuming you're using the instructions for BrewPi-www -- you can ignore the error message. I need to update BrewPi-script to remove it.
 
I'm assuming you're using the instructions for BrewPi-www -- you can ignore the error message. I need to update BrewPi-script to remove it.

Yes, I'm ignoring that particular warning but when I connect using serial it finds the ESP, starts the script, but then reports:

Warning: Cannot receive version number from controller. Your controller is either not programmed or running a very old version of BrewPi. Please upload a new version of BrewPi to your controller.

It is mentioned on page 3 of this thread but no confirmed resolution.
 
Seems like this might be the problem.
2017/03/28 21:16:19 [emerg] 27220#0: could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
2017/03/28 21:21:28 [emerg] 27493#0: could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
2017/03/28 21:22:39 [emerg] 27579#0: could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32

Hmm, do you have more hosts on this nginx than these two ones, nginx things you got more than 32.. I think there is probably a ";" missing or something other strange going on, could you post your configuration also for tiltpi?
 
Yes, I'm ignoring that particular warning but when I connect using serial it finds the ESP, starts the script, but then reports:



It is mentioned on page 3 of this thread but no confirmed resolution.

Apologies - as you noted, that's a different issue (and admittedly - not one I've seen in awhile). When I used to see it, restarting brewpi-script would generally cause it to go away. Let me take a look and see if I can locate anything that changed between versions of brewpi-script that would cause that to resolve.
 
Thanks Thorrak. Really appreciate it.

Note: This is running on the Pi Zero, incase it influences the outcome.

I just pushed an update to brewpi-script to the repo. Try updating your clone, and let me know if that fixes it (or, alternatively, if it now crashes on launch)

Edit: Nevermind. I can't read branch names. Merging my changes back into the brewpi-script repo is going to be a bit tougher than I thought, and will have to wait until this weekend. Apologies. :(
 
Last edited:
Seems like this might be the problem.
2017/03/28 21:16:19 [emerg] 27220#0: could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
2017/03/28 21:21:28 [emerg] 27493#0: could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
2017/03/28 21:22:39 [emerg] 27579#0: could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32

Try changing the server port to something other than 80 (I suggest 81) and change the server name directive to just read a single underscore (similar to the Fermentrack configuration).
 
One more update. Thanks to the help of @Mikmonken , both Serial & Arduino support have been added to Fermentrack.

The guided setup still isn't ready so you'll have to set devices up manually but so long as you're comfortable with the "advanced" setup flow everything should work.

That said - I don't actually have a fully-built Arduino controller yet, so if you use this and run into any issues, please report back. Hell - If you use this and DON'T run into any issues, report that as well so I know where things stand. :)
 
Try changing the server port to something other than 80 (I suggest 81) and change the server name directive to just read a single underscore (similar to the Fermentrack configuration).

That is actually much easier than my host name base setup (I'm so used to always serving on port 80/443), but I suspect there is a syntax error or something which gives him that error message.
 
I just pushed an update to brewpi-script to the repo. Try updating your clone, and let me know if that fixes it (or, alternatively, if it now crashes on launch)

Edit: Nevermind. I can't read branch names. Merging my changes back into the brewpi-script repo is going to be a bit tougher than I thought, and will have to wait until this weekend. Apologies. :(

No worries, I can wait. If there is any testing I can do please let me know.
 
Hmm, do you have more hosts on this nginx than these two ones, nginx things you got more than 32.. I think there is probably a ";" missing or something other strange going on, could you post your configuration also for tiltpi?

No, it`s a clean install with only fermentrack.
I tried to put the files for the tiltpi in a sub dir after installing PHP.

thats about it. No other modifications from my side.

I cheked for missing ; but I will check again, since it often is such small issues who causes the problems.
 
That is actually much easier than my host name base setup (I'm so used to always serving on port 80/443), but I suspect there is a syntax error or something which gives him that error message.

I`l try this :)
 
Strange, I just did the update, could you check the logs?
They are documented in the bottom of the page here: https://github.com/thorrak/fermentrack/blob/master/docs_mkdocs/docs/about/architecture.md

There is also an /home/fermentrack/fermentrack/upgrade.log log which could give some info about what is going on.

I made a simple shell-script that will collect logs and upload them to filebin.net to make troubleshooting easier. It can be viewed here:
https://gist.github.com/stone/aa8712bc9539cb879e056fb7e63702ce
and downloaded here: https://gist.githubusercontent.com/...8ae298520b529ca460471eb0612216/collectlogs.sh
 

Thanks, that worked good! I have checked the logs and I can not see anything that should give you that error, it looks like fermentrack is actually running, one thing you could try is to restart fermentrack with:

Code:
source ~/venv/bin/activate
circusctl restart

The actual error should be in nginx /var/log/nginx/error.log, if you try to access fermentrack web application and then issue the following commands in the raspberry pi console:

Code:
tail -n 50 /var/log/nginx/error.log

And post the output here and I should be able to find out what is wrong.
I have also updated the collectlogs.sh script which will collect the nginx log also.

https://gist.githubusercontent.com/...ff625a61873d718d71d28cf0c7b406/collectlogs.sh
 
Thanks, that worked good! I have checked the logs and I can not see anything that should give you that error, it looks like fermentrack is actually running, one thing you could try is to restart fermentrack with:

Code:
source ~/venv/bin/activate
circusctl restart

The actual error should be in nginx /var/log/nginx/error.log, if you try to access fermentrack web application and then issue the following commands in the raspberry pi console:

Code:
tail -n 50 /var/log/nginx/error.log

And post the output here and I should be able to find out what is wrong.
I have also updated the collectlogs.sh script which will collect the nginx log also.

https://gist.githubusercontent.com/...ff625a61873d718d71d28cf0c7b406/collectlogs.sh


root@raspberrypi:/home/fermentrack# source venv/bin/activate
(venv)root@raspberrypi:/home/fermentrack# circusctl restart
Timed out.
A time out usually happens in one of those cases:

#1 The Circus daemon could not be reached.
#2 The Circus daemon took too long to perform the operation

For #1, make sure you are hitting the right place
by checking your --endpoint option.

For #2, if you are not expecting a result to
come back, increase your timeout option value
(particularly with waiting switches)


Errlog shows this line when accessing the Fermentrack site.

2017/04/01 19:27:50 [error] 687#0: *72 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.8.138, server: _, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8123/", host: "192.168.8.179"
 
Seems like this could sove the problem.
But I`m not sure how default the Fermentrack http is.

server {
listen 127.0.0.1;
server_name localhost;

error_log /var/log/nginx/localhost.error_log info;

root /var/www/localhost/htdocs;

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;

fastcgi_intercept_errors on;
error_page 404 /error/404.php;
}
}

http://serverfault.com/questions/31...nnection-refused-while-connecting-to-upstream

Bsically, what to put where? to not ****up totally... (pardon my lang..)
 
So - if I`m right, this is due to my install of PHP and not Fermentrack.
 
Seems like I`m lost in space, better start all over and reinstall Pi and Fermentrack.
 
Seems like I`m lost in space, better start all over and reinstall Pi and Fermentrack.

I'm not near a Raspberry Pi at the moment, but once I am my plan is to try to get TiltPi and Fermentrack installing alongside one-another (and then drop the resultant nginx config file into fermentrack-tools). I'm guessing that the same nginx config could be used for other PHP-based applications as well.
 
I'm not near a Raspberry Pi at the moment, but once I am my plan is to try to get TiltPi and Fermentrack installing alongside one-another (and then drop the resultant nginx config file into fermentrack-tools). I'm guessing that the same nginx config could be used for other PHP-based applications as well.

Sounds great, by the way i removed the tiltpi, but it seems like there is some issues related to PHP who has caught up.

There are a lot of similar problems on the net, all states there is some config issues. But, nginx is to new for me to solve issues in a short time.
 
It has run for several days without any issues, så it seems kind off a strange thing to happen. To be clear, I never tried to do all the config things to get tiltpi up and running, I just deleted the directory, and the auto startup line. Have even done a couple of reboots whitout any issues, so this error just came after the last update of fermentrack.
 
Hi Thorrak,
Been following your project with interest, and I am about to start ordering the parts etc.

I also like the idea of having multiple sensor connectors, and I like your latest board addition:-
For those who might be interested, I've gone ahead and created this. The PCBs.io link is https://PCBs.io/share/z7Rd1 . It's $9.38 for 4 boards there.

Basically the board is this:
View attachment 394178

I'll add the eagle files to the repo at some point in the near future.

Therefore, I should be grateful if you could post what part I need to go with this board please, so that I can add then to the list.

Ps. Thank for all your hard works on this.
 
For those who might be interested, I've gone ahead and created this. The PCBs.io link is https://PCBs.io/share/z7Rd1 . It's $9.38 for 4 boards there.

Basically the board is this:
View attachment 394178

I'll add the eagle files to the repo at some point in the near future.

Hi Thorrak,

Can you kindly provide me with a part list that go with this board please?

Thank, and also a brilliant project, which I am looking forward to build and run.
 
Hi Thorrak,

Can you kindly provide me with a part list that go with this board please?

Thank, and also a brilliant project, which I am looking forward to build and run.

Sure thing. The part list is:

2 pin, 5mm pitch screw terminal - Sparkfun - $0.95
RJ-11 Jack - Sparkfun - $1.25**
3x 3 Pin, 5mm pitch screw terminal - Sparkfun - $0.95 * 3 = $2.85

(and, optionally, 3 screws to mount it to a case or something)

One thing to note - my order is still in fabrication, so I haven't built/tested this yet, but I'm pretty confident everything is right. Additionally, while I linked to Sparkfun above, you can get the same parts much cheaper on AliExpress in larger quantities. Just longer ship times. :)

I also like the idea of having multiple sensor connectors, and I like your latest board addition:-

Just to be clear - you don't need the second PCB to have multiple sensors set up. Part of why this uses RJ-11 connectors is so that you can use one of these telephone line splitters (or similar) and just splice your temperature sensors directly into an RJ-11 cable. I just happen to not like splicing the temperature sensor cables, so I decided to make a PCB instead. Both methods will get you to the same place.
 
Last edited by a moderator:
Non-Fermentrack Update: I've updated the version of brewpi-script I have on the repo for brewpi-www based ESP8266 installations to use the same codebase as was built for Fermentrack. This fixes a handful of bugs that were present in brewpi-script as well as improves support for WiFi-based installations (like those for ESP8266-based installations).

The updated brewpi-script is here:
https://github.com/thorrak/brewpi-script

This repo is not used for Fermentrack installations - you will not need to do anything if you are using Fermentrack.

To install this repo for brewpi-www installations, you will need to install the "pid" package prior to upgrading. To do this, just run
Code:
sudo pip install pid --upgrade
as the "pi" user.


No worries, I can wait. If there is any testing I can do please let me know.

This update should resolve the issues you were facing - let me know if you run into any problems.
 
root@raspberrypi:/home/fermentrack# source venv/bin/activate
(venv)root@raspberrypi:/home/fermentrack# circusctl restart
Timed out.
A time out usually happens in one of those cases:

#1 The Circus daemon could not be reached.
#2 The Circus daemon took too long to perform the operation

For #1, make sure you are hitting the right place
by checking your --endpoint option.

For #2, if you are not expecting a result to
come back, increase your timeout option value
(particularly with waiting switches)


Errlog shows this line when accessing the Fermentrack site.

2017/04/01 19:27:50 [error] 687#0: *72 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.8.138, server: _, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8123/", host: "192.168.8.179"

The error you get about circus not running why you get a 500 error from nginx, so the problem is that process manager circus is not running and have not started fermentrack, so login to you pi and run:

Code:
sudo -u fermentrack -i
source ~/venv/bin/activate
crontab -r
/home/fermentrack/fermentrack/utils/updateCronCircus.sh add2cron
/home/fermentrack/fermentrack/utils/updateCronCircus.sh start

(become the fermentrack user, remove crontab, add crontab entries back, and finally start cirucs)

That should fix the startup problems of circus and hopefully you can access the web interface.

For reference here is the default nginx config for fermentrack (/etc/nginx/sites-enabled/default-fermentrack):


Code:
server {
        listen 80 default_server;
        listen [::]:80 default_server;

    # NOTE - All instances of 'fermentrack' are replaced with the username collected during installation
        root /home/fermentrack/fermentrack;

        server_name _;

    location / {
      try_files /off.html @applocation;
    }

    location @applocation {
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Host $http_host;
      proxy_redirect off;
      proxy_pass http://127.0.0.1:8123;
    }

    # static is where we store static files
    location /static {
      alias /home/fermentrack/fermentrack/collected_static/;
      access_log off;
      expires 30s;
      log_not_found off;
    }

    # media is where we would store uploaded files (if we ever add that feature)
    location /media {
      alias /home/fermentrack/fermentrack/media/;
      access_log off;
      expires 90s;
      log_not_found off;
    }

    # data is where we store csv files containing beer data
    location /data {
      alias /home/fermentrack/fermentrack/data/;
      access_log off;
      expires 10s;
      log_not_found off;
    }

    # alias favicon.* to static
    location ~ ^/favicon.(\w*)$ {
      alias /home/fermentrack/fermentrack/static_collected/favicon.$1;
      access_log off;
      expires 90s;
      log_not_found off;
    }

}
 

Latest posts

Back
Top