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.
Yup, git pull should update it all. Make sure you get an extra tinytimer.min.js file
 
Doug, after I started the timer and then stopped it then started the next timer and stopped that too it locked up the server I think. I restarted by exiting and then restarted. Is there a reset option if we start the timer and want to go back to start again or do we have to restart the server every time.
 
I've never seen it hang, but clearing at the moment is done by restarting the server, I've been trying to work out the best way to reset the timers, it's not too hard to do.

I think the best way it to have a row of reset buttons for each of the timers (I may have it so each timer has it's own row) and a pop up to confirm the reset. Any thoughts?
 
Also, is there a way to automatically start this as a service? I.e. when I plug in my control box the service just starts as part of a RC file
I played with it but couldn't get it to work ... maybe since it starts in interactive mode?
But still very cool so far.
Thanks for all the work
 
Also, is there a way to automatically start this as a service? I.e. when I plug in my control box the service just starts as part of a RC file
I played with it but couldn't get it to work ... maybe since it starts in interactive mode?
But still very cool so far.
Thanks for all the work

Interactive mode shouldn't matter, I've not looked into initscripts yet, since I am still playing around with stuff, but I don't think it's be hard to do.
 
I've never seen it hang, but clearing at the moment is done by restarting the server, I've been trying to work out the best way to reset the timers, it's not too hard to do.

I think the best way it to have a row of reset buttons for each of the timers (I may have it so each timer has it's own row) and a pop up to confirm the reset. Any thoughts?

Doug, Can you set it in the config so we can just add timers and name them ourselves like you do pumps. Click on the button and it changes color and from start to stop and reset. Have the time above the button. What do you think.

Brewer44
 
Also, is there a way to automatically start this as a service? I.e. when I plug in my control box the service just starts as part of a RC file
I played with it but couldn't get it to work ... maybe since it starts in interactive mode?
But still very cool so far.
Thanks for all the work

I created 3 files to start and stop the server, The last line will Auto Start the server on boot.

elsinorestart.sh with the below bash

#!/bin/bash

cd /usr/local/src/SB_Elsinore_Server
java -jar Elsinore.jar


elsinorestop.sh with the below bash

#!/bin/bash
# Grabs and kill a process from the pidlist that has the word myapp

pid=`ps aux | grep Elsinore | awk '{print $2}'`
kill -9 $pid

Elsinore with the below code and placed it in /etc/init.d/ folder

#!/bin/bash
### BEGIN INIT INFO
# Provides: Elsinore Server
# Required-Start: $local_fs $syslog $remote_fs dbus
# Required-Stop: $local_fs $syslog $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start transparentproxy
### END INIT INFO

case $1 in
start)
/bin/bash /usr/local/bin/elsinorestart.sh
;;
stop)
/bin/bash /usr/local/bin/elsinorestop.sh
;;
restart)
/bin/bash /usr/local/bin/elsinorestop.sh
/bin/bash /usr/local/bin/elsinorestart.sh
;;
esac
exit 0

Then did an update-rc.d Elsinore defaults
 
Doug, Can you set it in the config so we can just add timers and name them ourselves like you do pumps. Click on the button and it changes color and from start to stop and reset. Have the time above the button. What do you think.

Brewer44

I haven't added the colour change but I have changed the timers to be set from the config file.

Add a [timers] section with the names of the timers (no value needed at this point)

Code:
[timers]
mash
boil
chill

The order you set them is the order they are displayed.

Todo: Allow you to set count up or count down timers (with a duration pop up), and change the colour when you start/stop/reset.
 
I haven't added the colour change but I have changed the timers to be set from the config file.

Add a [timers] section with the names of the timers (no value needed at this point)

Code:
[timers]
mash
boil
chill

The order you set them is the order they are displayed.

Todo: Allow you to set count up or count down timers (with a duration pop up), and change the colour when you start/stop/reset.

Doug, I get this error now. See attached

2014-01-08_2222.png
 
OK, Got it to work this way.

What did you have before?

EDIT: Ah an undocumented bug in the configparser, you need to have:

Code:
[timers]
mash = 
boil =

You don't need a value, but it throws an ioexception if there isn't an equals
 
