# PorkPi - Latest batch



## hjbct (Oct 1, 2016)

My Raspberry Pi managed curing chamber is working a treat now.

Just loaded my latest batch of experiments:

From L to R:

1. Lonzino (plus a small one hiding behind)

2. Picnic Procuitto

3. Goat Leg Violin

4. Lonzo

All simple cure : salt, pepper (lots of), Cure #2.  I'm trying Texel DCM for the 1st time and

also using Bactoferm 600.

All cased in collagen casings - still wet in the photo but will shrink to fit.













20161001_115507.jpeg



__ hjbct
__ Oct 1, 2016


----------



## SmokinAl (Oct 1, 2016)

NICE!!

Al


----------



## dirtsailor2003 (Oct 1, 2016)

Should be some tasty treats!


----------



## atomicsmoke (Oct 1, 2016)

Ha ha. Never thought I would see Raspberry Pi mentioned on this forum.

Can you describe the build a little (humi/temp sensors, humidifiers)?

Whats the difference between lonzino and lonzo?

I assume goat violin is a prosciutto-like meat?

Awesome collection. Cant wait to hear your opinion on DCM...


----------



## hjbct (Oct 1, 2016)

LOL - yes, I may have geeked out a bit on this one!

The R Pi measures temp and RH and controls fridge (cooling dehumidifies), heat (2x 40 watt seed pads), circulation fans, a USB humidifier, an air injection pump (fresh air) and 4 load cells to monitor weight loss.  It reads control parameters and writes results out to Google sheets.  About 1k lines of Python code.  I intend to write this up one of these days.  This batch will be about the 5th batch - seems to work very well.  Some fine tuning along the way, but pretty stable and predictable cures now.  The goat violin and picnic prosciutto are my first long term experiments.  I've mainly done Capocollo  and lonzo.  For lonzo, I use pork loin - the lonzino are pork tenderloin (not sure if that is to correct name).  The goat violin should be similar to prosciutto - just goatier!  It is called a violin because when passed around with a knife, the action of slicing is reminiscent of playing the violin.

This the Google Sheet.  Saves all the data and parameters.  I also have a drying schedule so I can drop the RH over the course of a number few days - hopefully minimizing case hardening.  Oh, and of course - it has its own Gmail account!  It emails me if anything crashes (I have a watchdog so if anything crashes, it reboots).  I can also send it an email to reboot, or shutdown - pretty handy when travelling!!

The top line is RH.

  













Capture.PNG



__ hjbct
__ Oct 1, 2016


----------



## redheelerdog (Oct 1, 2016)

That is really cool meat tech. I love it!


----------



## smokesontuesday (Oct 1, 2016)

hjbct said:


> LOL - yes, I may have geeked out a bit on this one!
> 
> The R Pi measures temp and RH and controls fridge (cooling dehumidifies), heat (2x 40 watt seed pads), circulation fans, a USB humidifier, an air injection pump (fresh air) and 4 load cells to monitor weight loss.  It reads control parameters and writes results out to Google sheets.  About 1k lines of Python code.  I intend to write this up one of these days.  This batch will be about the 5th batch - seems to work very well.  Some fine tuning along the way, but pretty stable and predictable cures now.  The goat violin and picnic prosciutto are my first long term experiments.  I've mainly done Capocollo  and lonzo.  For lonzo, I use pork loin - the lonzino are pork tenderloin (not sure if that is to correct name).  The goat violin should be similar to prosciutto - just goatier!  It is called a violin because when passed around with a knife, the action of slicing is reminiscent of playing the violin.
> 
> ...


Love seeing the Pi starting to make its way here. I use a B+ in my HeaterMeter and I have a couple of Pi2s lying around in need of projects.


----------



## pc farmer (Oct 1, 2016)

WOW.   I really want to see pics of this build.    I like the spreadsheet and options.


----------



## hjbct (Oct 1, 2016)

Here's the parameters page.  This allows me to manage hysteresis.  Circ fan is inside the fridge.  Air pump is aquarium pump which injects air.













Capture1.PNG



__ hjbct
__ Oct 1, 2016






This is the drying schedule - allows a daily change in Temp and RH.













Capture2.PNG



__ hjbct
__ Oct 2, 2016


----------



## shyzabrau (May 25, 2017)

Are you willing to share your code and the build details?


----------



## hjbct (May 25, 2017)

sure - let me look at getting some stuff up on github.


----------



## verbage (May 27, 2017)

hjbct, I'd also be very interested in this!  I'm currently using an Arduino microcontroller setup, and the results are great, but I recently ordered a Raspberry Pi for some more flexibility.


----------



## verbage (Jun 14, 2017)

