OpenBrew – Control App development

Just a few random screenshots of the OpenBrew app doing app-y things.

Running in the iOS 6 Plus Emulator – haven’t got the USB convertor for the laptop to the phone handy and also haven’t paid the developer ransom to run the app on my phone as yet. I’ll have to do that considering an iPhone is my main device at the moment.
Untitled

Running in the Android Emulator on my workstation running ArchLinux.
Untitled

And another one, shot of the config screen.
Untitled

App Icon:
Untitled

Now I need to get the thing to actually talk to the Raspberry Pi running the brewery 🙂

OpenBrew Progress

I was finally able to spend some time working on OpenBrew tonight, after wanting to work on it all week. Previously I’d only roughed in the methods for controlling the steps in each vessel, but tonight I was able to spend a little time on actually making that side of the software track the time it spends on a step properly.

A long way to go yet but the fact that it’s now tracking it’s step times properly is a good thing.

Quickie: OneWire, DS18B20 and BeagleBone

I spent some time yesterday knocking up a small program in C++ to read DS18B20 sensors. It’s a work in progress for the moment still, but for now it works well enough to simply determine if a sensor is connected and what temp it’s seeing.

The code is at: https://github.com/vortexau/OpenBrew/blob/master/test_code/w1_temp/main.cpp. Assumes the OneWire/w1 driver is compiled in the the kernel of course. If you’re running a Rev6 BeagleBone with the stock Angstrom image, then it is. Otherwise Google is your friend.

BeagleBone with OneWire sensor.

I’m working on a similar program to test the I2C LCD as well, but I need to get a logic level shifter (or something like that..) as it doesn’t work without it.

ArduFerm and OpenBrew

Well, there’s been little progress on either of these projects recently 🙂 I work as a software developer, and usually my desire to write more software after hours waxes and wanes, depending on how busy I am at work. I’ve been real busy at work the last couple of months, actually working on stuff I’ve been enjoying, so when I get home I have little desire to write more code – especially in C/C++ which I’m still learning as I go.

So, enough excuses, I’m on Christmas Holidays now! 🙂 So, for the next 3 weeks, my days will be booked solid but I’m hoping I can get a few afternoons to work on the code for these projects.

ArduFerm
I have run out of time to order the hardware I need to finish the fermentation controller, with the christmas rush and people on leave it’s unlikely I’ll receive anything before my holidays finish. I really only need the 4 10A 240v Relays for the controller, and a power supply (but I know I can get that at Jaycar). The relays Jaycar have are expensive too. Otherwise I have just about everything I need, bar a few other odds and ends such as power plugs etc.
I’ve uploaded the latest version of the code to GitHub: https://github.com/vortexau/ArduFerm Be aware it may not even work for you 🙂

OpenBrew
I’ve played a little with the BeagleBone board, and I have a shell on the device from my workstation. I have Debian GNU/Linux on my workstation now, so I have another fast Linux box for working on. Previously I’d developed in Eclipse on my Macbook Pro, but (in my experience) getting the project to build on the OSX shell was a pain, probably because I’m using all GNU tools to build it. I couldn’t be bothered getting that working on OSX so I put Linux on my main workstation (which I wanted to do again anyway).
I’ve uploaded the latest version of the code to GitHUb: https://github.com/vortexau/OpenBrew Be aware it does not yet do anything even remotely brewing related 🙂

Brewery and Fermentation Controller, Software updates!

To run all this hardware, there clearly needs to be software, too… Part of the decision when thinking about which platform to go for was the software. Whatever I chose I would be doing some coding, and honestly when I looked at the BrewTroller code, it kind of scared me off. So many #ifdefs! I guess it’s a single codebase that needs to work with a lot of hardware, which has matured over time, which could explain some of it. And, I’d be lying if I said I wasn’t REALLY attracted to the idea of having a full GNU/Linux OS running my brewery 🙂

