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.
If I start typing I have a hard time stopping. :)

The Arduino still (IMHO) has a slight edge as you can use all of the pins/functionality and still get BT or Wireless (albeit with an add-on), but the ESP8266 sure is simple.

That makes sense. Yes, the shift register is the "chip" and it sits on a shield that plugs in on top of the Arduino.

I just finished making a PR to @Thorrak in order to support the I2C firmware with an update pinList.py. If he doesn't merge it by the time you need it, you can hit that link and download the changed file and update your own local copy.

I honestly have no idea where he does his logic to download the actual firmware so unless someone can point me to it, you'll have to upgrade that manually. Download the firmware here, and flash with the following command:
Code:
/usr/share/arduino/hardware/tools/avrdude -F -e -p atmega328p -c arduino -b 115200 -P /dev/ttyACM0 -U flash:w:"/home/pi/brewpi-arduino-uno-i2c-0.2.12.hex" -C /usr/share/arduino/hardware/tools/avrdude.conf
You may have to change the port, and you will need to make sure you stop Fermentrack before trying to flash.

Depending on how busy I am at work today i'll be giving this a go.
I know this sounds like a stupid question but how does one 'stop' Fermentrack (and do you mean the prog running on the Pi or the prog running on the Arduino?)
 
Haa haa haa
Well I felt like a neanderthal trying to harness fire while stumbling blindly in the dark today.