Hi again hjbct, just wondering if you are still planning on pulling together your code and build details, and posting it all on github?  My rpi3 finally came in the other day--haven't done much yet except get the OS up and running.  But I'm definitely looking forward to the flexibility of being able to change things on the fly via remote access instead of having to physically pull and flash a new program like for an Arduino!


----------



## tallbm (Jun 14, 2017)

Awesome post!

Last week I got my HeaterMeter dialed in for my electric smoker (MES40).  I found very little info for tuning when it comes to the electric smoker so I will be making a post about that in the future.  I LOVE how it is working so far.   Great looking work on what you have done to this point :)


----------



## hjbct (Jun 16, 2017)

I've posted the code on Github.

I'm afraid it is not very well documented but happy to help.  I have not put up a wiring diagram, so this is certainly not a recipe for how to build the system, but may be a jump start for someone.

I don't know how to put up the google sheets on Github, but the python code shows which cells are being read and written to so should be straight forward to replicate the sheets to get something working.

https://github.com/hjbct44/PorkPi


----------



## tallbm (Jun 16, 2017)

Oh man, I just thought of how neat this would all be as a Docker container.  I've just gotten into messing around with Docker but it would seem like a real neat fit with the Raspberry Pi hardware.  It is almost like a micro hardware plus micro service architecture


----------



## verbage (Jun 16, 2017)

Woo-hoo, thanks so much, hjbct!  I will probably work this into shape for my own particular setup--I don't use load cells, nor a circulation fan or air pump (my first few attempts when using a fan had a slight bit of case hardening, but new attempts were perfect without it).  Also, I've been using a DHT11 sensor for my Arduino setup, but I'm swapping to a BME280 for this new build.  If you want to geek out, and have a really good read about these temp/humidity sensors, check out this webpage--http://www.kandrsmith.org/RJS/Misc/hygrometers.html.

I don't think you can directly share a Google Sheets document on Github--whatever native format they use is not really downloadable, and instead you get a PC-based format for anything you try to download.  But you could, for example, make a copy of your sheet, delete all the data in the copy so it is essentially just a template, and then share the template with the whole world with read-only permission.  If folks browse to the link, they can then copy the sheet directly into their own Google Drive account with everything intact.

Thanks for the generosity with sharing your efforts!


----------



## hjbct (Jun 17, 2017)

I may look at that sensor - I see Adafruit has Pi library for it.  I think my DHT22 has been unreliable for humidity - I bought a second but never got around to replacing it.  

You should be able to change the python code to use that sensor pretty easily.

BTW, there are better algorithms for controlling the Humidity and Temp levels- i was messing with some PID code, but resorted to my simpler method which works well.  To minimize wear on the fridge compressor, I read that there should be a minimum 15 min delay between cycles, so I was not sure if a PID algorithm would be effective.

You should take a look at load cells - quite inexpensive when coupled with HX711 A-D converter.  Fun to be able to watch the weight loss!


----------



## ab canuck (Jun 17, 2017)

Wow that will make some goodies.... Pretty nice set up for that,


----------



## verbage (Jun 18, 2017)

So I spent the better part of today trying to grok the PorkPi files, and simplify them for my own use.  It didn't help that this was also my first experience with Python, but I had enough background with some other types of scripting that it was pretty easy to pick up.  Also a bunch of temporary hurdles popped up, for example, with getting a service account set up and with using the oauth2 SignedJwtAssertionCredentials method because it is no longer supported in the current oauth2client package, which is what is installed by default unless you specify an older version.  So I burnt some time figuring out that I had to update the code with the newer ServiceAccountCredentials method.

In the long run, trying to simplify PorkPi for my own use was taking quite a bit of time because I was trying to both debug and learn on-the-fly.  So to get basic functionality up and running, I ended up putting PorkPi aside, and just writing my own basic ~20 line script.  All it does for the moment is simply logs temperature and humidity values directly to Google Sheets.  But I'll continue adding to it to start controlling the relays that turn the fridge and humidifier on and off.  Also, there's a bunch of neat stuff like all the watchdogs and error/exception checking in the PorkPi package--I will eventually add some of that in to my own version for polish and resilience.

Thanks again, hjbct, for your generosity in posting this!  I'm taking your suggestion about load cells, and just ordered five load cell+HX711 modules on Aliexpress.  They are super cheap like just US$3.13!!!  If you are interested in the BME280 sensors, you can get them on Aliexpress for < US$3 so they are supercheap, too.


----------



## lemans (Jun 18, 2017)

I'm lost on this one.. in English please!!!


----------



## hjbct (Jun 18, 2017)

I'd be interested to hear how you get on with the lag and overshoot (hysteresis?) with you code - i'm looking for a better algorithm.


----------



## verbage (Jun 18, 2017)

