Author Topic: 3rd party server posting problems - 301 error!  (Read 4762 times)

agm

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
3rd party server posting problems - 301 error!
« on: February 13, 2014, 12:17:01 AM »
I want to post the energy data from TED to a server. I have the activation file in .xml format as given in the instructions, in my server. However the TED was able to access it once and the activation got disconnected and now when I try to activate the 3rd part posting with the activation url and unique identifier, it says TED cannot connect to the 3rd party server. The http://ted5000/stats.htm page says I have a 301 error. I have tried reconnecting it several times with no success. I got a 100 error few times.But, its mainly a 301 error which is a redirection error. I'm not too sure why I'm getting that error and how it can be sorted out. I know the act.xml file is there in the server and visible because I can access it via its url. It'll be really helpful if someone can help me out! I also have the .php file as given in the pdf. I don't see anywhere else where I could have gone wrong.

activation url : www.aaaaa.com/act.xml ( sample domain name. I have used the real domain name during activation)
unique identifier : 12345 ( some random number)

This is my act.xml
<?xml version="1.0"?>
<ted500ActivationResponse>
 <PostServer>www.aaaaa.com</PostServer>
 <PostURL>www.aaaaa.com/postData.php</PostURL>
 <UseSSL>F</UseSSL>
 <PostPort>80</PostPort>
 <AuthToken>12345</AuthToken>
 <PostRate>1</PostRate>
 <SSLKey>NOT IMPLEMENTED</SSLKey>
</ted500ActivationResponse>

This is my php

<?php
date_default_timezone_set('America/Chicago');

$outp = fopen("output." . date("YmdHis") . ".xml", "w");
fwrite($outp, $HTTP_RAW_POST_DATA);
fclose($outp);

?>

 Since I'm posting data to a remote server and there are chances that $HTTP_RAW_POST_DATA might not be recognized, I also tried
<?php
date_default_timezone_set('America/Chicago');

$outp = fopen("output." . date("YmdHis") . ".xml", "w");
fwrite($outp, file_get_contents("php://input"));
fclose($outp);

?>

Also, what's the difference between the unique identifier on the 3rd party activation menu in TED and the AuthToken in act.xml? Should both of them be the same?
« Last Edit: February 13, 2014, 01:17:55 AM by agm »

RussellH

  • Sr. Member
  • ****
  • Posts: 356
  • Karma: +0/-0
Re: 3rd party server posting problems - 301 error!
« Reply #1 on: February 13, 2014, 09:16:25 PM »
This is all way over my level, but I would make one suggestion:  Reboot the TED.  You can do it from the Footprints page.

I use 3rd party posting to a provider.  When I have a power failure, I have to reboot the TED to get it working again.  My theory is that the TED comes up before my router is ready.  By rebooting when the router is working the network connection is established correctly.


agm

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Re: 3rd party server posting problems - 301 error!
« Reply #2 on: February 14, 2014, 12:56:48 AM »
Thanks RussellH. I tried a reboot. That didn't solve the problem.

Support7

  • Administrator
  • Sr. Member
  • *****
  • Posts: 472
  • Karma: +1/-0
Re: 3rd party server posting problems - 301 error!
« Reply #3 on: February 14, 2014, 02:10:04 AM »
Hello agm,

When attempting to reconnect are you deactivating and reactivating the 3rd party posting? What firmware are you running on your Gateway?

Regards,

TED Forum Support

agm

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Re: 3rd party server posting problems - 301 error!
« Reply #4 on: February 14, 2014, 10:39:29 PM »
Yes! I'm deactivating and reactivating the 3rd party posting when I'm trying to reconnect. I did a firmware update. The version I am running now is - Gateway version 499 and Footprints version 281. I am now successfully connected. However, data is not being sent by TED or not being written in the output XML file. I'm not sure which. My output.xml is sometimes being created. But its empty.

I have attached an image of the statistics page. Bytes uploaded in this page showed constantly changing value . But it stopped after a while! Now its not changing.