TED eventually fails with HTTP 401 error

My TED 5000 successfully posts to the PVOutput API for a day or two before abruptly encountering HTTP 401 errors. The TED Statistics page does not provide enough information to determine the flavor of HTTP 401 error. Selecting “Deactivate Energy Posting” and then “Activate Energy Posting” (and reentering the Activation URL and Key, which are not cached) resolves the problem for another few days before it fails again, without warning or notification. Any ideas?

|**Activated**|**Act. Status**|**Attempts**|**Success**|**Result**|**Last Timestamp**|
| --- | --- | --- | --- | --- | --- |
|1|0|642|190|401|1571474640|
|Server|api.pvoutput.org:80|
|URI|/service/r3/tedpost.jsp|

|**Activated**|**Act. Status**|**Attempts**|**Success**|**Result**|**Last Timestamp**|
| --- | --- | --- | --- | --- | --- |
|1|0|645|191|200|1571475449|
|Server|api.pvoutput.org:80|
|URI|/service/r3/tedpost.jsp|

TED5000
Gateway Version 1.0.499
Daughterboard Version 1.0.115
Footprints Version 1.0.281
MTU Version 1.0.61

A 401 error means the auth token passed in tedpost request does not match the current token.

Deactivating and reactivating energy posting calls the tedauth again which renews the token.

Thank you. Can the tedauth call be automated to renew the token without manual intervention?

I do not know if this helps. I have a static IP address specifically for remote control of my heating system via the web. I have not had any of the described problems after configuring my TED 5000 for that static IP address. Cost is about $6.00 monthly in addition to my Internet service.

Update for anyone who cares: I used Wireshark to sniff the calls issued via the aforementioned TED menu options and a cron job to issue them automatically every few hours to renew the token. Works great!

#!/bin/bash

echo "Deactivating TED to PVOutput..."
curl -s -o /dev/null -u <TED username>:<TED password> "http://<TED IPA>/api/setSystemData.cgi?FIELD=T&VALUE="`date +%s000`
curl -s -o /dev/null -u <TED username>:<TED password> "http://<TED IPA>/api/setSystemData.cgi?FIELD=3DEACT"

echo "Reactivating TED to PVOutput..."
curl -s -o /dev/null -u <TED username>:<TED password> "http://<TED IPA>/api/setSystemData.cgi?FIELD=T&VALUE="`date +%s000`
curl -s -o /dev/null -u <TED username>:<TED password> "http://<TED IPA>/api/setSystemData.cgi?FIELD=3ACTH&VALUE=pvoutput.org"
curl -s -o /dev/null -u <TED username>:<TED password> "http://<TED IPA>/api/setSystemData.cgi?FIELD=3ACTP&VALUE=/service/r3/tedauth.jsp"
curl -s -o /dev/null -u <TED username>:<TED password> "http://<TED IPA>/api/setSystemData.cgi?FIELD=3ACT&P=80&S=0&C=<PVO ID>"

echo "Done!"
1 Like