HOWTO - Make a BrewPi Fermentation Controller For Cheap

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.
Status
Not open for further replies.
Just detected another problem with my BrewPi Remix. Since a few days I've noticed that the sensor of my beer was going crazy it said that the temperature of the beer went up to 85°C. I know that if a sensor is disconnected it give the same result (i.e. 85°C) so I thought that it could be a false contact between my arduino Uno and the sensor.
upload_2019-9-25_22-27-10.png

But today I was just in front of my chamber and I noticed that everything went down (display, fan, heating,...) and after a few second it all came back but the temperature of the beer was again at 85°C and then decreased slowly to normal 20°C.
When I checked the graphics this interruption was visual (see screenshot). I've checked the uptime of my RPI and it was running for more then 14 days.
upload_2019-9-25_22-26-8.png


Did someone had the same problem? Or how can I find out what could be the cause of this?
 
What firmware version are you running, what scripts version are you running, what do the logs say, what kind of power supply are you using for the Arduino?
 
Now that I have a functioning test setup I would like to see what people recommend in regard to settings in brewpi-remix for a glycol setup.

I currently use a PID ( SSbrewtech MTSS system ) that powers a 12v pump. When the PID calls for cooling the pump cycles glycol that is usually at 26 degrees F though an internal coil in the unitank cooling the fermenting beer to the given set temperature. The chiller uses its own PID and is not a function of the system it is self contained. The MTSS system uses a single temp probe in a centrally located thermowell to the unitank.


Using the brewpi-remix chamber setup, I am not sure what the best way to setup the devices would be.

My initial thought is as follows:
- a temp probe in the central thermowell that would be the "beer temp"
- a temp probe in a secondary thermowell also located in the unitank "chamber temp"

These two probes would essentially always read the same, but if the beer warmed to where the "beer temp" was above the set point threshold the relay would fire and cooling would begin.

I am not sure as to what settings should be altered in the advanced settings menu to best accomplish this method of cooling.

Does anyone here have experience with a similar setup? Or advise on how best to set this up?

Thank you all.
 
First, you’re going to have to get the firmware which supports it. Then you will have to follow my instructions for a starting point, then we can talk about what to modify.

Physically, you will use a beer probe only, and control your pump via the controller. If you want a probe to monitor your glycol your will use the “room” sensor.

I have a Firmware version for you to use, I need to get it where it’s available to you.
 
What firmware version are you running, what scripts version are you running, what do the logs say, what kind of power supply are you using for the Arduino?

Ok now I see this in the log file:

Terminating due to fatal serial error
2019-09-25 01:55:08 Starting BrewPi.
Terminating due to fatal serial error
2019-09-25 08:30:08 Starting BrewPi.
Terminating due to fatal serial error
2019-09-25 11:10:08 Starting BrewPi.
Terminating due to fatal serial error
2019-09-25 12:25:08 Starting BrewPi.
Terminating due to fatal serial error
2019-09-25 18:50:08 Starting BrewPi.
Terminating due to fatal serial error
2019-09-25 20:45:08 Starting BrewPi.

The firmware version is brewpi-arduino-uno-i2c-0.2.12 and were can I find the version of the script?
The Arduino Uno is connected to the RPI with a USB cable for power.
 
Ok now I see this in the log file:

Terminating due to fatal serial error
2019-09-25 01:55:08 Starting BrewPi.
Terminating due to fatal serial error
2019-09-25 08:30:08 Starting BrewPi.
Terminating due to fatal serial error
2019-09-25 11:10:08 Starting BrewPi.
Terminating due to fatal serial error
2019-09-25 12:25:08 Starting BrewPi.
Terminating due to fatal serial error
2019-09-25 18:50:08 Starting BrewPi.
Terminating due to fatal serial error
2019-09-25 20:45:08 Starting BrewPi.

The firmware version is brewpi-arduino-uno-i2c-0.2.12 and were can I find the version of the script?
The Arduino Uno is connected to the RPI with a USB cable for power.
Or is this the version of the script?
upload_2019-9-25_23-1-8.png
 

Attachments

  • upload_2019-9-25_23-0-3.png
    upload_2019-9-25_23-0-3.png
    6.7 KB · Views: 20
Inside your BrewPi directory, execute:

sudo git tag

The highest number is the current version.

Also, I need to see what the log says before that error.
 
First, you’re going to have to get the firmware which supports it. Then you will have to follow my instructions for a starting point, then we can talk about what to modify.

