• Please visit and share your knowledge at our sister communities:
  • If you have not, please join our official Homebrewing Facebook Group!

    Homebrewing Facebook Group

Web-Accessible Temperature Logger for Raspberry Pi

Homebrew Talk

Help Support Homebrew Talk:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
[...]Couple of quick questions,
1. What version of python are you using?
2. Are you using mod_cgi or mod_wsgi or mod_python?
3. Did you follow the server setup in raspberrywebserver.com?
Thanks again for being available to ask questions.

1. 2.7.3
2. As best as I can tell I've never enabled/installed any of those.
3. Nope. I just installed sqlite3, Apache was already resident and serving pages because of the prior RaspberryPints installation.

Note that I have only ever run this on Wheezy and using Python 2.7.3.
I have no idea if it'll work without some massaging when run on Jessie or using Python 3.x...

Cheers!
 
1. 2.7.3
2. As best as I can tell I've never enabled/installed any of those.
3. Nope. I just installed sqlite3, Apache was already resident and serving pages because of the prior RaspberryPints installation.

Note that I have only ever run this on Wheezy and using Python 2.7.3.
I have no idea if it'll work without some massaging when run on Jessie or using Python 3.x...

Cheers!
First I want to thank you for not only your time spent on putting this together but also trying to help persons like me get it running. Now for the good news I got it running! Turns out there was a space on the first line before the shebang! I must have looked over the script a dozen time and finally saw it. Thanks again and as I play with this some more if I come up with any upgrades I will make sure to post them here.
 
fwiw, I have my logger running on Raspbian Jessie with the latest/greatest Apache2.
I followed my "instructable" to make sure it still worked, and found I needed to run the following command to get Apache2 to actually execute Python instead of displaying it as text:

Code:
$ sudo a2enmod cgi

Once I ran that everything worked same as "The Good Ol' Days" with Wheezy.

So, add that to the end of the instructions and you'll be good to go...

Cheers! :mug:
 
Hi Guys,

I'm trying to pimp up the webpage a little bit.
I want to add some gauges on the mainpage which so represent the actual temperatures measurd.

I've tried adding some from google. But with no success. :(

Has some one already tried to do this? Or maybe some one can help me check up my added code?
 
Hi,

Can someone help me I'm almost done. I'm trying to put a clock on the page. I put the code <?php echo date ("h:I"); ?> At the top of the temp_insert. Php file but when I do it puts the time above the thermometer in the right corner and pushes the temp icon into the poured/remaining text. I have no idea what I'm doing and if where it should go any help would be great. Thank you.

image.jpg
 
I think you're going to need to use relative positioning for that, but honest to gawd html is My Weakest Link, so I'm not going to be hella useful.

But if you get it figured out please post the code here :)

Cheers!
 
Thank you day tripper. I'm not good at html . I'm lucky I got the flow meters working and the temps logging. Only because you gave very good instructions. Thanks for all your hard work.
 
Hey day_tripper
Can you help me with the purge_dbase.py I don't think it's working I'm sure I did something wrong. I did this sudo crontab -e -u www-data and put this code at the bottom 00 00 * * 0 /home/pi/purge_dbase.py can you help me out? Does it matter if it doesn't get purged. Is there a manual way to purge it or delete it?

Thank you.
 
Just checked and it appears I ended up using the root account for the cron task.
And that was so long ago I can't remember why, but for sure it would have had something to do with permissions that I likely could have fixed another way ;)

Anyway...

If you never purge the database back it'll continue to grow and eventually you'll notice the added latency in plotting the graph.

Code:
$ sudo crontab -e

0 0 * * * /home/pi/purge_dbase.py > /dev/null 2>&1

Save it and you should be good. Don't forget to get rid of whatever other purge task you have set up in cron.

You can run the same python script from a terminal:

Code:
$ sudo python purge_dbase.py

Cheers!
 
After being absent for awhile I installed everything new and having a problem with the logger. It show on the web page but does not automaticaly plot the time. I have to run the "python script" manualy for it to work.
I did the cron job in both "www-data" and "root" and it is set for 5 min.
Any help would be gr8.

And the graph is gone to
 
