Page 1 of 1

Automate download of csv files

Posted: 31 Mar 2014, 09:17
by sudda
I would like to automate download of csv files for my station (and modules) once every 24 hours for import to a database. I'm trying to use getmeasurecsv but I cannot get it to work. I know this call is not documented in the public API yet..

I'm using vb.NET and although I'm actually no programmer I'm able to read individual measurements for my station/modules so I got the basic stuff working.

Here's the URL I'm trying to use:

Code: Select all

https://api.netatmo.net/api/getmeasurecsv?access_token=*my token goes here*&device_id=70%3Aee%3A50%3A02%3A95%3A64&module_id=02%3A00%3A00%3A02%3Aa4%3A3c&type=Temperature%2CHumidity&scale=max&format=csv&datebegin=3%2F30%2F2014&timebegin=07%3A00+AM&dateend=3%2F30%2F2014&timeend=08%3A00+AM&date_begin=1396159200&date_end=1396162800
Decoded it reads something like:

Code: Select all

https://api.netatmo.net/api/getmeasurecsv?access_token=*my token goes here*&device_id=70:ee:50:02:95:64&module_id=02:00:00:02:a4:3c&type=Temperature,Humidity&scale=max&format=csv&datebegin=3/30/2014&timebegin=07:00 AM&dateend=3/30/2014&timeend=08:00 AM&date_begin=1396159200&date_end=1396162800
In my code all that's returned is:
OK {200}
13;

If I try the link with wget I get:
HTTP request sent, awaiting response... 200 OK
Length: 3 [text/csv]
Saving to: `data.txt'
Data.txt conatins: 2;

Any hints on how to use getmeasurecsv?

Re: Automate download of csv files

Posted: 06 Apr 2014, 17:19
by RiseUp
In the wget response you posted, it says:
Saving to: `data.txt'
Data.txt conatins: 2;
Is it creating a file named "data.txt" on your hard drive somewhere (possibly in the same folder as wget)?

Re: Automate download of csv files

Posted: 15 Apr 2014, 07:13
by sudda
Haven't had the time to fiddle with this since my last post, but just to be clear:

The actual content of the file data.txt when running wget is just : "2;"

When running from my .Net code I get "13;" in the reply, nothing more.