PDA

View Full Version : AC3 --- data logging to web page?


kajung2k
10/22/2008, 10:39 PM
Does anyone use their data logged from their AC3 and post it up to a web page real time..?

If you do, can you please post up, or pm your web page so I can see. Also if the code free? or is there another application that I would need to buy?

thanks.

drimo
10/23/2008, 08:23 AM
Tagging along.

NiNeX
10/24/2008, 11:03 AM
I have something for my personal use that I am working on, doubt it is really what you are looking for though as it is a bit more then just real time stats.

I run a web server on a unix machine at my house, and I have the unix machine request the status page from my ac3. It then parses and stores the information into a mysql database. I choose to do this because I wanted to log the status of the devices in case I ever wanted to see what happened while I was out.

At the moment I am still working on how I want the normal graphs to be overlayed with the device events that I have logged.

drimo
10/24/2008, 11:34 AM
<a href=showthread.php?s=&postid=13611757#post13611757 target=_blank>Originally posted</a> by NiNeX
I run a web server on a unix machine at my house, and I have the unix machine request the status page from my ac3. It then parses and stores the information into a mysql database.

I am interested in doing this as well as I am planning on integrating it with my test results. Do you mind sharing the script to extract the data or give some more details on it?

NiNeX
10/24/2008, 12:05 PM
Sure, basic work flow is using wget or similar to get the http://ip/cgi-bin/status.cgi page while passing in the http basic auth for the admin user, then doing some parsing for known locations.

Currently I have it all in a normal bash type shell script, but I was thinking on changing it to run from php cli script as the parsing and database code would be a bit cleaner then what I currently have written.

kajung2k
10/24/2008, 09:27 PM
ninex -- that's sweet! You know Melv has something on his web page that shows the status of his AC.. I'm going to have to ask him..

ninex --- good info though.. thanks!

NiNeX
10/24/2008, 10:47 PM
This weekend I'm going to work on redoing the script that parses the ac3 data and inserts it into the database. If there is interest I can post it up somewhere for others to use.

drimo
10/25/2008, 10:32 AM
<a href=showthread.php?s=&postid=13615951#post13615951 target=_blank>Originally posted</a> by NiNeX
This weekend I'm going to work on redoing the script that parses the ac3 data and inserts it into the database. If there is interest I can post it up somewhere for others to use.

Yes, definitely! Sounds great.

Lutefisk
10/25/2008, 01:32 PM
<a href=showthread.php?s=&postid=13615951#post13615951 target=_blank>Originally posted</a> by NiNeX
This weekend I'm going to work on redoing the script that parses the ac3 data and inserts it into the database. If there is interest I can post it up somewhere for others to use.

I'd like to see what you've done.

NiNeX
10/27/2008, 02:25 PM
Alright I have rewritten the parsing script into php and tried to comment everything inside.

http://www.ninex.org/reefcentral/ac3_weblog_0.2.zip

On my unix machine I have these files in my home directory, I then have a crontab entry that runs every 2 minutes to run the parse_ac3.php script that loads the data into the database.

I then have some php pages that I am still working on that are in the webroot folder for the system;
A form for me to add test results (Ca, Mg, Alk, etc...)
A page to see a graph for selected date/time range

Again, if there is interest I can share some of these other scripts as I get them more public ready, and try to get some time to write up a guide for setting up this logging system.

drimo
10/28/2008, 07:15 AM
Ninex, looks pretty good and easier than I thought it would be. Now I just have to find the time to try this out on my system! :) Thanks for sharing that with us.

Carlos
10/28/2008, 09:31 AM
If you are in windows, there is a yahoo widget out there that will monitor your AC3 and also has the option of creating an XML file every time it refreshes.

I have it set so I FTP the xml file to my webserver and then have cron jobs that take the xml file and bring it into a MySQL database.

Then I just use regular PHP to parse the info into my website.

Same results as NiNex, just a different way of going about it.

Carlos

d0ughb0y
10/28/2008, 11:16 PM
wouldn't it be simplier to parse if you make your script telnet to the ac3 to get the status using the "c" command instead of parsing the status web page?

NiNeX
10/28/2008, 11:57 PM
Coding php to use telnet would be more work then for http. And the dom model for html documents makes it easy enough to parse.

Plus using http will not interfere with the use of aquanotes, you can only have one session to the telnet service at a time.

d0ughb0y
10/29/2008, 02:00 AM
doesn't aquanote connect only on the polling interval?

NiNeX
10/29/2008, 01:17 PM
Honestly, I don't know the details about aquanote's connection to the controller. Maybe Ken or Curt would be able to answer that one?

clp
10/29/2008, 01:30 PM
AquaNotes keeps the telnet session open the whole time, even when it is not currently receiving data.

Curt

d0ughb0y
10/29/2008, 04:13 PM
<a href=showthread.php?s=&postid=13643931#post13643931 target=_blank>Originally posted</a> by clp
AquaNotes keeps the telnet session open the whole time, even when it is not currently receiving data.

Curt

is it correct that AC3 can serve one telnet connection only? or will a second connection disconnect the first one?

is it the same for http connection? say if a client makes an http connection and does not disconnect after getting the response, will another client be able to make an http connection?

thanks

clp
10/29/2008, 04:19 PM
Yes, only 1 telnet connection is allowed. A second connection attempt will be rejected, and the first connection will remain working. Multiple simultaneous http connections are allowed.

Curt

d0ughb0y
10/29/2008, 04:21 PM
will telnet commands work with http connection?

say I have the outputstream to an http connection and write "c\n", will it return the same data as a telnet connection?

thanks again.

clp
10/29/2008, 04:38 PM
No, only the standard http protocol is supported over port 80.

Curt