Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: ph_getitcurl errors Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
MrGibbage
Super User
Super User
Avatar

Joined: October 23 2006
Location: United States
Online Status: Offline
Posts: 513
Posted: June 13 2016 at 16:04 | IP Logged Quote MrGibbage

I haven't had to make any changes or adjustments to my PH system in months. But lately I noticed I wasn't getting my
usual push messages on my phone. Troubleshooting trigger and macros, I have seen that the ph_getitcurl() command that
used to work just fine all of a sudden returns an error:
ph_getitcurl("{URL}",20)

*ERROR* - TIMEOUT WAITING FOR RETURN 1
https://phca-web.appspot.com/send?username=XXX&password=XXXX &gardoorstatus=Closed&verbose=true

I have the url written to the event log, and the URL does just fine when I paste it in firefox and everything happens
like it should.

So, as I dug around, I saw a post about a missing msinet.ocx. I looked in my system32 directory, and whatdayaknow?
Mine was missing. I have no idea how that could have happened, because it has worked perfectly for so long. So I
found a copy of msinet.ocx, copied it in the system32 directory, and ran regsvr32 on it. It came up successful, but
alas, I still get the same error in PH.


__________________
Skip
Back to Top View MrGibbage's Profile Search for other posts by MrGibbage
 
smarty
Super User
Super User
Avatar

Joined: May 21 2006
Location: United States
Online Status: Offline
Posts: 722
Posted: June 14 2016 at 08:43 | IP Logged Quote smarty

Skip,
    For pulling information off my Radio Thermostat's, I use a command that looks like ph_getitcurl("http://{IP_TSTAT-LIV}/tstat",5).

Because I use this to get room temperatures, I pull this data with a timed event once every 3 minutes (or when I manually ask for it).

I too have seen where this command times out and does not return successfully (even though my network is up, my T-stats are connected to my local network [via a strong Wi-Fi signal] and all should be OK).

I went so far as to quantify how many successful vs. un-successful occurrences happen over time. Since I am doing this once per three minutes, I thought it should be easy to track down.

Well, I haven't been able to track it down to any specific cause. Manually, I can request the data and get a time out one time, and then try again literally moments later and get a hit or get a miss. most of the time for me, my hit percentage is about 90%. When it drops below this, I find that a computer reboot and/or a WAP reboot will bring it back, but only again to 90% or so (even if I extend the wait time to the 20 seconds like you have it).

As I recall, this command was re-worked by Dave not too long ago.   I believe the rework was done because I asked for a time out option for the command because of the issues I was seeing at the time. See this

link

Since your request works within your web browser (mine always seen to show OK in my web browser also - although I have not put any statistics to it), this leads me to think that maybe this could be a PH issue/bug...maybe????

Steve

Edited by smarty - June 14 2016 at 08:48


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

Joined: October 23 2006
Location: United States
Online Status: Offline
Posts: 513
Posted: June 14 2016 at 18:44 | IP Logged Quote MrGibbage

Well, that's strange. The "20" in the command is the timeout, and the error message indicates that a
timeout has occurred as reported by the OS. But when I look at the log, the error is occurring within
one second of running the command. It definitely is not waiting 20 seconds.

__________________
Skip
Back to Top View MrGibbage's Profile Search for other posts by MrGibbage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4421
Posted: June 14 2016 at 18:57 | IP Logged Quote dhoward

Skip,

Most likely what happened is a change to your Windows
or Internet Explorer environment (an update or patch
most likely). The msinet.ocx is heavily based upon
Microsoft's Internet Explorer framework and dates back
to the days of VB6. It's entirely possible that
Microsoft is phasing out the use of this control. I'll
have to do some research to see what I can find out.

If memory serves, Im pretty sure you're using the
ph_getitcurl function vs the ph_geturl1 function due
to some problem the ph_geturl1 function had with this
particular URL but cant remember the specifics. It
seems like it may have been due to the SSL which a
type of 1,2,or 3 in the ph_geturl1 function will now
handle.

