StrangeBrew Elsinore - Raspberry Pi based brewery controller

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.
I just fired up my raspberry pi and downloaded Elsinore looking forward to playing with this!

Thanks for the hard work!
 
I loaded the apk and have the brewday screen up but I dont see how to control the heating element. is the android portion read only or is there another step I am missing?
 
Sorry I found that there's an error with the android app. It wasn't posting to the correct URL. I've updated the repository with the updated APKs.

I'm currently fighting an issue where my pi appears to hang/crash randomly and I'm unsure how/why.
 
Also, make sure you press the settings button (top right) and set your server name/url and port (it'll default to 8080)
 
I got a little ahead of myself and loaded the android app before setting up the server end.

I am having trouble getting launchElsinore to run. Here is what I have done so far to setup the Pi.

sudo apt-get update
sudo apt-get install apache2 php5 libapache2-mod-php5
sudo apt-get install mysql-server mysql-client php5-mysql
sudo apt-get install openjdk-6-jdk

Downloaded Elsinore to PI and extracted to BrewServer folder in Pi

Then when I run launchElsinore I get the following error:

Exception in thread "main" java.lang.UnsupportedClassVersionError: LaunchControl
*****JavaStuff****
Could not find the main class: LaunchControl. Program Will Exit.

I probably am missing a step in here somewhere. Any Suggestions?
 
Ah, I've compiled it on a newer Java version. If you run:

javac -cp libs/framboos-0.0.1-SNAPSHOT.jar:libs/ini4j-0.5.2.jar:libs/json-20090211.jar:libs/httpclient-4.2.jar:libs/httpcore-4.2.jar:libs/joda-time-2.2.jar:libs/Cosm.jar:. LaunchControl.java

It'll recompile the class files for Java 6 (well, specifically for the version of the JRE that you have).
 
The command I had was for 6 but I upgraded to 7. Now it looks like it is running. It says waiting for input. Is this because I have not installed the sensors yet or are there commands we need to enter at this point?

Thanks for your help!
 
I haven't been sitting on my ass, well, I have, but that's not the point.

bwRmVsY.png


Is a preview of what I've been working on, it's functional and I just need to add a reset button, for now you need to refresh the entire page if you want to abort any changes.

This is a dynamically generated web page based on the devices you have enabled, I need to improve the interface, but she's slowly getting there.
 
Doug, have you had your sensors down below freezing yet? There is a bug in the onewire library for arduino when reading negative C temps. I ported that library to c# and I finally managed to fix it after doing some serious self education on bit shifting. I'm not sure which library you are using for raspberry pi or if it has the same bug. If you come across it, let me know and I'll shoot you a snippet. It's probably pretty close to java.
 
Yup, I've had them in negative temperatures with no issues that I can remember, or at least nothing that I can attribute to the w1 module.

Unfortunately Cosm has been rebranded and they changed the APIs so I can't pull up my history easily. otherwise I'd verify it :)
 
Cool you should be good. If you've seen negative C or F below 32, you're fine. You'd know. It would read something like 7000+ F otherwise.
 
I think I picked that up when I first started to play around, but I thought it was my wiring, or the lack of checking for CRC in the original code I used. When I rewrote it I didn't find the issue showed up again :) Thanks for the warning though.

I should be uploading the newest batch of code sometime this week, I'm just improving the UI.
 
Finally had some time to play with the raspberry pi again. Setup LAMP, configured rpibrew.cfg, and Installed probes. I also setup an xively account for the cosm but I havent readup on it yet. I think I pulled the right data over to the config file. I set #cosm= to the Auto-generated BrewPi device key (private) and the #cosm_feed = Feed URL.

I am still getting a {} on the getstatus page

Raspberry PI output is:
URL: /getstatus method: GET

Any ideas what I am doing wrong?
 
What does the rest of the cfg file look like and whats the server output?
 
[kettle]
set_point = 168.0
duty_cycle = 100.0
cycle_time = 2.0
k_param = 41.0
i_param = 169.0
d_param = 4.0
#probe = 28-0000032c449f
#gpio = 11

[hlt]
set_point = 0.0
duty_cycle = 0.0
cycle_time = 0.0
k_param = 0.0
i_param = 0.0
d_param = 0.0
#probe = 28-0000046ed7d1
#gpio = -1

