Git Product home page Git Product logo

hrafnkelle / tfbrew Goto Github PK

View Code? Open in Web Editor NEW
8.0 4.0 4.0 318 KB

Yet another homebrewing control system. Free as in freedom to make free beer.

Home Page: https://github.com/hrafnkelle/tfbrew/wiki

License: GNU General Public License v3.0

Python 81.91% HTML 2.37% JavaScript 15.29% Dockerfile 0.43%
homebrew raspberry-pi blynk temperature-control beer asyncio brewing pt100 max31865 temperature-sensor

tfbrew's Introduction

About

TFBrew is yet another beer homebrewing control system for (but not limited to) the Raspberry Pi.

You can use it to:

  • Monitor the temperature in your mash kettle or hot liqure tank using the W1Sensor plugin.
  • Turn heaters and pumps on and off using the GPIOActor (raspberry pi) or the TPLinkActor (WiFi controlled socket).
  • Maintain a stable temperature in your mash by combining a heater and temperature sensor in a controller with process logic (the PIDLogic plugin).
  • Control and monitor your brewing process through a mobile device, e.g. with a Blynk frontend.

It aims to be a flexible, modular system allowing the user to configure it to different setups of homebrewing equipment.

TFBrew was written by Hrafnkell Eiríksson - [email protected]

TFBrew is Copyright from 2017 by Hrafnkell Eiríksson and is licensed by the GNU GPL v3 license. See the LICENSE file.

Please consult the Wiki for further information.

Plugins

TFBrew is based around the idea of components that send each other messages. Components are implemented through plugins. The following components are available

  • W1Sensor - for using one-wire sensors like the ds18b20
  • RTDSensor - for using PT100 sensors through the MAX31865
  • TiltSensor - for using the Tilt Hydrometer
  • iSpindelSensor - for using the iSpindel Hydrometer
  • DummySensor - simulating a sensor with a configurable value + noise
  • GPIOActor - for controlling relays (SSR) with the GPIO pins on the Raspberry Pi
  • TPLinkActor - for controlling a TPLink WiFi socket
  • DummyActor - simulating an actor, just prints out the actions
  • PIDLogic - for precise temperature control with a PID (e.g. recirculated mash)
  • HysteresisLogic - for on/off temperature control with a hysteresis (e.g. fermentation fridge control)
  • BlynkLib - for communicating with a Blynk frontend
  • SimpleWebView - for viewing the state of sensors, actors, etc in a web browser
  • Ubidots - for logging to the Ubidots IoT cloud

Configuration

It is configured throug a YAML configuration file, found in config.yaml. The included configuration might work for a single vessel BIAB system controlled by a Raspberry Pi, using GPIO for actors and a one-wire (w1) ds18b20 (or similar) temperature sensor. This could be controlled by a Blynk user interface. See the included config.yaml as an example.

First, actors and sensors are declared. Then, one or more controller is declared, a logic (how do decide when to activate e.g. heater), a sensor and an actor are attached. Extensions can then be loaded. Finally, message routing is set up in connections. Each component has one or more sending and receving endpoint. Messages from one component to another are set up like

KettleController.power=>UserInterface.powerdisplay

Installation

TFBrew requires at least Python 3.5 (for asyncio async/await support)

Clone this repository, and set up a virtualenv pip install the python packages in the requirements.txt file into your virtualenv

pip install -r requirements.txt

then run the tfbrew.py file

Please consult the Wiki for further information.

tfbrew's People

Contributors

hrafnkelle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tfbrew's Issues

UbidotsLogger not connecting

On to the next. I've setup the UbidotsLogger Extension and created a Ubidots Device (tfbrew) with one variable (Tilt Temperature). Even after running for several minutes I am not getting any activity on the Ubidots device. I do not know if it is related but the tfbrew log is show an error immediately after setting up Ubidots. Here is the error:

2018-07-25 00:58:13,856:INFO:root:setting up ubidots
2018-07-25 00:58:13,859:ERROR:asyncio:Creating a client session outside of coroutine
client_session: <aiohttp.client.ClientSession object at 0x75e0a1f0>

Here is my config.yaml Ubidots section:

  • ubidots:
    plugin: UbidotsLogger
    token: xxxxxxxxxxxxxxxxxxx (using Default Token from Authentications Tokens)
    variables:
    Tilt.temperature: ttttttttttttttttttttttttt (using Tilt Temperature ID from tfbrew device)

Thanks
Chuck

New hardware v2.0 and new firmware 1.5.4 not working