Doug, Everything seems to be working fine now. Is there a way to start the server in a daemon mode. Also I have to stop apache and tomcat before it runs now. Tells me address in use. Other then that, all is good.

Thanks Brewer44
 
I haven't got daemon mode running but I've added the ability to change the port. Add:

--port <number>

To your command line to change the port, which should prevent it conflicting with apache/tomcat since I assume you've set them up on the same port (8080)
 
You can now chose which port to run elsinore on, append your command line with "--port <number>" and elsinore no longer dies when you hit enter.
 
If it's on 8080 at the same time you have a seperate process running

You're right. I killed all the processes and it just started on 3131. I'm brewing in the morning and will try this out for the first time. I hope to not over shoot my mash temp. Should stabilize I hope. Thanks for all your help.
 
New feature enabled: Auxilliary mode for PIDs

Add a GPIO using:

Code:
aux = <GPIO>

To a PID control setup and you'll find a new button in the PID control area called "AUX" which you can use to toggle an output.

I'm also going to be moving to YAML config files (I'm going to leave the .cfg method active, but you'll get a message telling you to move to YAML)

YAML allows case sensitivity in config files, and it's easier to read in my opinion.
 
New feature enabled: Auxilliary mode for PIDs

Add a GPIO using:

Code:
aux = <GPIO>

To a PID control setup and you'll find a new button in the PID control area called "AUX" which you can use to toggle an output.

I'm also going to be moving to YAML config files (I'm going to leave the .cfg method active, but you'll get a message telling you to move to YAML)

YAML allows case sensitivity in config files, and it's easier to read in my opinion.

Doug, After doing a git pull I get this now.

2014-01-12_0935.png
 
New feature enabled: Auxilliary mode for PIDs

Add a GPIO using:

Code:
aux = <GPIO>

To a PID control setup and you'll find a new button in the PID control area called "AUX" which you can use to toggle an output.

I'm also going to be moving to YAML config files (I'm going to leave the .cfg method active, but you'll get a message telling you to move to YAML)

YAML allows case sensitivity in config files, and it's easier to read in my opinion.

Doug, I guess I don't get the Aux function. Would this turn it on and off the GPIO so we don't have to stop or click off then back to Auto to set another temp setting.
 
Doug, I guess I don't get the Aux function. Would this turn it on and off the GPIO so we don't have to stop or click off then back to Auto to set another temp setting.


If you don't get it, don't use it :) It was a request from a few people to be able to have a secondary element control manually.
 
Doug, I added the Aux function to my config file under my HERMS pid and it doesn't do anything. I can click on it but nothing happens. It stays at Aux Off.
 
If you don't get it, don't use it :) It was a request from a few people to be able to have a secondary element control manually.

I get it now, That would be great as I do use an extra Heat Stick plugged in to the wall for faster heating. Thanks for the addition.

Is there a request for step mashing with timer. I now have to stop the Auto to change the temp and restart it.
 
I get it now, That would be great as I do use an extra Heat Stick plugged in to the wall for faster heating. Thanks for the addition.

Is there a request for step mashing with timer. I now have to stop the Auto to change the temp and restart it.

This is something which I'm working on, but my priority is to allow StrangeBrew to control Elsinore, so that it works off your mash temperature.
 
Doug, I added the Aux function to my config file under my HERMS pid and it doesn't do anything. I can click on it but nothing happens. It stays at Aux Off.

You have to be able to provide me more details, what did you add to the config file? Can you provide debug output (add -d to the end of the command line, please try to trim down to where you click the Aux button).

The aux button maps directly to which ever GPIO you specified it for, so it reads directly what the GPIO Value is to tell you if it's on or off.
 
You have to be able to provide me more details, what did you add to the config file? Can you provide debug output (add -d to the end of the command line, please try to trim down to where you click the Aux button).

The aux button maps directly to which ever GPIO you specified it for, so it reads directly what the GPIO Value is to tell you if it's on or off.

I added this to my config file:

2014-01-12_1435.png
 
Ok, I did some more troubleshooting. I installed webiopi and watched the GPIO output on the page. When I click on the Aux Off button the GPIO9 does turn on and off but the Aux Off button stays the same. Below you can see it go to true and false. I think it's not reading if it's on or off. Will the button have a different color when it's on?

