Vebra
Well-Known Member
So a little bit of progress as to where I'm at with this with a little help from helibrewer.
I'm currently working on cleaning up the code to make it a little more friendly on the eyes before I post it here.
I decided to go with the one wire interface directly with the Pi. If you use the Occidentalis distribution it's already built into the kernel and works perfectly. No need to buy a usb interface for it. It really is plug and play.
I have two DS18b20's hooked into GPiO pin 4. I have a python script that as of right now is on a cron job to update every second, but I'm probably going to make it a system service instead. So every second it reads the two temperature sensors, formats the data into Fahrenheit and inserts it into a MySQL database.
I have a standalone php script that pulls the data from the MySQL server and saves it to a JSON variable for use in the main page.
On the main page I have two temperature gauges, one for mash tun and one for the brew kettle. I use jQuery and Ajax to pull the temperature data from the PHP script in real time and insert the temperatures into a hidden <DIV> tag.
From there I have a javascript section that pulls that data from the hidden DIV tag and update the gauge accordingly.
It sounds like there is a lot going on at once and that it wouldn't work well, but as soon as the data is updated from the sensor into MySQL the gauge changes instantly and updates in real time with current temperature.
I'm currently working with the webiopi to control the heating element and the pump. I have 4 buttons currently setup on the page. 1 for manual on and off control of the heating element, and one for the pump. There is an input where I can put my desired mash temp, and hit Start Mash, the script will loop until the temperature of the brew kettle reaches the temperature I set in the input, sound an alarm and turn the heating element off. The last button is a Boil button. The boil button will turn the heating element on, and only stay on when the wort is below a boil temperature. Hit the button again and the boil stops.
I'm currently working on cleaning up the code to make it a little more friendly on the eyes before I post it here.
I decided to go with the one wire interface directly with the Pi. If you use the Occidentalis distribution it's already built into the kernel and works perfectly. No need to buy a usb interface for it. It really is plug and play.
I have two DS18b20's hooked into GPiO pin 4. I have a python script that as of right now is on a cron job to update every second, but I'm probably going to make it a system service instead. So every second it reads the two temperature sensors, formats the data into Fahrenheit and inserts it into a MySQL database.
I have a standalone php script that pulls the data from the MySQL server and saves it to a JSON variable for use in the main page.
On the main page I have two temperature gauges, one for mash tun and one for the brew kettle. I use jQuery and Ajax to pull the temperature data from the PHP script in real time and insert the temperatures into a hidden <DIV> tag.
From there I have a javascript section that pulls that data from the hidden DIV tag and update the gauge accordingly.
It sounds like there is a lot going on at once and that it wouldn't work well, but as soon as the data is updated from the sensor into MySQL the gauge changes instantly and updates in real time with current temperature.
I'm currently working with the webiopi to control the heating element and the pump. I have 4 buttons currently setup on the page. 1 for manual on and off control of the heating element, and one for the pump. There is an input where I can put my desired mash temp, and hit Start Mash, the script will loop until the temperature of the brew kettle reaches the temperature I set in the input, sound an alarm and turn the heating element off. The last button is a Boil button. The boil button will turn the heating element on, and only stay on when the wort is below a boil temperature. Hit the button again and the boil stops.