Fermentrack: Fermentation monitoring & BrewPi-www Replacement for Raspberry Pi

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.
That sounds like it might be a bug... I’ll take a look tonight.
Regarding this potential bug, just to give you more info I've found for testing, it seems to not take any changes I make in the 'Manage Device/ View logs' tab. I was playing around with changing the serial port and such, and when I click Submit, the page reloads like it took. Changes will seem to have been made, however when I navigate away from the page, and come back to it, the changes revert back to whatever was entered when I first set up this controller.
 
What’s missing is the part where you bind the BT to a device port. In theory you should be able to proceed with creating a unit file and doing the systemctl steps.

While you seem to be able to do that part (bind it to an rfcomm port) in the graphical UI, it does not seem to stick. The only way I was able to get it to stick was by adding the systemd unit file which basically issues the same command each time you reboot.
 
I am having a feeling the issue with not being able to untick 'Prefer connecting via udev' could be my problem here. I was reading through documentation for Fermenrack and came across this line:

"By default, Linux assigns serial ports to devices like BrewPi controllers based on the order they are connected. If you have multiple devices connected to your Raspberry Pi this can mean that Fermentrack could potentially mistake one device for another. To prevent this, Fermentrack includes a feature which will disregard the specified serial port when connecting to the controller and will instead connect to the device with the USB serial number that matches the device you set up.

If you wish to disable this feature and instead only connect to the specified serial port, uncheck the "Prefer Connecting Via Udev" option in the "Manage Device" screen."


Maybe I am wrong, but if my goal is to connect to a specific serial port that isn't USB and this feature is preventing it, could that be my issue connecting?
 
Maybe but I doubt it. BT doesn’t use udev rules so (and I’m making an assumption/leap of faith) the BT support would not try that.

Either way - if you don’t have a /dev/rfcomm* device, it’s not set up correctly yet. The instructions I linked should help that.
 
I ran through the steps you listed, and getting the same result. As far as I can tell from the Bluetooth manger in the Pi, the module is connected to port /dev/rfcomm0 successfully. I just can't get Fermentrack to see it.
 
pi@raspberrypi:~ $ ls -al /dev/rfcomm*

crw-rw---- 1 root dialout 216, 0 Mar 27 21:39 /dev/rfcomm0

crw-rw---- 1 root dialout 216, 1 Mar 27 21:23 /dev/rfcomm1
 
If you don’t really have two BT devices, somethings’ screwy. Try a reboot and see if it drops back to one. If so, configure for that device and see how it goes.
 
Reboot done, now just showing one:

crw-rw---- 1 root dialout 216, 0 Mar 27 21:39 /dev/rfcomm0

Deleted the device I had in Fermentrack to start over. Re-added using advanced set up, inputting /dev/rfcomm0 as the Serial Port. Still isn't communicating with the controller :(
 
Try this from a command line on the Raspberry Pi--

First, install screen:
sudo apt-get install screen

Run the following:
screen /dev/rfcomm0 57600