Physically, you will use a beer probe only, and control your pump via the controller. If you want a probe to monitor your glycol your will use the “room” sensor.

I have a Firmware version for you to use, I need to get it where it’s available to you.


I presume you mean firmware for the Arduino Uno? I am currently using brewpi-arduino-uno-i2c-0.2.12.hex


I can certainly use just the one "beer" temp probe, I wasn't sure that they weren't tied together logically.


Thank you.
 
Yes. There’s a new version. Nobody has done this before because you will be the first one to whom I will deliver this version of the Firmware.

When you are in Beer constant and don’t have a chamber sensor, the chamber sensor will use the beer sensor (which we want in this case.)
 
Yes. There’s a new version. Nobody has done this before because you will be the first one to whom I will deliver this version of the Firmware.

When you are in Beer constant and don’t have a chamber sensor, the chamber sensor will use the beer sensor (which we want in this case.)


Sounds great, I am up for the challenge.
 
Inside your BrewPi directory, execute:

sudo git tag

The highest number is the current version.

Also, I need to see what the log says before that error.

pi@brewpi:/home/brewpi/left $ sudo git tag
0.4.5
0.5.0
0.5.1
0.5.1.1
0.5.1.2
0.5.2.0
0.5.3.0
0.5.3.1

full error log see attachment stderr.txt
 

Attachments

  • stderr.txt
    16.2 KB · Views: 10
Thanks for the support day_trippr and LBussy. I reinstalled raspbian and BrewPi Remix. At the end I had it reset the Arduino with the current image. It was still acting up so I initiated the Reset Arduino to factory defaults in Maintenance Panel/ Advanced Settings. I don't know why but that did the trick! It's been running fine since Tuesday night!!!

Thanks again for all that you guys do on this project. I've actually been running mine since March of 2015 and this is the first major issue that I've had.

Dave
 
full error log see attachment stderr.txt
It appears that either the Arduino/cable is bad, or the port is misconfigured or incorrect. Have you done any "tweaking" to the config file?

What happens when you issue the command 'sudo systemctl status left'?
 
Sounds great, I am up for the challenge.
There's an alpha build in the devel branch of firmware that has this glycol support. Be sure to grab the right one for your shield, you'll have to flash manually for now:

0.2.13 (alpha)

Do not use this in production, it is an alpha commit only. The glycol variant may burn up your compressor if you use it on a standard refrigerator setup.

This change enables compiler macros to set parameters suitable for glycol use. This means there are two new firmware versions; a "glycol" variant for both I2C and RevC. When using the glycol, zero out the PID values (`Kp`, `Ki`, `Kd`) in order to make "Fridge setpoint" equal to "Beer setpoint." Use only the beer sensor, the refrigerator temperature will get its value internally from the beer sensor. If you wish to monitor the glycol temperature, use the "room" sensor. Control the pump as "cool" via the relay.

Features
  • Add support for Glycol control

Enhancements
  • Update to atmelavr 1.15.0 from 1.14.0.

Incidentally, someone else reported the exact error you were having flashing the firmware so I'm going to push a fix for that as soon as I get my dev Pi working again.
 
It appears that either the Arduino/cable is bad, or the port is misconfigured or incorrect. Have you done any "tweaking" to the config file?

No I didn't tweak the config file.
In one of the screenshots you could see that it went smoothly for several days in the beginning and I didn't changed anything after that.

What happens when you issue the command 'sudo systemctl status left'?