Took a power hit and had to replace one of my HS100 plugs. The new plug is HW v2.0 with Firmware v1.5.4 and it tfbrew is not able to communicate with it. The tfbrew.log file shows tfbrew thinks it is turning the plug on/off but there is no change. After some time there is also a error message from the TPLinkActor [Errno 24] Too many open files. I found references with other projects indicating there is an even newer version v3.0 that experiences the same issue. These references talk of an issues related to the header being empty and/or a change to the encryption/decryption.

W1Sensor sometimes gets stuck

First off, what a brilliant piece of software; I love the coding style and the architecture of the project.

I've been running tfbrew for a few hours now, extending it as I needed. At some point, the W1Sensor got stuck at 4°, and the hysteresis logic had my kegerator run to -11°C before I realized. Looking at /sys/bus/w1/devices/ID/w1_slave, the temperature was correctly listed at -11°C, but it seems that for one probe, the file wasn't there.

As a result, the asyncio task crashed from the pattern matching done in readTemp.

I've modified the function like this, and haven't had a problem since.

Additional BLE Temperature Sensor

Sorry for delay. I was hoping for a plugin for a external BLE Temperature Sensor for tracking the ambient temperature in the fermentation fridge. After looking at availability and documentation the Sensoro SmartBeacon line seems like a good option for a BLE Temp Sensor external of TILT. SmartBeacon supports iBeacon which is the protocol TILT uses. Here are some links:

https://www.sensoro.com/en/whyus
https://www.sensoro.com/en/developer
https://www.sensoro.com/en/down
https://sensoro.zendesk.com/hc/en-us

v/r
Chuck

HysteresisLogic Heating and Cooling function

I am trying to reconfigure my tfbrew to use the new HysteresisLogic setup for heating and cooling. I don't get any errors when starting tfbrew but the heating in always on regardless of temp and setpoint. I am using a TPLink for Cooling (1.1.1.1) and a separate TPLink for Heating(1.1.1.2). This is what my config.yaml looks like.
actors:

  • Cooling:
    plugin: TPLinkActor
    ip: 1.1.1.1
  • Heating:
    plugin: TPLinkActor
    ip: 1.1.1.2

controllers:

  • FermentationCooling:
    plugin: HysteresisLogic
    keepCold: True
    logicCoeffs:
    allowedOvershoot: 0.1
    allowedUndershoot: 0.0
    actor: Cooling
    sensor: Tilt
    initialSetpoint: 18
    initialState: on
  • FermentationHeating:
    plugin: HysteresisLogic
    keepHot: True
    logicCoeffs:
    allowedOvershoot: 0.1
    allowedUndershoot: 0.0
    actor: Heating
    sensor: Tilt
    initialSetpoint: 17
    initialState: on

Unable to use TILT Temp for Controller Sensor

I am hoping to use the temperature reported by TILT for controlling my TP-LINK providing power to the compressor. I get an error regarding no attribs of 'temp' when trying to use the TILT Temperature for the sensor source for the FermentationFridge controller.

Blynk Authentication Failure

Don't know if you are still supporting tfbrew. I just started encountering an issue. TFBrew fails to connect to Blynk-Cloud. I tried researching it but I am out of my depths on this one. I did try going back to older versions of Raspberry Pi and clean installs of TFBrew. I think something changed at Blynk or perhaps in Python. It was working about 3-4 weeks ago. I brewed a nice Kveik Pseudo Lager. The error being thrown is:

Using config from config.yaml
======== Running on http://0.0.0.0:8080 ========
(Press CTRL+C to quit)
Blynk authentication failed
Blynk authentication failed
Blynk authentication failed
Blynk authentication failed
Fatal error: protocol.data_received() call failed.
protocol: <plugins.BlynkLib.BlynkProtocol object at 0xb59fef90>
transport: <_SelectorSocketTransport fd=10 read=polling write=<idle, bufsize=0>>
Traceback (most recent call last):
File "/usr/lib/python3.7/asyncio/selector_events.py", line 813, in _read_ready__data_received
self._protocol.data_received(data)
File "/home/pi/tfbrew/plugins/BlynkLib.py", line 201, in data_received
self.run()
File "/home/pi/tfbrew/plugins/BlynkLib.py", line 213, in run
msg_type, msg_id, status = struct.unpack(HDR_FMT, data)
struct.error: unpack requires a buffer of 5 bytes
Blynk got connection lost
unpack requires a buffer of 5 bytes
NoneType: None

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.