...then, if everything works, you should be connected to the controller (if it is working). Then, just type a single "l". (that' a lowercase L) If the controller works, it will print the LCD screen information
 
Ran the first command, seemed to take ok. Ran screen /dev/rfcomm0 57600 and the terminal window becomes a blank field. I tried typing 'l' but nothing happened. Then after a minute it says [screen is terminating] and returns to pi@raspberrypi:~ $

Screenshot (2).png
 
What's the light on the BT module doing?

How did you set up the module initially? Did the AT commands work correctly?

Do you have the wires set up RX <-> TX and TX <-> RX?

If the module set up properly in the GUI then the module itself is probably okay. It sounds like wiring, baud rate, or something with the shield.
 
The light on the BT module: blinks rapidly when not paired, one second long blink every other second when in AT mode, and double blink every 2 seconds when paired with the Pi.
When I entered AT mode, it seemed to reflect this in the serial monitor of IDE.

What should the baud rate be, and how can I change it if it's incorrect?
 
57,600 is correct. If you got an OK back from it, that’s correct. The lights also sound as if we are good that far. After that it’s the connections. You have RX to TX and vice versa, correct?
 
There is a section in the Fermentrack Documentation for Enabling Python To Interact with Bluetooth, and says that the section needs to be re-written with full instructions. At the moment it lists code:

PYTHON3_INTERPRETER="$(readlink -e $installPath/venv/bin/python)"
if [ -a ${PYTHON3_INTERPRETER} ]; then
sudo setcap cap_net_raw+eip "$PYTHON3_INTERPRETER"

Not sure what to do with this, but is this something that needs to happen? There isn't much info about Bluetooth in the Fermentrack docs, so I can't really say for sure. It seems like my Pi is reading the BT module fine, and I would imagine the wiring is all correct. The cadibrewer shield seems to be functioning in every other way now (after lots of trial and error on my end o_O). Maybe there is more I need to do to specifically get Fermentrack to see it? I don't know...
 
Try swapping the RX and the TX. I think the shield labels refer to which pins on the bluetooth module to hook up to the shield.
 
There is a section in the Fermentrack Documentation for Enabling Python To Interact with Bluetooth, and says that the section needs to be re-written with full instructions. At the moment it lists code:

PYTHON3_INTERPRETER="$(readlink -e $installPath/venv/bin/python)"
if [ -a ${PYTHON3_INTERPRETER} ]; then
sudo setcap cap_net_raw+eip "$PYTHON3_INTERPRETER"

Not sure what to do with this, but is this something that needs to happen? There isn't much info about Bluetooth in the Fermentrack docs, so I can't really say for sure. It seems like my Pi is reading the BT module fine, and I would imagine the wiring is all correct. The cadibrewer shield seems to be functioning in every other way now (after lots of trial and error on my end o_O). Maybe there is more I need to do to specifically get Fermentrack to see it? I don't know...

Oh man - I need to remove that. With the addition of native Tilt support, all of that is done automatically.

The fact that you can’t get a response from “screen” still points to an issue outside python/Fermentrack.
 
Another interesting thing I found poking around. Looked at the Stderr Log in Fermentrack and it is repeating these lines:

Mar 28 2019 13:43:42 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.
Mar 28 2019 13:43:46 Connection type Serial selected. Opening serial port.
Mar 28 2019 13:43:46 Connected via serial to port /dev/rfcomm2
Mar 28 2019 13:43:46 Notification: Script started, with no active beer being logged
Mar 28 2019 13:43:56 Checking software version on controller...
Mar 28 2019 13:44:07 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.
Mar 28 2019 13:44:11 Connection type Serial selected. Opening serial port.
Mar 28 2019 13:44:11 Connected via serial to port /dev/rfcomm2
Mar 28 2019 13:44:11 Notification: Script started, with no active beer being logged
Mar 28 2019 13:44:21 Checking software version on controller...

Any thoughts on this?
 
Try swapping the RX and the TX. I think the shield labels refer to which pins on the bluetooth module to hook up to the shield.

I originally had it wired up RX on the shield to RX on the module, same with TX, as this is what I assumed. I tried the other way around and it hasn't resolved the issue, unfortunately.
 
Oh, forgot to mention that I re-paired the BT module with the pi, and it is now connecting to /dev/rfcomm2. I adjusted this in Fermentrack, but the issue continues.
 
At this point, I'm honestly thinking of ditching the addition of bluetooth. Hopefully I can get it all set up in my space in a way that USB cables can reach.
 
Another interesting thing I found poking around. Looked at the Stderr Log in Fermentrack and it is repeating these lines:

Mar 28 2019 13:43:42 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.
Mar 28 2019 13:43:46 Connection type Serial selected. Opening serial port.
Mar 28 2019 13:43:46 Connected via serial to port /dev/rfcomm2
Mar 28 2019 13:43:46 Notification: Script started, with no active beer being logged
Mar 28 2019 13:43:56 Checking software version on controller...
Mar 28 2019 13:44:07 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.
Mar 28 2019 13:44:11 Connection type Serial selected. Opening serial port.
Mar 28 2019 13:44:11 Connected via serial to port /dev/rfcomm2
Mar 28 2019 13:44:11 Notification: Script started, with no active beer being logged
Mar 28 2019 13:44:21 Checking software version on controller...

Any thoughts on this?

This corresponds to what you proved last night running screen. The device at /dev/rfcomm2 isn’t acting like a BrewPi controller
 
I was thinking that, but I just spent so much time getting these shields built, and already bought the Arduinos and accessories, I would hate to fully give up on them. I'll probably just get extra long USB cables and a powered hub to the Pi. The controllers are working otherwise, was just missing this last upgrade to bluetooth.
 
You're mixing different instructions intended for different versions. If I were to be able to tell you what to do I'd instruct you to undo everything you did, delete the unit files, untrust and un-pair the BT devices, and reboot. Then, make sure you are not paired or trusted. Then follow the instructions I know work for stretch. Then you'd at least be working from a single set of instructions proven to work on your version of the OS. You know ... if I could tell you that. ;)

The fact that you are now on rfcomm2 proves that you've got multiple configurations for the same device. You should only have one, that will be 0, and if it's not something has been done incorrectly.
 
I was thinking that, but I just spent so much time getting these shields built, and already bought the Arduinos and accessories, I would hate to fully give up on them. I'll probably just get extra long USB cables and a powered hub to the Pi. The controllers are working otherwise, was just missing this last upgrade to bluetooth.
You can use those shields on a wifi enabled Arduino. I wrote that up here.
 
I don't know what to do. I feel like every other thing I read is either for the original BrewPi, BrewPi Remix, or Fermentrack, so I am just getting a bit lost. I want to stick with Fermentrack, but all of the forums and posts and everything seem to be for getting things working in BrewPi, especially the older posts. As I am still learning all of this, I find it hard to determine when the instructions are more or less the same, or when they differ when using Fermentrack specifically. Sorry for any confusion I may be bringing, I am very much a noob to this.
 
I don't know what to do. I feel like every other thing I read is either for the original BrewPi, BrewPi Remix, or Fermentrack, so I am just getting a bit lost. I want to stick with Fermentrack, but all of the forums and posts and everything seem to be for getting things working in BrewPi, especially the older posts. As I am still learning all of this, I find it hard to determine when the instructions are more or less the same, or when they differ when using Fermentrack specifically. Sorry for any confusion I may be bringing, I am very much a noob to this.

Part of the problem is that large chunks of functionality have been added to the Arduino line via hacks over the years. Bluetooth support, WiFi support, even (arguably) LCD support were all tacked on after the fact. Separately, while these additions were being created Raspbian itself has been changing behind the scenes. This means that documentation is fragmented both between the various hacks and the various versions of Raspbian.

Fermentrack supports everything that is supported by the OG BrewPi which is why it should work with the Bluetooth hack - but in the end Bluetooth support is still something of a hack.

The ESP8266 build supports WiFi as a matter of course within the firmware, but would require a different shield. The board @LBussy recommended supports WiFi as a slight hack, but given that it’s built into the Arduino rather than requiring a separate shield/Bluetooth transceiver should in theory work with less trouble. Both should work with Fermentrack, though you would need to use the advanced workflow for the Arduino WiFi shield.
 
I feel like every other thing I read is either for the original BrewPi, BrewPi Remix, or Fermentrack......I am very much a noob to this.

You forgot BrewPiLess!

As a fellow noob, you’re right, it’s tough to keep all this straight. Topics can meander and appear to merge at some points and give you a sense that they are all interchangeable.

I’m in the middle of my Fermentrack build, and I know as I was reading this thread and the Native ESP8266 thread, I did pretty well following along until someone asked about an Arduino board and derailed the thread. It also doesn’t help that their really isn’t a Fermentrack Build thread or a Show Us Your Fermentation Controller Thread.

Thorrak did a darned good job of documenting the build through Fermentrack.com and tinybat.ch

I know throughout my build, I have leaned heavily on those two sites and stuck to the recipe.
 
I don't know what to do. I feel like every other thing I read is either for the original BrewPi, BrewPi Remix, or Fermentrack, so I am just getting a bit lost. I want to stick with Fermentrack, but all of the forums and posts and everything seem to be for getting things working in BrewPi, especially the older posts. As I am still learning all of this, I find it hard to determine when the instructions are more or less the same, or when they differ when using Fermentrack specifically. Sorry for any confusion I may be bringing, I am very much a noob to this.
No matter which one you use, you need to have your Pi talking to your BT, and your BT talking to your Arduino. Once you have that done it will work in either one.

Yes, almost all of the posts are related to BrewPi, but that's because it's been around longer, and because Fermentrack has it's roots there. So, here's how I would do it:
  1. If you followed any part of these instructions that had you create a systemd unit file, remove it by:
    1. Issue the command 'sudo systemctl stop rfcomm0'
    2. Issue the command 'sudo systemctl disable rfcomm0'
    3. Issue the command 'sudo rm /etc/systemd/system/rfcomm0.service'
    4. Issue the command 'sudo systemctl daemon-reload'
  2. Remove the trust and the pairing in the UI
  3. Reboot
  4. Follow these instructions again closely and don't mess with the UI
After that, and after you have verified the rfcomm0 device is the only one showing up again, follow these instructions from @Thorrak:

Try this from a command line on the Raspberry Pi--

First, install screen:
sudo apt-get install screen

Run the following:
screen /dev/rfcomm0 57600

...then, if everything works, you should be connected to the controller (if it is working). Then, just type a single "l". (that' a lowercase L) If the controller works, it will print the LCD screen information
After you get that working, you may proceed with whatever flavor you prefer.
 
Just so I don's mess this up, when you say in the instructions to put the BT in "production configuration" is this AT mode?
No, that means already configured at the correct baud rate and in slave mode. There was another writeup I did which chronologically comes before that but in that thread comes after it which shows how to set that up. I'm assuming that part was done correctly but if it's not that would be step one.

[ETA: I edited the post to make that a little more clear.]
 
Last edited:
Sorry in advance if I'm posting in the wrong thread. I have my Fermentrack set up and was hoping someone could help me dial in the Control Constant settings. I have a 5-gallon carboy filled with water in my chest freezer with the beer probe insulated and taped to the side of the carboy. The Chamber sensor is suspended in the chest freezer for ambient chamber readings and I have a 75w lightbulb in a paint can blank as the heat source.
IMG_20190328_160757.jpg IMG_20190330_094336.jpgIMG_20190328_160804.jpg
I am able to get the low side overshoot within a 1/2 degree of the target temp but the high side overshoots by a degree. An entire cycle takes about 40 min to complete. I'd like to keep the overshoots within a 1/2 degree on either side if possible. Below are my Control Constant settings. Any suggestions would be appreciated.

Min Temperature: 35
Max Temperature: 80
PID: Kp: 0.5
PID: Ki: 0.25
PID: Kd: 1.5
PID: maximum: 0.008
Integrator: Max temp error C: -0.5
Temperature idle range top: 0.098
Temperature idle range bottom: 0.098
Heating target upper bound: -0.461
Heating target lower bound: -0.359
Cooling target upper bound: 0.359
Cooling target lower bound: -0.098
Maximum time in seconds for heating overshoot estimator: 60
Maximum time in seconds for cooling overshoot estimator: 60
Beer fast filter delay time: 3
Beer slow filter delay time: 4
Beer slope filter delay time: 4
Fridge fast filter delay time: 1
Fridge slow filter delay time: 4
Fridge slope filter delay time: 3
Use half steps for rotary encoder? NO
Using light as heater? NO
Temperature format: Fahrenheit
Screen Shot 2019-03-30 at 9.33.01 AM.png
 
It's not really Fermentrack-specific but here's as good as anyplace. :) Two things I believe will help:
  1. Get a real thermowell. Taking a sensor on the side of your fermenter gives you the temp of the side of your fermenter. Once I got a thermowell things were MUCH better.
  2. Put a small fan in there to eliminate dead spots. You won't know you have them, since your sensors are stationary, but it will help keep things sane in there.
 
Can someone post a picture of the desired graph so we have something to compare to?
Well I don't have an example handy, but I am generally able to keep mine +-0.2°F where you can see his overshooting by a full degree.

The good news is, the mass of the liquid will not experience that swing. In order to be able to accurately control things, being able to accurately measure is of course needed.
 

Latest posts

Back
Top