pi@brewpi:~ $ sudo systemctl status left
● left.service - BrewPi Remix daemon for: left
Loaded: loaded (/etc/systemd/system/left.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2019-09-11 21:20:17 CEST; 2 weeks 1 days ago
Docs: https://docs.brewpiremix.com/
Main PID: 582 (bash)
Tasks: 3 (limit: 2200)
Memory: 41.9M
CGroup: /system.slice/left.service
├─ 582 /bin/bash /home/brewpi/left/utils/doBrewPi.sh -d
└─19670 python -u /home/brewpi/left/brewpi.py --log

Sep 26 12:10:08 brewpi left[582]: Starting BrewPi.
Sep 26 17:30:08 brewpi left[582]: Logging to /home/brewpi/left/logs/.
Sep 26 17:30:08 brewpi left[582]: Output will not be shown in console.
Sep 26 17:30:08 brewpi left[582]: Starting BrewPi.
Sep 26 19:10:08 brewpi left[582]: Logging to /home/brewpi/left/logs/.
Sep 26 19:10:08 brewpi left[582]: Output will not be shown in console.
Sep 26 19:10:08 brewpi left[582]: Starting BrewPi.
Sep 26 20:20:08 brewpi left[582]: Logging to /home/brewpi/left/logs/.
Sep 26 20:20:08 brewpi left[582]: Output will not be shown in console.
Sep 26 20:20:08 brewpi left[582]: Starting BrewPi.
pi@brewpi:~ $

The fermentation was finished yesterday so now I can do some tests.
I will start with a new USB cable and I have a spare arduino uno (the lost one did arrive finally) so I can replace it too.
 
Last edited:
We can check some additional things before replacing parts:

Running 'sudo cat /etc/udev/rules.d/99-arduino.rules' should give you something like this (serial number will be different):
Code:
SUBSYSTEM=="tty", ATTRS{serial}=="75533343336351208261", SYMLINK+="left"
Then, 'ls -al /dev/left' should look like this:
Code:
lrwxrwxrwx 1 root root 7 Sep 27 03:55 /dev/left -> ttyACM0
Assuming those look ok, you can run a serial monitor to see what you get:
Code:
sudo /home/brewpi/left/terminal.py
Enter 's' to allow you to enter a command, then enter a safe command like 'n'. You should see something like:
Code:
Type the string you want to send to the controller: n
Sending: n
N:{"v":"0.2.11","n":"af7545e","s":2,"y":0,"b":"s","l":"3"}
Enter 'q' to quit.

If that works, it would be handy to see the contents of the stdout.log corresponding to the errors.

The stderr.txt is interesting because of the frequency of the errors, especially networking errors. There's even some from eth0 which I would have expected to be filtered out. What's your network setup?
 
We can check some additional things before replacing parts:

Running 'sudo cat /etc/udev/rules.d/99-arduino.rules' should give you something like this (serial number will be different):
Code:
SUBSYSTEM=="tty", ATTRS{serial}=="75533343336351208261", SYMLINK+="left"
Then, 'ls -al /dev/left' should look like this:
Code:
lrwxrwxrwx 1 root root 7 Sep 27 03:55 /dev/left -> ttyACM0
Assuming those look ok, you can run a serial monitor to see what you get:
Code:
sudo /home/brewpi/left/terminal.py
Enter 's' to allow you to enter a command, then enter a safe command like 'n'. You should see something like:
Code:
Type the string you want to send to the controller: n
Sending: n
N:{"v":"0.2.11","n":"af7545e","s":2,"y":0,"b":"s","l":"3"}
Enter 'q' to quit.

If that works, it would be handy to see the contents of the stdout.log corresponding to the errors.

The stderr.txt is interesting because of the frequency of the errors, especially networking errors. There's even some from eth0 which I would have expected to be filtered out. What's your network setup?

pi@brewpi:~ $ sudo cat /etc/udev/rules.d/99-arduino.rules
SUBSYSTEM=="tty", ATTRS{serial}=="757353530383518120F0", SYMLINK+="left"

pi@brewpi:~ $ ls -al /dev/left
lrwxrwxrwx 1 root root 7 Sep 26 20:20 /dev/left -> ttyACM0

pi@brewpi:/home/brewpi/left/utils $ sudo /home/brewpi/left/utils/terminal.py

Using default config path ./settings/config.cfg, to override use:
/home/brewpi/left/utils/terminal.py <config file full path>

******** BrewPi Terminal *******
This simple Python script lets you send commands to the controller. It
also echoes everything the controller returns. On known debug ID's in
JSON format, it expands the messages to the full message.

Press 's' to send a string to the controller, press 'q' to quit
2019-09-27 13:34:14 Opening serial port.
Type the string you want to send to the controller: n
Sending: n
N{":021""""d62",s:,y:"":s,l:""

I hope you meant the files stderr.txt and stdout.txt these were the only log files I could find and I've attached them.
 

Attachments

  • stdout.txt
    18.8 KB · Views: 10
  • stderr.txt
    321.9 KB · Views: 8
There's an alpha build in the devel branch of firmware that has this glycol support. Be sure to grab the right one for your shield, you'll have to flash manually for now:

0.2.13 (alpha)

Do not use this in production, it is an alpha commit only. The glycol variant may burn up your compressor if you use it on a standard refrigerator setup.

This change enables compiler macros to set parameters suitable for glycol use. This means there are two new firmware versions; a "glycol" variant for both I2C and RevC. When using the glycol, zero out the PID values (`Kp`, `Ki`, `Kd`) in order to make "Fridge setpoint" equal to "Beer setpoint." Use only the beer sensor, the refrigerator temperature will get its value internally from the beer sensor. If you wish to monitor the glycol temperature, use the "room" sensor. Control the pump as "cool" via the relay.

Features
  • Add support for Glycol control

Enhancements
  • Update to atmelavr 1.15.0 from 1.14.0.

Incidentally, someone else reported the exact error you were having flashing the firmware so I'm going to push a fix for that as soon as I get my dev Pi working again.

I have flashed my Uno manually now to modify the brewpi-remix settings...

I had issues with the script not running until I performed the update command from my directory:
pi@brewpi:/home/brewpi/ferm/utils $ sudo ./doUpdate.sh

Once done and not flashing the controller at the end the script would start.
 
Last edited:
doUpdate is sort of like rebooting a Windows server. Always a good idea to run it when you have issues.

So you’ve got it running at least?
 
I have flashed my Uno manually now to modify the brewpi-remix settings.
There's an alpha build in the devel branch of firmware that has this glycol support. Be sure to grab the right one for your shield, you'll have to flash manually for now:

0.2.13 (alpha)

Do not use this in production, it is an alpha commit only. The glycol variant may burn up your compressor if you use it on a standard refrigerator setup.

This change enables compiler macros to set parameters suitable for glycol use. This means there are two new firmware versions; a "glycol" variant for both I2C and RevC. When using the glycol, zero out the PID values (`Kp`, `Ki`, `Kd`) in order to make "Fridge setpoint" equal to "Beer setpoint." Use only the beer sensor, the refrigerator temperature will get its value internally from the beer sensor. If you wish to monitor the glycol temperature, use the "room" sensor. Control the pump as "cool" via the relay.

Features
  • Add support for Glycol control

Enhancements
  • Update to atmelavr 1.15.0 from 1.14.0.

Incidentally, someone else reported the exact error you were having flashing the firmware so I'm going to push a fix for that as soon as I get my dev Pi working again.

LBussy, thank you so much for your work on this...

I am having an issue with the relay firing upon cooling call.

I don't think the call for cooling is happening. I have successfully flashed my unit and updates my brewpi-remix. I have set the PID ( KP, KI, KD ) values to "0". I have the devices setup as shown here:
upload_2019-9-27_14-31-22.png


I have the device 1 temp probe in ice water for testing... the device 0 "beer temp probe" is in ambient air.

I have the brewpi-remix set to beer constant with a temp setting of 50.0 F

But I do not get a cooling cycle...

If I invert the pin type of the device I do get the correct relay to fire so it is wired correctly.
 
Did you stop the script first? If not, do that please. Sorry if I did not mention that.
No I didn't so I stopped the script and run the commands again:

pi@brewpi:~ $ sudo cat /etc/udev/rules.d/99-arduino.rules
SUBSYSTEM=="tty", ATTRS{serial}=="757353530383518120F0", SYMLINK+="left"

pi@brewpi:~ $ ls -al /dev/left
lrwxrwxrwx 1 root root 7 Sep 26 20:20 /dev/left -> ttyACM0

pi@brewpi:~ $ sudo /home/brewpi/left/utils/terminal.py

Using default config path ./settings/config.cfg, to override use:
/home/brewpi/left/utils/terminal.py <config file full path>

******** BrewPi Terminal *******
This simple Python script lets you send commands to the controller. It
also echoes everything the controller returns. On known debug ID's in
JSON format, it expands the messages to the full message.

Press 's' to send a string to the controller, press 'q' to quit
2019-09-27 22:29:13 Opening serial port.
Type the string you want to send to the controller: n
Sending: n
Debug message received: WARNING 2: Temperature sensor disconnected pin 14, address 28AAC5124F1401A5.

And the latest version of the logfiles are uploaded.

Is there a problem with the Temperature sensor address 28AAC5124F1401A5?
Did not had the time to check which sensor this is.
 

Attachments

  • stderr.txt
    321.9 KB · Views: 9
  • stdout.txt
    18.8 KB · Views: 8
Debug message received: WARNING 2: Temperature sensor disconnected pin 14, address 28AAC5124F1401A5

Is there a problem with the Temperature sensor address 28AAC5124F1401A5?
Did not had the time to check which sensor this is.
It does look like there may be a loose connection there. On the other hand, it's not completely out of the blue for a sensor to sporadically not reply in time which generates that output. All in all, not a comprehensive data set.

I've attached a hex file here (in a zip) which has been compiled with verbose logging. You can drop it in Pi's home and issue the following command:
Code:
/usr/share/arduino/hardware/tools/avrdude -F -e -p atmega328p -c arduino -b 115200 -P /dev/left -U flash:w:"/home/pi/brewpi-arduino-uno-i2c-0.2.13.hex" -C /usr/share/arduino/hardware/tools/avrdude.conf
(assuming I have not typo'd)

It will blow up your devices so those will need to be re-set. This might give you more information. Also, make the following change within brewpi.py on what should be line 245:
Code:
-    sys.stdout = open(logPath + 'stdout.txt', 'w', 0)
+    sys.stdout = open(logPath + 'stdout.txt', 'a', 0)
(change the 'w' to an 'a')

This will prevent overwriting the stdout.txt when the script restarts.

Let that run a bit and let's see what happens.
 

Attachments

  • brewpi-arduino-uno-i2c-0.2.13.hex.zip
    29.3 KB · Views: 16
fwiw, when a ds18b20 returns "85°C" (185°F) it's because it hasn't completed its internal power-on sequence.
Thus, getting those errant readings on a running system typically indicates a power problem...

Cheers!
 
Would you please post your stddout.txt and stderr.txt?
I woul be happy to... Working from my phone at the moment but I can vpn in... Is there a good way to do that from the interface or only ssh? If so can you explain, please pardon my ignorance.
 
LBussy, thank you so much for your work on this...

I am having an issue with the relay firing upon cooling call.

I don't think the call for cooling is happening. I have successfully flashed my unit and updates my brewpi-remix. I have set the PID ( KP, KI, KD ) values to "0". I have the devices setup as shown here:
View attachment 645907

I have the device 1 temp probe in ice water for testing... the device 0 "beer temp probe" is in ambient air.

I have the brewpi-remix set to beer constant with a temp setting of 50.0 F

But I do not get a cooling cycle...

If I invert the pin type of the device I do get the correct relay to fire so it is wired correctly.

You need a chamber temp sensor. I only see a beer sensor and a room sensor...

Edited to add: Unless Lee changed the control, the room temp sensor does nothing for the control algorithm. And if you are running in anything other than Beer Constant, you have to have a chamber and Beer Sensor.

Edit 2: Sorry, I missed that you are running in Beer constant. If I were you, I'd reassign the Room Temp as your chamber temp and test that way. (to rule out not having a chamber temp as a problem)
 
You need a chamber temp sensor. I only see a beer sensor and a room sensor...

Yes that is true, I am using a new "alpha" glycol firmware as discussed earlier in this thread.

This configuration is appropriate for that seanario.
 
I woul be happy to... Working from my phone at the moment but I can vpn in... Is there a good way to do that from the interface or only ssh? If so can you explain, please pardon my ignorance.
To easily send logs, you can issue the following command
Code:
$ cat /home/brewpi/logs/stdout.txt | pastebinit
or
Code:
$ cat /home/brewpi/logs/stdout.txt | pastebinit
{you will probably see some warnings here}

The output will be a URL you can share like this one: http://paste.debian.net/1103085/
Best I can do with my phone quickly...
This *looks* okay so far, but I'd need to see the rest of the logs.
Edit 2: Sorry, I missed that you are running in Beer constant. If I were you, I'd reassign the Room Temp as your chamber temp and test that way. (to rule out not having a chamber temp as a problem)
That's a good idea - give that a shot as well.
 
To easily send logs, you can issue the following command
Code:
$ cat /home/brewpi/logs/stdout.txt | pastebinit
or
Code:
$ cat /home/brewpi/logs/stdout.txt | pastebinit
{you will probably see some warnings here}

The output will be a URL you can share like this one: http://paste.debian.net/1103085/

This *looks* okay so far, but I'd need to see the rest of the logs.

That's a good idea - give that a shot as well.

Sorry no additional logs yet...

But I did try changing it to chamber mode... Same result.
 
To easily send logs, you can issue the following command
Code:
$ cat /home/brewpi/logs/stdout.txt | pastebinit
or
Code:
$ cat /home/brewpi/logs/stdout.txt | pastebinit
{you will probably see some warnings here}

The output will be a URL you can share like this one: http://paste.debian.net/1103085/

This *looks* okay so far, but I'd need to see the rest of the logs.


That's a good idea - give that a shot as well.



my sdtout.txt

http://paste.debian.net/1103089/

my sdterr.txt
http://paste.debian.net/1103090/


Thank you for your assistance....
 
Status
Not open for further replies.
Back
Top