[mlt]
set_point = 0.0
duty_cycle = 0.0
cycle_time = 2.0
k_param = 44.0
i_param = 165.0
d_param = 4.0
#probe = 28-0000046eec97
gpio = -1
 
Ah, I should have known that. I removed the hash and recieved some message about a missing directory. I ran the following commands and it started working.

sudo modprobe w1-gpio
sudo modprobe w1-therm
 
Yup, it's something I thought the distros had changed, set the in your modprobe conf files to auto probe on startup :)

I've not made it the most resiliant yet, that's fine tuning for later.
This is what I've done so far this week:
 
Sorry about the Noob question, but how do we set modprobe in Linux? I tried editing the /boot/config.txt file but it didnt seem to work.
 
I added them but are not working. I have had the same problem with the boot/config.txt file when adjusting the resolution.

I opened the Android piece and it is stuck on the Brew day screen. In settings I set the server to my local IP and port 8080.
 
Local IP, you may need to force close and reopen the app

Force close and reopen. Still on brew day when it opened up.

Adding to Etc/modules didn't work for me so I added mod probe lines to launch script
 
Yeah it defaults to brew day, I'm trying to make it clearer to swipe left and right, but I should just document it
 
If anyone has problems they can always read the thread. :)

I am going to try this out during a cleaning session and if it works out may brew a batch or two.
 
Updated the server repository, there's now a setup interface if you don't have any valid setups (saves data under rpibrew.cfg.new) and the controller web UI is available

Code:
http://<server:port>/control
 
Updated the server repository, there's now a setup interface if you don't have any valid setups (saves data under rpibrew.cfg.new) and the controller web UI is available

Code:
http://<server:port>/control

Is there anything special we need to do to upgrade or do we need to extract to a new folder and copy over config file?
 
You just need to keep the config file, if you use git to get the respository an update will just update the files which've changed. Since I don't put a rpibrew.cfg file in there, just example files, it shouldn't overwrite your current one.
 
Switched to Git and copied over config file. Now raspibrew.html has the correct temps but the control page does not.

Also could you explain what the parameters for these pages are and how they work?
 
So the raspibrew.html shouldn't have the correct values at all (I actually should remove it)

If you visit:
http://elsinore:8080/control

(replace elsinore with your hostname) can you take a screenshot and upload it?

The values are meant to represent PID inputs

So getStatus returns a JSON list of devices with substatus data, I've realized I screwed up the naming and I need to fix it (I use K-I-P in some places and P-I-D or K-I-D in others which is bloody stupid):
The Set point is the target temperature, this uses the PID (or KIP or KID) values to work out what the duty cycle should be.
The cycle time is the on/off time in seconds for the element
The Duty cycle is how much "on" the element is, so 50% means it's on for 50% of the Cycle Time (so a 4s Cycle time would be 2s on, 2s off)

This is a simple explanation of the way a PID works: http://www.betterthaneveryone.com/archive/2008/04/26/pid-in-a-nutshell.aspx


I'll update the code sometime this week so there's a documentation page that'll summarize the pages and options (I've done this on a project more recently).

I've just reinstalled my Pi with hard float and I've been resetting it up so I do have further files to come, like the modprobe conf files.
 
Json
{"hlt":{"elapsed":1369745557903,"scale":"F","temp":68.3366},"kettle":{"elapsed":1369745555713,"scale":"F","cycle":2,"status":"off","duty":0,"p":0,"temp":67.8866,"gpio":11,"setpoint":175,"k":41,"i":169,"mode":"off"},"mlt":{"elapsed":1369745557493,"scale":"F","temp":66.875}}

Elsinore.PNG
 
Which browser are you using? I think the issue is probaby the JS I'm using....
 
firefox and chrome both show the results in the above picture. IE doesnt show the digital temp graphic at all.
 
So the picture indicates that the Javascript is failing to update anything, I've updated the respository to massively simplify the code.

Try updating and if it still fails, bring up the javascript console to see what errors it is throwing...
 
update didnt work, in fact we lost HLT and MLT PID info.

Opened the JS console in Chrome and the following request was pending/failed.

Request URL:http://elsinore:8080/getstatus?_=1369785564051
Request Headersview source
Accept:application/json, text/javascript, */*; q=0.01
Origin:http://192.168.10.112:8080
Referer:http://192.168.10.112:8080/control
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.94 Safari/537.36
Query String Parametersview sourceview URL encoded
_:1369785564051
 
Back
Top