Anyway, I didn’t think I could do better than they have, but one of the major reasons I’m building this system is so that I know and understand every part of the brewery. EVERY part! That includes the software! Luckily I work as a software developer, so I think I have something of a brain for this kind of thing. Daily I work in PHP – so many people will say I’m not a “real developer” because I don’t work with a compiled language, or because the language is loosely typed (believe me, both things have been said to me!). Without firing up over that too much, the thought processes are identical – but strongly typed languages such as C/C++ and the like are a bit more to get your head around, granted. But, Object Oriented concepts are not foreign to me, so I’m not concerned.

Having got that out of the way, the other day I couldn’t get how I wanted the software to work straight in my head, and rather than try and prototype something in an unfamiliar language, I opened up Eclipse and hacked up an OO structure in PHP. Only took me 1/2hr to prototype the basic structure of how I wanted the objects to work.

I did know I wanted to do this in a ‘real’ language (now I’m sounding like one of those people..) so it was always going to be C/C++. I haven’t spent enough time with Python to like it yet, I really HATE Perl (yes I HAVE spent enough time working with it to grow to absolutely hate it!), and PHP, well that’s not the right language for this task 😉 I’m mostly interested in having this perform well, all the time, hence the choice of a compiled language (and the complexity that will come with that; threading etc).

After I prototyped the object structure, I then installed the C++ IDE into Eclipse, and got coding! It took me a bit longer than in PHP as I was having to get my head around the intricacies of how C++ does it’s OO (and it’s a LOT different to how I’m used to!), and the like. As it stands right now, I have a base project working locally, which doesn’t do much as yet (as you would expect, given that I have a family and job, too!) but what it does do is load up a batch, initialise objects for all 3 vessels, and add steps to each vessel. Also considering adding ‘vessel’ objects for things like a plate chiller and adding stubs for a HERMS vessel (though I won’t be using it). Depends how I go with getting logging etc working, they may not be required.

The plan is to have every action, such as HLT Fill, Mash Tun Fill, Dough In, Mash Steps each their own Step object, comprising of a number of variables such as temps, child objects for sensors and pumps, weather pumps should be active, heating controls etc.

That’s a very ‘high level’ look at it, but it could work.

Naturally the plan is to incorporate timers into the system, as that’s one thing I’ve been REALLY wanting too. I’ve got a few other thoughts around this, which will require some work and testing too. If I write into the software that I plan to ‘mash in’ at, say, 7am – the system will then be able to work backwards from that point and know exactly what time things need to happen. So, to have water at 75c at 7am, things will need to happen. The system might need to fill the HLT automatically at 4am. Would it be a good idea to have a ‘HLT Boil’ step perhaps, too? What would happen then, would be the HLT would fill automatically at 4am, and the water would heat up to 100c (ie Boiling) and boil for 15 mins. Good to volatilise any chlorine etc in the water, and to sanitise it (but of course it does not need to be at this point). Nice to have? Happy to hear opinions on it; but not required. Boil for 15 mins, then let the water cool naturally for, say 2hrs, and the PID software keeps it at 75c (example) until ready for 7am mash-in.

The other thing I’ve started work on, is parsing a BeerXML export (from BeerSmith), and loading that into the brewery software directly so that it get’s all it’s data from there, rather than requiring manual input. BeerSmith Cloud API would be nice, Brad!

Slow progress on that so far, i’m using pugixml as it was supposedly the most ‘noob friendly’ library for parsing and handling XML files. So far it’s a bit more difficult than I expected, I was hoping for something more like SimpleXML in PHP 🙂

It’s setup at the moment with automake/autoconf as well, which I’m glad I did from day one. Screw writing Makefiles by hand 😉 Planning to release the code under the GPL licence, and the project will be called ‘OpenBrew‘. Nothing there yet, though!

Anyway, getting tired… Hopefully these insights into the brewery have been interesting! And, there’s more to come, but not tonight 🙂