Author Topic: Calling the API ... 404?  (Read 2580 times)

flummoxed

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Calling the API ... 404?
« on: January 22, 2015, 10:32:36 AM »
I keep getting "404 Not found" whenever I try to use the manual: http://files.theenergydetective.com/docs/TED5000-API-R330.pdf to access my data.  I have:

Ted Pro Home with 1 mtu
ECC Version 1.0.627
Footprints Version 1.0.625

The ecc on my network is 192.168.1.82   "ted"

I would like to grab minute history and between pages 10 & 12 of the doc we have a sample url:

http://TED5000/history/minutehistory.xml?MTU=1&COUNT=100&INDEX=10

COUNT and INDEX are optional (P10), so for me I interpret that to mean:

wget http://ted/history/minutehistory.xml?MTU=0
--2015-01-21 22:13:42--  http://ted/history/minutehistory.xml?MTU=0
Resolving ted... 192.168.1.82
Connecting to ted|192.168.1.82|:80... connected.
HTTP request sent, awaiting response... 404 Not found
2015-01-21 22:13:42 ERROR 404: Not found.

I've tried lots of variations all without success.  Also, the doc mentions (P3) that I can get live data like so:

wget http://ted/api/LiveData.xml
...
 ERROR 404: Not found.

Or, maybe not.  Elsewhere on the forum here I have learned that it's really called "DashData.xml" now, not LiveData -

wget http://ted/api/DashData.xml
...
“DashData.xml” saved

I find no mention of DashData in the manual.

So, do I have the wrong manual?  I see no other out there. 
What am I doing wrong?

Thx.

Flummoxed in the NW.

pfletch101

  • Sr. Member
  • ****
  • Posts: 427
  • Karma: +0/-0
    • My home page
Re: Calling the API ... 404?
« Reply #1 on: January 22, 2015, 07:13:40 PM »
I keep getting "404 Not found" whenever I try to use the manual: http://files.theenergydetective.com/docs/TED5000-API-R330.pdf to access my data. 

The clue is in the link in your question! You are trying to use the TED5000 API to access the TED6000. The two APIs are closely related, but sufficiently different that this doesn't work!

I have been unable to find a link to the Ted6000 API on the TED site, so I have attached a copy of the latest version I have here - I received it from the TED folks with no non-disclosure requirements, so there should be no problem with this. You should, however, also read the thread about the API  in the Developer section here (http://www.theenergydetectiveforums.com/index.php/topic,2953.0.html), since there are some errors in the document which are corrected there.
Peter R. Fletcher
TED Pro Home - main MTUs monitoring utility and PV Solar feeds; 2 Spyders monitoring selected individual circuits

flummoxed

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: Calling the API ... 404?
« Reply #2 on: January 23, 2015, 08:33:13 AM »
Thanks Peter! 

I was suspecting as much.  I requested the current document referencing that support email in the thread but did not receive anything (yet).

Between your doc and that thread I was able to fix my wget for minute data.  These work now for me:

wget -O mtu-export.csv http://ted/history/export.csv?T=2&D=0&M=1
wget -O mtu-export.xml http://ted/history/export.xml?T=2&D=0&M=1

for csv or xml formats. 

csv takes around 1.6 seconds and xml 1.8 or so on average for me.

Thx again.

Not so Flummoxed any longer...

pfletch101

  • Sr. Member
  • ****
  • Posts: 427
  • Karma: +0/-0
    • My home page
Re: Calling the API ... 404?
« Reply #3 on: January 23, 2015, 06:59:25 PM »
You're welcome!

I have observed a much bigger differential between the time taken by CSV and XML downloads (XML much slower), but part of this depends on the amount of data being downloaded - communications overhead contributes proportionately more of the time for smaller data sets. If you plan to download data frequently to a continuously running application (as I do), there are good theoretical reasons for using the raw data format, since it is much faster, and consequently loads the ECC much less. In practice, however, using the CSV format does not seem to cause any perceptible problems. I used the CSV format for quite a while before the TED6000 raw formats were available. I have now switched (back) to using the raw format, but I had already written all the supporting functions for the TED5000 version of my application (where it mattered!), so it was easy to switch.
Peter R. Fletcher
TED Pro Home - main MTUs monitoring utility and PV Solar feeds; 2 Spyders monitoring selected individual circuits