PHP Script to extract from Davis Datalogger

I’m trying to extract data from Davis IP Datalogger using a PHP Script.

Connection OK.
“VER\n” command reply’s ok

The “DMP\n” give me this result after transform from binary (i think) to HEX:


0600
29141c024a014e01460100000000b8750000e00084023e5b02030c0c00000000002cffffffffffffffff00ffffffffffffffffff
2914260247014901460100000000bf750000e00084023e5b01020c0c00000000002cffffffffffffffff00ffffffffffffffffff
2914580247014801460100000000c0750000e40083023e5c00020c0c00000000002cffffffffffffffff00ffffffffffffffffff
2914620247014801470100000000c2750000e40082023e5c00020c0c00000000002cffffffffffffffff00ffffffffffffffffff
29146c0245014801440100000000c3750000e50082023e5c00020c0c00000000002cffffffffffffffff00ffffffffffffffffff
ffffffff77e3

How can i get “human Readable Data” from this.

The Script:

<?php require_once "PHPTelnet.php"; $telnet = new PHPTelnet(); $result = $telnet->Connect('mydns','',''); if ($result == 0) { $telnet->DoCommand('NVER\n', $result); echo $result; echo " "; $telnet->DoCommand('DMP\n', $result); echo bin2hex($result[0]); $telnet->Disconnect(); } ?>

Hi again.

Back to this project i’ve already get what i want from Davis.

PHP script getting direct data from IP datalogger.

Only testing. Do F5 to refresh

http://www.meteomoita.com/daviscom/test.php

Good work, care to share the script?

Let me do some work on it.

The main goal of this script is to put all data on a mysql database and then we have a base to a realtime web page.

Now i’m testing it with on Davis IP datalogger, but it will work to with Serial, USB and off course, VirtualVP.

Since the job is all done in PHP and MYSQL it will work on Windows, Linux, MAC, etc…

I’ll post here the news.

I’ll not have time for this and maybe someone, maybe a PHP pro, can do a cool script using the small piece of code i’ve developed.

This is the LOOP sequence, but if you look at the manual (link below) you can control davis console using this script’s. HI/Lows, datalogger, etc…

So, here’s the code. You can try it with your IP Datalogger or a VirtualVP IP port:

Davis support documentation:

http://www.davisnet.com/support/weather/download/VantageSerialProtocolDocs_v230.pdf

I have downloaded it and had a quick play, I’ll see what I can do with it later but the basic script worked and outputs data.

Stuart

Well I have played with it a bit and it seems to hang VVP if you run it more than a couple of times or so, I get socket errors from VVP and then nothing can talk to that port until you restart VVP. Even restarting the virtual console does not fix it. This is running it across a LAN from a Linux box to VVP. So it looks like testing this is going to be a bit tricky. It would be nice to be able to read the archive and save it as I’m not sure reading loop packets is something I’d want to do in PHP.

I’ll probably play some more when I get a chance.

Stuart

As i’ve mentioned, i’m not a PHP expert. Just i bit working together with MYSQL.

So, programing using binary data, this kind of stuff it’s not my type.

Hope someone get this working well.