Sooo
I couldn't figure out how to download the PinList.py file you submitted on GitHib but could work out the relevant code you'd added so inserted the new relevant code into my existing file (well, more specifically I tried but couldn't work out how to get adequate permissions so copied it to the desktop, modified it, then used 'sudo mv' command to rename the original and move my modified version there.)

I then downloaded your I2C Arduino firmware but the command usr/share/arduino/hardware/tools/avrdude etc didn't work. Turns out I don't have a arduino folder or the avrdude within it this command was looking for.

I did find that fermentrack could flash an I2C firmware (version 2.4.10 - 01) which appeared to flash successfully.

Unsurprisingly (given all my attempted work arounds) this hasn't worked.

My hardware display remains blank and Fermentrack shows the following
IMG_20190911_200834.jpg


Any help appreciated
 
Haa haa haa
Well I felt like a neanderthal trying to harness fire while stumbling blindly in the dark today.
Nobody ever learns anything and remembers it when it's easy. :)
I couldn't figure out how to download the PinList.py file you submitted on GitHib
Here's a link to the raw file from which you can cut/paste.
inserted the new relevant code into my existing file (well, more specifically I tried but couldn't work out how to get adequate permissions so copied it to the desktop, modified it, then used 'sudo mv' command to rename the original and move my modified version there.)
Using 'sudo nano path/file' would be the proper way to go about that. Right now I'm not sure who owns that file (although I expect it is your personal user) but that could impact it. I would think that @Thorrak has a "set permissions" script somewhere - that would need to be run at this point. Alternatively, you need to go look at that file and make it like the rest. Taking a WILD stab in the dark, based only on what I would do for BrewPi:
Code:
$ sudo chown brewpi:brewpi /home/brewpi/PinList.py
$ sudo chmod 640 /home/brewpi/PinList.py
inserted the new relevant code into my existing file (well, more specifically I tried but couldn't work out how to get adequateI then downloaded your I2C Arduino firmware but the command usr/share/arduino/hardware/tools/avrdude etc didn't work. Turns out I don't have a arduino folder or the avrdude within it this command was looking for.
Install with:
Code:
sudo apt install avrdude
I did find that fermentrack could flash an I2C firmware (version 2.4.10 - 01) which appeared to flash successfully.
We hope. :) What does the log say when the script starts? I'm assuming the application has the means to watch the BrewPi logs. If not, you can see if the BrewPi method works:
Code:
tail -f /home/brewpi/logs/std*.txt
Basically, at this point we need to see what the logs say.
 
You and my wife .. finding new things for me to do! :p

Maybe after this new project drops. That was subtle huh? You guys will like it. :D
After exploring the GITHUB links provided most projects have a link to their boards.No need for a pcb link in your document. Thanks for all the work you do around here.
 
Nobody ever learns anything and remembers it when it's easy. :)

Here's a link to the raw file from which you can cut/paste.

Using 'sudo nano path/file' would be the proper way to go about that. Right now I'm not sure who owns that file (although I expect it is your personal user) but that could impact it. I would think that @Thorrak has a "set permissions" script somewhere - that would need to be run at this point. Alternatively, you need to go look at that file and make it like the rest. Taking a WILD stab in the dark, based only on what I would do for BrewPi:
Code:
$ sudo chown brewpi:brewpi /home/brewpi/PinList.py
$ sudo chmod 640 /home/brewpi/PinList.py

Install with:
Code:
sudo apt install avrdude

We hope. :) What does the log say when the script starts? I'm assuming the application has the means to watch the BrewPi logs. If not, you can see if the BrewPi method works:
Code:
tail -f /home/brewpi/logs/std*.txt
Basically, at this point we need to see what the logs say.

Thanks so much again. Turns out avrdude was installed already but in a different location. (main file in the bin folder? And .Conf file in the etc file)
Left that as was and ran from there and we seem to be making progress :mug:

Weirdly the ° symbol appears as a square on the Web interface and the timer (for example idling for xxx) appears to reset every so often but I'm making progress (with Lee holding my hand!)

IMG_20190912_100652.jpg
 
The "timer reset" is troubling ... that more than likely means a crash. You really need to check out the stdout/stderr logs and see what it's doing. I had a crash issue before release of the I2C but I got that resolved. It could also be the script restarting the controller so the logs will tell us which.
 
The "timer reset" is troubling ... that more than likely means a crash. You really need to check out the stdout/stderr logs and see what it's doing. I had a crash issue before release of the I2C but I got that resolved. It could also be the script restarting the controller so the logs will tell us which.

Looks like a premature observation.
The Arduino/timer seems to reset when the Pi powers up and links but it was a one off. 5 hours stable now :rock:
IMG_20190912_154645.jpg
 
Good. Yes, the Uno will reset when a serial connection is made. That’s pretty much what happens when you reboot or restart the script.
 
I have a problem with my Tilt dropping off the fermentrack after varying period of time.

The graph just flatlines at what ever the last SG was.
If I go and connect with mobile phone the tilt is still working fine.
If I remove the tilt from the fermentrack and then reinstall it also comes back but the graph restarts? But the tilt is there and reports and logs etc?

I think this is running on RP3, Arduino uno in garage.

What can cause this? I wouldnt think the bluetooth would go to sleep?
The tilt is quire an early version and never given any trouble before?

This has happened in every brew I have done since rebuilding and using the fermentrack. Previously it was brewpi over bluetooth but that all went south when the RPi died and could not reload the SW.

Any help appreciated.
James
 
A work in progress.... I don't own the LCD but I want to get one. So if you have dims (mm preferred) i can get that added.

Printing the rough draft atm.

AV1pJTc.png

01AA6iz.png

TqVKr6V.png


Hopefully I have enough plastic to print this.... The outlets are leftovers from a automated SaltWater aquarium (reef-pi). They actually just pop in.

ALSO! Would love to get the vector file for the Fermentrack logo..... would look nice on the PiCase or this box!
 
Yes.
Not to hijack the thread, but has anyone ever seen pop in 120VAC pop in inlets? I'd like to be able to make my own wallwarts for certain applications.
https://www.amazon.com/dp/B07RRY5MYZ/ref=cm_sw_r_cp_apa_i_sbpHDb3PAPXA6

2 screws and a switch.

They also have panel mount variants.

Also I did see the thingiverse version. But I wanted mine to work with things I had laying around, and to not have cutouts for things I won't need. My build will be headless. No buttons switches or display.
 
Be aware that those AC bulkheads often have a rating that exceeds the actual current carrying capability of the switch module insert. I bought a half dozen similar bulkheads rated at 10A only to find the switch modules were clearly stamped "6A". And indeed, once in service driving the trio of full-size top-freezer fridges in my humble brew space, the switch modules started dying, self-heating themselves to death.

I ended up bypassing the switch modules and just do a line cord pull if necessary (pretty rare, haven't had to do it this year)...

Cheers!
 
Just wanted to make sure you saw it for any ideas. For instance, using a panel mount RJ11 or RJ45 is pretty handy vs cables sticking out. It’s also got the right dimensions for the LCD.
 
Just wanted to make sure you saw it for any ideas. For instance, using a panel mount RJ11 or RJ45 is pretty handy vs cables sticking out. It’s also got the right dimensions for the LCD.

I didn't even think about RJ-11 or RJ-45. I used 3.5mm stereo jacks... had them laying around
 
@muhteeus love the work you're doin! I was looking into doing something exactly like this, but looks like there isn't much of a point now haha

Until you get the actual vector file you're looking for here's an SVG I made from the fermentrack logo. https://drive.google.com/open?id=1J5j-9ugej8T7NgxDnF4rJtFL_8eM4HUt

I will try and do a post about the build with parts and everything. I printed 2 rough copies of the bottom case to dry fit, and the second was great except for the 3.5mm fitting. Now I have 2 failed prints on the final piece.... So once that is done....
 
I will try and do a post about the build with parts and everything. I printed 2 rough copies of the bottom case to dry fit, and the second was great except for the 3.5mm fitting. Now I have 2 failed prints on the final piece.... So once that is done....

Oh the joys of 3D printing haha

Rapid fire question time: What material are you printing in? What are you planning on using for components? Are you planning on releasing the STEP file so others can make the edits necessary for their specific components?
 
Oh the joys of 3D printing haha

Rapid fire question time: What material are you printing in? What are you planning on using for components? Are you planning on releasing the STEP file so others can make the edits necessary for their specific components?

  • PLA, I use PETG sometimes, but it is a pain.
  • I have a build thread here
  • Definitely. I designed this in Autodesk Fusion360. I will post the STL on thingiverse and I can throw in step as well.
 
Phew, this ended up a little long winded, but hopefully I'm not the only one curious about this...

Hi @Thorrak. First off, thank you so much for this awesome solution to brewing temp control. I recently built a controller using a NodeMCU board/sainsmart 2 channel relay and an old laptop with debian installed, and the installation/setup was easier than I expected given my limited experience here. This setup is working great for me at the moment.

At my home, I have a windows 10 server that runs 24x7, and I don't want to switch this to linux or one of the NAS OSs for various reasons that I've already vetted out. I'd like to get fermentrack working here instead of having the separate laptop. One option, of course is to run a virtual machine, which I can set up no problem, but I'd prefer to avoid the additional overhead given one of the many functions of the server is transcoding for Plex and I already have one other VM running.

This got me thinking about Windows Subsystem for Linux (WSL), so I was working on that last night. Installed debian for WSL and got a good ways through the semi-auto/manual installation steps. (I ran into an error using the single line or semi-auto install method where the install.sh would give me an error that it couldn't connect to github, and to make sure I was connected to the internet.)

So, after all this, my questions are:

1. Has anyone gotten the standard automatic fermentrack installation working on windows via WSL?

2. I'm not linux savvy enough to make it through the full manual installation without help. I made it close to the end of the documented steps and then started to get an error where it couldn't find Django (even though I have it installed both in and out of the python venv). Does anyone have a more complete documentation for how to install manually?

3. @Thorrak @garzlok For this quote below, was this documentation for a full install in a python virtual environment in native windows? If so, are you able to share this tutorial?

@garzlok actually taught me about one this past weekend as part of the tutorial he wrote documenting how to set up Fermentrack from within windows.
 
3. @Thorrak @garzlok For this quote below, was this documentation for a full install in a python virtual environment in native windows? If so, are you able to share this tutorial?

Unfortunately, no, my documentation was a bit more remedial. I simply wrote a tutorial on how to install Raspbian to a RPi3 from a Windows 7 Environment. I will be more than happy to share the file with you, but it’s not what your looking for.
 
For anyone on the fence on a BrewPi build.... these things are PRECISE.

±0.25°F !!!!

I am running the default settings. 25W heater, no fans, 5.5cuft Haier Deep Freeze.... This is in central Texas btw.... Just look below.

gL3mTr3.png
 
For anyone on the fence on a BrewPi build.... these things are PRECISE.

±0.25°F !!!!

I am running the default settings. 25W heater, no fans, 5.5cuft Haier Deep Freeze.... This is in central Texas btw.... Just look below.

gL3mTr3.png

How many gallons is your fermenter?

Love graphs that tight though. :rock:
 
Hi all, I have Fermentrack running on a pi 3 A+, 512MB ram, latest rasbian full install (maybe that is part of the problem). I had to do a few tweaks to get Fermentrack to work with Bluetooth (specifically, 'sudo apt-get install libbluetooth-dev', then install pybluez); I think this is an issue with the latest raspbian.

It seems to crash after a few days; I think it runs out of memory. It happens quicker if there is something actively running (ie: it is tracking a Tilt). I'm not using it for fermentation control at the moment, and just tracking my gravity. I think the python processe(s) are leaking; once it gets into the bad state it starts to swap a lot.

Anyone else experiencing this?

I'm pretty new to python and django, so debugging it is a bit tricky. I'm working on running it locally on my mac so I can poke at it.

-corbin
 
Hi all, I have Fermentrack running on a pi 3 A+, 512MB ram, latest rasbian full install (maybe that is part of the problem). I had to do a few tweaks to get Fermentrack to work with Bluetooth (specifically, 'sudo apt-get install libbluetooth-dev', then install pybluez); I think this is an issue with the latest raspbian.

It seems to crash after a few days; I think it runs out of memory. It happens quicker if there is something actively running (ie: it is tracking a Tilt). I'm not using it for fermentation control at the moment, and just tracking my gravity. I think the python processe(s) are leaking; once it gets into the bad state it starts to swap a lot.

Anyone else experiencing this?

When you say it crashes, what exactly happens and what do you need to do to fix it?
 
When you say it crashes, what exactly happens and what do you need to do to fix it?

The symptom is the server goes down. I can't ssh in. The fix is a reboot (unplug the power and plug it back in).

/var/log/messages starts showing callstacks & the stuff below; it just fills the swap till space is gone (unless I'm reading that wrong).

It gets to critical mass when the cron job can't alloc mem, and goes crazy creating cron, python, sh, updateCronCircus.

Log bits:

Oct 1 00:54:49 drinkduff kernel: [405149.477394] [<8023c6e8>] (out_of_memory) from [<80242b40>] (__alloc_pages_nodemask+0x1024/0x1178)
...
Oct 1 00:56:00 drinkduff kernel: [405149.477475] Mem-Info:
Oct 1 00:56:05 drinkduff kernel: [405149.477485] active_anon:20 inactive_anon:21 isolated_anon:0
Oct 1 00:56:09 drinkduff kernel: [405149.477485] active_file:32 inactive_file:395 isolated_file:0
Oct 1 00:56:15 drinkduff kernel: [405149.477485] unevictable:4 dirty:0 writeback:19 unstable:0
Oct 1 00:56:28 drinkduff kernel: [405149.477485] slab_reclaimable:5772 slab_unreclaimable:9630
Oct 1 00:56:33 drinkduff kernel: [405149.477485] mapped:28 shmem:0 pagetables:1993 bounce:0
Oct 1 00:56:37 drinkduff kernel: [405149.477485] free:6039 free_pcp:64 free_cma:1487
Oct 1 00:56:41 drinkduff kernel: [405149.477493] Node 0 active_anon:80kB inactive_anon:84kB active_file:128kB inactive_file:1580kB unevictable:16kB isolated(anon):0kB isolated(file):0kB mapped:112kB
dirty:0kB writeback:76kB shmem:0kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no
Oct 1 00:56:44 drinkduff kernel: [405149.477504] Normal free:24156kB min:16384kB low:20480kB high:24576kB active_anon:376kB inactive_anon:304kB active_file:140kB inactive_file:1116kB unevictable:16k
B writepending:0kB present:458752kB managed:441184kB mlocked:16kB kernel_stack:2680kB pagetables:7972kB bounce:0kB free_pcp:256kB local_pcp:120kB free_cma:5948kB
Oct 1 00:56:48 drinkduff kernel: [405149.477506] lowmem_reserve[]: 0 0
Oct 1 00:56:53 drinkduff kernel: [405149.477514] Normal: 276*4kB (UMEHC) 519*8kB (UMEHC) 808*16kB (UMEHC) 29*32kB (MC) 11*64kB (MC) 5*128kB (C) 5*256kB (C) 3*512kB (C) 1*1024kB (C) 0*2048kB 0*4096kB
= 24296kB
Oct 1 00:57:01 drinkduff kernel: [405149.477560] 551 total pagecache pages
Oct 1 00:57:11 drinkduff kernel: [405149.477564] 50 pages in swap cache
Oct 1 00:57:16 drinkduff kernel: [405149.477567] Swap cache stats: add 15055945, delete 15056317, find 9426820/18000504
Oct 1 00:57:19 drinkduff kernel: [405149.477570] Free swap = 548680kB
Oct 1 00:57:25 drinkduff kernel: [405149.477572] Total swap = 901116kB
Oct 1 00:57:32 drinkduff kernel: [405149.477574] 114688 pages RAM
 
I've also tracked memory for a while before the crash using 'top' and a stupid script:
for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | sort -k 2 -n -r

we start out good:
circusd 4916 kB
python3 2908 kB
python 2244 kB
...

Then later the two python processes start growing:
python 16268 kB
python 16216 kB
...

python 17048 kB
python 16268 kB

...
(well, one is growing). It *might* be okay, and be garage collected, so I'm not entirely sure if that is really the problem. I need to debug it (and learn how to do that). I forget which python process it is, but it is one of these two:

/home/fermentrack/venv/bin/python /home/fermentrack/fermentrack/manage.py run_huey
/home/fermentrack/venv/bin/python /home/fermentrack/fermentrack/utils/processmgr.py

-Corbin
 
Hello to all,

I am in need of some assistance with my Fermentrack setup. I have two Tilt hydrometers connected, one currently tracking a brew. Everything seems to be functioning. The data for the brew looks good.

I just want to change the polling frequency. So I enter the Django admin page, select tilt configurations. I see both Tilts listed. In the "sensor" column I select the tilt I want to change and the "Change Tilt Configuration" page displays.

Great, just what I wanted. I change the value in the "Polling Frequency" field and save the changes.

I then receive an error "Please correct the error below", Tiltbridge field "requires entry" (it has the default "--------" entry). The "Connection type" is Bluetooth but it insists that I need to add Tiltbridge device name.

I went a step further and deleted the configuration for the unused Tilt, thinking maybe I could just add a new one. But when I try to add a new configuration I get the same error when attempting to save it.

10/2/19, 1:30PM
A little update.
If I add a "dummy" Tiltbridge device and use that name to fill in the "Tiltbridge" field I can then save the configuration.

Any help would be much appreciated.

Tig
 
Last edited:
Hello to all,


I then receive an error "Please correct the error below", Tiltbridge field "requires entry" (it has the default "--------" entry). The "Connection type" is Bluetooth but it insists that I need to add Tiltbridge device name.

Any help would be much appreciated.

Tig

Looks like it is just a bug..I can also reproduce it. This diff seems to fix it for me; I dropped it in my fork on GitHub. https://github.com/corbinstreehouse/fermentrack -- I don't recommend using my fork yet, as I haven't tested it much.

diff --git a/gravity/models.py b/gravity/models.py
index 1ca8763..f92cd81 100644
--- a/gravity/models.py
+++ b/gravity/models.py
@@ -615,7 +615,7 @@ class TiltConfiguration(models.Model):
connection_type = models.CharField(max_length=32, choices=CONNECTION_CHOICES, default=CONNECTION_BLUETOOTH,
help_text="How should Fermentrack connect to this Tilt?")

- tiltbridge = models.ForeignKey('TiltBridge', on_delete=models.SET_NULL, null=True, default=None,
+ tiltbridge = models.ForeignKey('TiltBridge', on_delete=models.SET_NULL, null=True, default=None, blank=True,
help_text="TiltBridge device to use (if any)")

# Switching calibration to use the same equation-based approach as used on iSpindel. For now, going to start out
 
My pi crashing has led me to "port" Fermentrack over to macOS. Most stuff I want to do should be wireless, so I started to wonder why I even need a pi. Plus, debugging on the Mac is so much easier!

I've got a lot of changes over at: https://github.com/corbinstreehouse/fermentrack

Some are general bug fixes; just errors and exception fixes that were missed.

Some are for portability. For example, circus needs another ini file to allow the install to be "anywhere" on the system, so I abstracted it a bit.

aio for BLE (Tilt discovery) doesn't work on the Mac, so I wrote a new "tilt_monitor_macos.py" which uses PyObjc to look for tilts.

I need to fix some of the logging stuff, but it is getting pretty close to working! I'll then add a couple of LaunchAgents: one to start redis, and another to run circusd. Right now I'm running them by hand.

The code is pretty portable, and I'd be happy to contribute it back to the main repo at some point, and write up some Mac OS setup instructions. Let me know if you are interested.

Corbin
 
FWIW, i finally got fermentrack installed on my 1bbl conical.
so far, so good
 

Attachments

  • IMG_0694.jpg
    IMG_0694.jpg
    1.9 MB · Views: 59
  • IMG_0700.jpg
    IMG_0700.jpg
    1.9 MB · Views: 57
  • IMG_0701.jpg
    IMG_0701.jpg
    1.7 MB · Views: 57
At my home, I have a windows 10 server that runs 24x7, and I don't want to switch this to linux or one of the NAS OSs for various reasons that I've already vetted out. I'd like to get fermentrack working here instead of having the separate laptop. One option, of course is to run a virtual machine, which I can set up no problem, but I'd prefer to avoid the additional overhead given one of the many functions of the server is transcoding for Plex and I already have one other VM running
First, I take exception to using"Windows 10" and "Server" in line with each other. :)

My recommendation would be a VM - and if you have not explored using VBoxVmService it's a pretty nice cohort to Oracle VirtualBox. Slap Raspberry Pi Desktop on there and Bob's your uncle. You only need to put minimal resources against a headless installation. I have many of these running on a gaming rig.

I did some work with Windows/WAMP and BrewPi a while back which may or may not help.

Honestly though - buy an RPi Zero W and be done with it.
 

Latest posts

Back
Top