2014-01-12_1457true.png


2014-01-12_1457.png
 
So what it does is read the output then invert it (if it's set to true, it goes to false, false -> true)

Can you get the output from the getstatus page? (i.e. brewery:9091:/getstatus

Both before and after you toggle it? I wonder if the JS isn't parsing it.

edit; Looking at it I think it's a JS problem, I've pushed a new version of the client side JS, try pulling it in (you shouldn't need to restart the server) and do a refresh of the control page.
 
So what it does is read the output then invert it (if it's set to true, it goes to false, false -> true)

Can you get the output from the getstatus page? (i.e. brewery:9091:/getstatus

Both before and after you toggle it? I wonder if the JS isn't parsing it.

edit; Looking at it I think it's a JS problem, I've pushed a new version of the client side JS, try pulling it in (you shouldn't need to restart the server) and do a refresh of the control page.

Works as advertised. Thanks for the update. It now turns Red and On. The GetStatus read 0 then toggled and went to 1

Thanks Doug. Keep up the great work.
 
I'm also going to be moving to YAML config files (I'm going to leave the .cfg method active, but you'll get a message telling you to move to YAML)

YAML allows case sensitivity in config files, and it's easier to read in my opinion.

Doug, When do you think you're going to the YAML format.
 
Sometime this week, but support for config will still be there. YAML will just make things easier.

I'm hoping to get a cfg -> YAML section sorted too.

I'm delaying any major changes until next week (ish) since my laptop arrives Friday.

If you notice any significant issues, please let me know, I will fix them ASAP.
 
How we doing Doug. Did you get your new laptop up and running. Everything seems to be working fine on the controller. Let us know when the YAML is ready.

Brewer44
 
I'm working on the new config file at the moment, I decided against YAML since it's not standard enough. I'm updating to use XML configuration files at the moment.

I spent the weekend fixing a lot of mashing calculation bugs in StrangeBrew itself, as well as a lot of papercuts, so I am moving onto elsinore now.
 
First and foremost: the default config file is now called "elsinore.cfg", if you want to use a different one, use the

Code:
--config <name>

command line parameter (after Elsinore.jar)

I've got a lot of code tidying to do for the rest of the week, but the first pass of the config file updates is done.

Converting an existing config file is automatic, except you will need to modify names in the file if you want case sensitivity

For example, in the original cfg file examples I presented, [Kettle] would create a device called "kettle" (all lowercase), in the new code it generates a line of

Code:
<device id="kettle">

if you edit the file and change it to

Code:
<device id="Kettle">

The UI will show "Kettle"

It will automatically backup the existing configuration file to <name>.original.
 
Doug, I did the pull and it first said it couldn't find config file. I renamed the rpibrew.cfg to elsinore.cfg then it asked me questions about OWFS. It did convert the file to XML but I now start the server and all my probes are 00.00 no readings.

Also get this when I shut it down:

java.io.FileNotFoundException: /sys/class/gpio/gpio10/value (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:97)
at java.io.FileReader.<init>(FileReader.java:58)
at jGPIO.GPIO.readFile(GPIO.java:183)
at jGPIO.GPIO.readValue(GPIO.java:204)
at jGPIO.OutPin.setValue(OutPin.java:29)
at jGPIO.OutPin.setValue(OutPin.java:23)
at com.sb.elsinore.OutputControl.allOff(OutputControl.java:197)
at com.sb.elsinore.OutputControl.run(OutputControl.java:65)
at java.lang.Thread.run(Thread.java:724)

2014-01-22_1746.jpg
 
Doug, I did the pull and it first said it couldn't find config file. I renamed the rpibrew.cfg to elsinore.cfg then it asked me questions about OWFS. It did convert the file to XML but I now start the server and all my probes are 00.00 no readings.

As stated in my post, the default configuration file has changed and you can set it by using the --config option.

Can you provide the original configuration file you used? It will have been backed up to elsinore.cfg.original
 
If I use the old rpibrew.cfg with the --config it works fine. But this is not in XML format.

Edit. When I shut the server down is converts the rpibrew.cfg to XML format then I loose my probe temps when I start it backup again.
 

Latest posts

Back
Top