Ok, sorry, maybe our tech geek sides are starting to win out, but it is all in quest for fantastic, dry-cured meats!  In sum, hjbct has developed a really cool system for automatiing the dry-curing process using a Raspberry Pi (RPi) single-board, full computer (a tiny, $35 device).  As you have seen from the preceding discussion, the system controls everything about the curing process (temperature, humidity, airflow, etc.), and even automates weighing via load cells (the weighing mechanism used in digital scales).  Furthermore, it pipes all the data out over the Internet to Google Sheets, and takes control instructions from there, too!  So hjbct can literally just sit back and watch/control everything from his "console" on Google Sheets--awesome!

This is light years ahead of other systems that many of us are using.  For example, if you ended up buying a commercial Johnson Controls temperature/humidity controller, well, they are dependable for what they do, but otherwise, they are not very flexible, and have no logging capability.  By the way, this is not meant to be critical of such a solution!!!  It is perfectly suitable and effective, and has rendered tons of beautifully dry-cured products as attested to in this and other forums!!!  But if you want more control over the process, especially logging capability, a computerized solution is necessary.  

Many of us have turned to Arduino microcontrollers.  These are essentially tiny, 8-bit CPUs that you put on a single task, and have them manage it continuously 24/7.  For example, you can use them to monitor temperature and humidity (and a zillion other things), and write program code that will toggle relays to turn on/off larger devices like a fridge/humidifier/fan/heater, etc. in order to continuously adjust environmental parameters.  These are more like basic rules, for example, if temperature rises to 14°C (~57°F), turn on the fridge till the temperature drops to 10°C (~52°F), and then turn it off.  You can do the same with humidity, air flow, etc., and also at whatever frequency you desire (1 minute, 5 minutes, 30 minutes, etc.) so you can very tightly control environmental parameters.  You can also have these things log all the data to SD memory cards to closely track the process.  But there are some limitations for microcontrollers, too, in that since they don't have lots of memory, you have to program them in a lower level language, and connectivity to the Internet was sort of limited in the past though that is not so much a problem any more.  But also programming wise, they are not so convenient as you have to physically plug them into another computer to flash a new "program" is you make any changes.  This means that you have to unplug the microcontroller from your dry-curing setup, plug it into a computer for programming, and then replug it all back into the dry-curing setup.  Uggh, this is sort of a headache as you can imagine.  Yes, there are ways to work around these limitations, but in the long run, microcontrollers are simply not as flexible as full computers.

But the Raspberry Pi that hjbct has used, yes, it's a full computer that can do everything a microcontroller can do and more.  For example, if you want to change the controlling program, you just log into the RPi remotely (it runs Linux), change the code, and restart it all from your keyboard.  No need to physically plug the device into another computer to flash a new program like is needed for a microcontroller.  Also, instead of having to physically grab an SD card to download the logging data from a microcontroller setup, you can either directly download it from the RPi, or have the RPi send it elsewhere like to Google Sheets.  In fact, this is the real value-added part that hjbct has provided--the computer code so you can monitor and control the whole thing via a simple web browser using Google Sheets.  He has also built in a lot of features for resilience--for example, if there is a power failure, loss of Internet connectivity, or whatever, the system is designed to generally recover, and pick up where it left off.  And the built-in load cells for weighing are really slick because it means the whole system can be entirely hands-off!  For example, because I currently use a simple microcontroller setup, when I travel, I conscript my wife to weigh out product every few days to keep track of weight loss.  By the way, while she protested lots at the beginning, after sampling the end product she is now a willing participant!  But with a system like hjbct has designed, one can easily do both monitoring and control it when away so there is no need to hassle anyone else.

The downside with either a microcontroller or full computer approach is that both involve some level of technical skill--it's not simply a matter of just plugging it in, and everything just works.  But eventually it will get to that stage I think.  If you look at the beer brewing community, for example, they already have a much more developed effort for plug-and-play brewing controllers called the BrewPi.  I think that if people start getting interested in hjbct's PorkPi system, something similar could eventually develop around it.  There needs to be lots more documentation to start, and certainly some more refactoring and modularization of the code would make things easier to follow, but he has made a fantastic first cut, and showed what is possible with such a setup.

A final note, using a setup like this is surely not for everyone!!!  For some, it is probably too much information, heck, people have been dry-curing products for thousands of years.  But the slick part about it is that they now allow us to basically do good dry-curing anywhere in the world.  I'd love to live in an idyllic, old world Mediterranean paradise where the natural environment is ideal for dry curing, but I live in a hot, semi-arid region so a curing chamber is needed.

Lemans, I know you didn't ask for all of this, but I am writing for somebody who may stop by to read this in the future...


----------