Also, another possibility would be to try and use the
ph_getwburl function as this will (should) actually
use Internet Explorer to perform the query (and
hopefully is still supported in the current versions
of Windows and IE).

Let me know,

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

Joined: October 23 2006
Location: United States
Online Status: Offline
Posts: 513
Posted: June 14 2016 at 20:19 | IP Logged Quote MrGibbage

By the way, I am using 2.1.5c

I was having trouble with the ph_geturl1() before, and I think you are right that it was related to
the SSL. I tried running your suggestions. ph_geturl1(URL, *, 20) all crashed. I had to ctrl-alt-
delete to shut down PH and restart. 0, 1, 2, and 3 all crashed. ph_getwburl did not crash, but
nothing happened. Those were all pointing to the https site.
Then I tried just pointing to the http site, and using ph_getwburl() is working just fine. I'd like
to keep the SSL working, so I do hope that we can get to the bottom of this.

I am 100% sure it was not any sort of windows update that started all of this because I have the
updates for this machine disabled. I wonder instead if it is something that changed on my site.
It's a google apps site (mysite.appspot.com) so they could have update the SSL or something??? I
don't know... Is there any chance that ph_getiturl could work without msinet.ocx?

__________________
Skip
Back to Top View MrGibbage's Profile Search for other posts by MrGibbage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4421
Posted: June 14 2016 at 20:44 | IP Logged Quote dhoward

Skip,

No way that ph_getitcurl will work without msinet.ocx. That file needs to exist and be properly registered.

One thing to keep in mind though is that on a 64 bit Windows OS, the standard *.ocx such as msinet.ocx will be located in c:\windows\syswow64. I would check there to see if
your copy actually exists there and register the copy there if it does (or copy the file there and then register it).

If memory serves, the Catalyst controls used by the various socket functions were upgraded between version 2.1.5c and 2.1.5d. I would not expect the ph_geturl1 function to
crash so will definitely need to investigate that. It's possible that your Catalyst controls arent properly registered which might account for the crash. The Catalyst *.ocx
should also be located in your syswow64 directory (assuming you're on a 32 bit OS) and all have the format of CS???AX8.OCX. I would definitely make sure they're registered
as well (I like to launch a command prompt by using "Run as administrator" and then execute the regex32.exe command from there).

Let me know,

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

Joined: October 23 2006
Location: United States
Online Status: Offline
Posts: 513
Posted: June 15 2016 at 20:10 | IP Logged Quote MrGibbage

I reregistered (as administrator) all of the cs*ax8.ocx files, and the msinet.ocx. They were all present in the
syswow64 directory as you suggested. I tried rerunning the ph_getitcurl command and it still returned *ERROR* -
TIMEOUT WAITING FOR RETURN 1 within one second of running the command on a url with SSL. It is not waiting the 20
seconds as one would think. It works fine on non-SSL sites.

I think I do have curl installed on the machine, so I can give that a try.


__________________
Skip
Back to Top View MrGibbage's Profile Search for other posts by MrGibbage
 
MrGibbage
Super User
Super User
Avatar

Joined: October 23 2006
Location: United States
Online Status: Offline
Posts: 513
Posted: June 15 2016 at 20:12 | IP Logged Quote MrGibbage

By the way, this is a Vista machine, if that matters. It's been running perfectly, so I didn't want
to mess with it by upgrading. That's why I disabled the patches and updates.

__________________
Skip
Back to Top View MrGibbage's Profile Search for other posts by MrGibbage
 
smarty
Super User
Super User
Avatar

Joined: May 21 2006
Location: United States
Online Status: Offline
Posts: 722
Posted: June 16 2016 at 08:56 | IP Logged Quote smarty

MrGibbage wrote:

I think I do have curl installed on the machine, so I can give that a try.


I use curl to "push" commands to my Tstats...I have not thought of using curl to "pull" information from them...curious to hear how this goes for you.

Steve

__________________
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