BrewBlox service for GPIO on Raspberry Pi

#1

For mashing, I am currently using one of my Raspberry Pis to which I have attached an official 7" display directly. All this is in a proper housing with one 230V cable going in and 2 230V sockets and some RJ12 connectors going out. I find the “built in” display and the compact package pretty handy, because there are practically no cables flying around.

In order to control the kettles, I use the wiringPi library to switch the respective SSDs (via an appropriate MOSFET) on and off. The temperature probes from the BrewPi store are also attached directly to the Raspberry Pi (with a 4,7k resistor between 3,3V and the 1W pin). This works perfectly.

If I understand correctly, the BrewBlox architecture allows for developing “services” which offer data sources and/or outputs. I wondered whether it would be very difficult to make such a service which would interface to wiring Pi for the GPIOs / 1W.

Any hints on this? I have to add that I don’t understand anything about docker at all.

#2

I’d have to look up how GPIO on the Pi is handled to make any definitive statements, but your chances are good.

The interface and requirements for BrewBlox services is kept very loose: if you can publish RabbitMQ messages you can publish history data. Add a REST interface, and we can hook it up to the UI.

Docker is a cross between a virtual machine and a package manager: it allows you to deploy your software including an OS-like wrapper. Makes it easy to have a one-click deployment of your software plus required runtimes.

If you want to, PM me and I can send you an invite link to our slack channel

#3

Thanks for the quick reply!

The GPIOs can be controlled via a command line tool “gpio” which is pre-installed on Raspbian. Unsurprisingly, you first need to set the respective port to output (e.g. gpio -g mode 25 out) and then you can simply write 0 or 1 to that port (e.g.gpio -g write 25 0).

For 1-Wire, it is necessary to activate 1-Wire support once in raspi-config. After that, the pre-installed driver publishes a file system under /sys/bus/w1/devices/w1_bus_master1/ where sensors are automatically enumerated. I have to re-check, but I think that the value is written to a file that changes constantly.

While I like working on electronics and do design my own schematics, I do not have any programming skills. So all I usually do, is copy together stuff written by others. I will read up a bit on RabbitMQ, but have a feeling that this will be a bit too complicated for me.

#4

If you’re ok with Python, we already set up a boilerplate repository at https://github.com/BrewBlox/brewblox-boilerplate.

Example of a (real) simple publishing service

#5

I’d like to point out that we deliberately didn’t run our control algorithms on the pi. All critical control (PIDs, sensors, actuators) runs embedded on the BrewPi Spark.

It can run independently and does not rely on the pi or anything that runs on it. So he stability and the quality of your beer does not depend on WiFi, docker, the SD card or any other things running on the pi, etc.

So even if you create a service that toggles pi gpio and can read onewire sensors, this does not make them available as inputs and outputs for the PIDs that run on the Spark. That’s all local on the Spark.