Ok got it working:D
Another question: if you are on the "webgui" web page the temp log is shown for "the last 24 hours" as default. What do I change to have it say "last 6 or 1 hour" as default in the webgui.py folder.
tx
 
In webgui(x).py, look for two instances of these two lines:

if option is None:
option = str(24)

You can change the value of str to 1, 6, 24, 48, 168, or 240, to have the graph and table display the corresponding number of hours of data by default...

Cheers!
 
What browser are you using? And have you tried others?

When you click on the thermometer the log graph and tables are displayed correctly?
The only thing missing is the "scrolling" display?

The fact that the thermometer appears at all says you have an entry in the RaspberryPints index.php pointing to the temp_insert.php correctly, so I expect if there's a problem it's with your edit of the latter...

Cheers!
 
No I've only tried Chromium.

Nothing happens when I click on the thermometer as well. I put the code in for the graphic as per the instructions.

I'm thinking I've missed something in the coding to put the scrolling temps in.

When I go to the localhost/cgi-bin/webgui2.py I get the page with the temp logs but no graph. I think that might be an issue with the browser. I can't get to most websites on my Pi with Chromium due to bad certificates. Not sure what is going on with that as well.

Thanks.
 
Got it. Post 118 for the header right I was missing the code to get to the temp sensors. Every time I tried it last night it would cut the taps out of the screen. I think I had it going to the wrong file.

Works now and I have my flow meters working as well. Just have to install it in my beer frig as I've been bench testing everything before install

Thanks for all the info between the threads I've been able to get this all working!

View attachment ImageUploadedByHome Brew1497837103.887476.jpg
 
Hello guys!

So in another thread I mentioned a great idea of adding temp displays to the raspberrypints screen. Awesome "original" thought....

you guys beat me to it by a LONG shot. I have a different approach though. decouple the uno and the pi. I abandoned the Uno for the ESP series MCUs. mainly for their form factor and built in Wifi/BT. I want to implement what we have here, but dont want to have a USB between the pi and the ESP.

that could lend itself to scalability as you can have multiple ESPs (keezers, ferm chambers, fridges, brewday, whatever) and 1 pi. Ive mentioned before that I dont know python or php, but I do know html sql, and c/c++/c#. also a network engineer by trade. I will eventually ask some questions regarding how all this actually work, but I have more reading to do first. my goal is to convert it to take readings from wifi instead of serial.
 
I just found others that have done similar in other threads... I should stop posting until i read through it all lol...
 
Somewhere I posted an RPints python file showing how to use an AlaMode on the RPi serial port per the original scheme, or an Uno connected via USB, Bluetooth (using an HC-05) or Wi-Fi (using an esp8266)...

Cheers!
 
Whoops!
Someone forget to re-enable the keezer compressor control after swapping kegs and pulling the Eva-Drys for a drying cycle last night.
I can testify that a +14°F warm-up definitely affects pours :drunk:

keezer_plot_17oct2017.jpg

Stupid brewer trick, and almost enough to get me to add some alarms to this project...

Cheers!
 
HI Thank you for the project,

Is there any way to change the date format that displays on webgui2.py to DD-MM-YYYY??
 
For each recorded temperature reading monitor_(n)sensor.py writes a database row with datetime('now','localtime'), then webgui(n).py extracts the first value of each record as 'Time' with no evident formatting.
You'd have to insert a conversion in webgui(n).py to convert datetime into the format you desire, and then hope the Google graphing API doesn't puke on it...

Cheers!
 
For each recorded temperature reading monitor_(n)sensor.py writes a database row with datetime('now','localtime'), then webgui(n).py extracts the first value of each record as 'Time' with no evident formatting.
You'd have to insert a conversion in webgui(n).py to convert datetime into the format you desire, and then hope the Google graphing API doesn't puke on it...

Cheers!
HI sorry to bother you how would I do that ??
 
Hi Day_trippr
just wondering if you would have an example on how to change

curs.execute("SELECT * FROM temps WHERE timestamp>datetime('now','localtime','-%s hours')" % interval)

to display date and time in day-month-year hour:min

thankyou in advance

Greg
 
Back
Top