PDA

View Full Version : Exporting graphs on an Apex


garbled
03/01/2011, 12:44 PM
I just got my new Apex and wired it up the other night. I wanted a way to keep the graphs/data much longer term than the datalog provides for. Therefore, I wrote a quick set of scripts for UNIX/Linux machines that will grab the datalog off the apex, and build nifty graphs with rrdtool for my website. The script is somewhat hacked together, so it would take a little tweaking to get it to work for your personal configuration of outlets/probes/etc, however, if anyone wants it, I give it away freely.

A link to my graphs:
http://www.garbled.net/reef/data/Day.html

The code:
http://www.garbled.net/reef/data/neptune.tar.gz

A graph:
http://www.garbled.net/reef/data/ORP_daily.png

aquamanic
03/01/2011, 12:54 PM
Cool tool - I like it!

swearint
03/01/2011, 02:38 PM
I am confused, what does this do that the Apex can't? If you want to view data over a longer period than 7 days via the drop down, append the following to the URL of the graph page:

?sdate=YYMMDD&days=xx

This will give two weeks back from today: ?sdate=110301&days=14


Todd

garbled
03/01/2011, 02:54 PM
It does a few things differently:

1) I can store as much data as I want. I think I have it configured for something absurd like 10 years, and it's costing me ~6MB in disk space. (rrdtool pre-allocates the space)

2) I can put these graphs up directly on my webpage, without exposing my apex to the internet for people to muck with. This is the main reason for my hack, as I want to be able to see the data from work easily.

3) I can do a few neat tricks, like keep track of minimum/maximum value for the day, and stack the bars of my amp draw on top of each other so you can see total power draw easily.

It's not better than the apex internal graphs, it does a few things better, a few things worse, it's just handy to have in addition to them.

RussM
03/01/2011, 03:48 PM
Very cool! Nicely done. I used to do a lot of work with MRTG & RRD.

Oblivionis
03/02/2011, 08:09 AM
Very cool. Anything like that exist for Windows machines?

garbled
03/02/2011, 01:09 PM
It looks like there is an rrdtool version for cygwin on windows. I kind of use some nasty tricks to get the data off the apex, so you might have to rewrite that, and do a little massaging to get it to work on windows, but if you can gather the data, at least the rrd commands I wrote will help you build the graphs. I suspect my scripts will give you a good start on it at least. (rrd is the hard part, getting the data should be easy, a better version than mine would just use the handy XML, but I was lazy)

Because I was a little bored, I decided to see if I could compute rH from the pH and ORP, just to make another pretty graph. (ok, admission time, I'm kinda a graphing geek) It's not necc, useful information, but it's an interesting view of the data.

http://www.garbled.net/reef/data/rH_daily.png

Oblivionis
03/03/2011, 05:15 PM
It looks like there is an rrdtool version for cygwin on windows. I kind of use some nasty tricks to get the data off the apex, so you might have to rewrite that, and do a little massaging to get it to work on windows, but if you can gather the data, at least the rrd commands I wrote will help you build the graphs. I suspect my scripts will give you a good start on it at least. (rrd is the hard part, getting the data should be easy, a better version than mine would just use the handy XML, but I was lazy)

:spin1: I'm not sure what any of that means. Are you aware of any step-by-step instructions of how to make that happen?

RussM
03/03/2011, 07:05 PM
:spin1: I'm not sure what any of that means. Are you aware of any step-by-step instructions of how to make that happen?It means that what garbled has done is very much a "homebrew" project. There are no step-by-step instructions for this purpose using rrdtool. rrdtool is a quite powerful tool, but that power comes at the cost of a steep learning curve. Unless you are willing to learn scripting & programming languages like perl or php, spend a lot of time reading documentation, and expend mucho time debugging your handiwork, you should look at using the TankManager (http://www.kenargo.com/software/index.php#TankManage2) or Reeftronics (http://www.reeftronics.net) websites.