Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Bug Reports
 PowerHome Messageboard : PowerHome Bug Reports
Subject Topic: ph_getitcurl - timeout behavior Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
smarty
Super User
Super User
Avatar

Joined: May 21 2006
Location: United States
Online Status: Offline
Posts: 723
Posted: November 03 2014 at 14:12 | IP Logged Quote smarty

See the formula. I use this formula to get information from my Radio T-stats. However, about 5% of the time, this formula "times out", but the time it takes (to time out and return an error message) is NOT controlled by the "n" portion of the formula. The formula below SHOULD give up/time our after 20 seconds...but I have seen it take up to 140 seconds and return an error.

95% of the time it returns correct information within about 2-3 seconds (when it works fine)

Is this a bug?


ph_getitcurl("http://192.168.0.50/tstat",20)

ph_getitcurl PowerHome formula function

Description - Retrieves the HTML from the specified URL using a Microsoft ITC (Internet Transfer Control) Syntax

ph_getitcurl ( s, n )

Argument Description :
s The URL you wish to retrieve the HTML for.
n Specifies the timeout in seconds for the control to return the HTML. Specify a 0 for infinity.

Return value - String. Returns the HTML of the specified URL.

Usage - This function is similar to the ph_geturl and ph_getwburl in that the HTML for a specified URL is returned. This particular function uses the Microsoft ITC to accomplish this task.

Edited by smarty - November 03 2014 at 14:18


__________________
Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
Back to Top View smarty's Profile Search for other posts by smarty
 
smarty
Super User
Super User
Avatar

Joined: May 21 2006
Location: United States
Online Status: Offline
Posts: 723
Posted: November 03 2014 at 14:22 | IP Logged Quote smarty

I ran the above formula on a network that doesn't have the that IP address at all. The response was:

     Execution time: 42.055 seconds.
     The formula evaluates to: *ERROR* - TIMEOUT WAITING FOR RETURN

I was hoping to use the time out error response as a "device check" if you will....but if the error response it is somewhat flaky....it may not be too useful.

Edited by smarty - November 03 2014 at 14:22


__________________
Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
Back to Top View smarty's Profile Search for other posts by smarty
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4422
Posted: November 06 2014 at 18:38 | IP Logged Quote dhoward

Steve,

Not sure why the Microsoft Internet transfer control isnt following the timeout value. I checked the code and Im passing the value to the control but it definitely isnt following the value. In any event, Ive added an additional internal timer so if the ITC control doesnt timeout within the timeout value then PowerHome will interrupt the task anyways.

In my testing, its still possible that you'll get a timeout BEFORE the timeout value has expired. Apparently the timeout control has some internal timer (different from what we set with the timeout value) that can return a timeout fairly quickly if its determined that the URL isnt available. As such, Ive modified the error message to *ERROR* - TIMEOUT WAITING FOR RETURN 0 for the PowerHome internal timeout and *ERROR* - TIMEOUT WAITING FOR RETURN 1 for timeouts resulting from the ITC control.

This fix will be available in the upcoming version.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
smarty
Super User
Super User
Avatar

Joined: May 21 2006
Location: United States
Online Status: Offline
Posts: 723
Posted: November 07 2014 at 12:37 | IP Logged Quote smarty

Great.

I have been having good luck with my Radio brand thermostats.

I will have to post a "how to" for anyone that wants to go that route (I didn't go with Insteon because they don't support heat pumps - at least no with decent looking 7 day programmable T-stats).

__________________
Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
Back to Top View smarty's Profile Search for other posts by smarty
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum