Page 7 of 8

Re: Proliphix™ Plugin Discussion

PostPosted: Fri May 16, 2014 11:49 am
by berkinet
HFTobeason wrote:
As of yesterday (MAY15), I started seeing these errors:
... ...
Any thoughts/solutions/etc most appreciated. Thanks.

Has anything changed on your system? Did you update the thermostat firmware? Which version if Indigo and the plugin are you running?

Re: Proliphix™ Plugin Discussion

PostPosted: Fri May 16, 2014 12:07 pm
by HFTobeason
Thank you for your reply.

The only thing that changed, to the best of my knowledge, was the update to OSX 10.9.3. Nothing changed on the thermostat end. Yesterday, when the problem started, I was running Indigo 6.0.11 - as of this AM, I'm running 6.0.12. I'm running Proliphix Thermostat 1.9.8, and have been for a while.

I'm also seeing these with some regularity:

Code: Select all
  Proliphix Thermostat Error      writeTstat: The device GI Upstairs Proliphix at "blah.axiscam.net" could not fulfill the request. Reason = HTTP Error 401: Authorization Required

Re: Proliphix™ Plugin Discussion

PostPosted: Fri May 16, 2014 12:08 pm
by HFTobeason
Let me also point out that the plugin does seem to be functioning - I'm still seeing updates from the therms.

Re: Proliphix™ Plugin Discussion

PostPosted: Sat May 17, 2014 1:22 am
by berkinet
I have observed the same authentication problem myself with one of my 2 NT20s. But, not the other. I have not been able to track down the cause of the problem.

I will look into the other issue you reported and see what I can find. Which model thermostat do you have?

Re: Proliphix™ Plugin Discussion

PostPosted: Sat May 17, 2014 9:16 am
by HFTobeason
I have two - an NT150e and an NT10e. It's the NT10e that is throwing the "writeTstat: The device GI Upstairs Proliphix at "blah.axiscam.net" could not fulfill the request. Reason = HTTP Error 503: Service Unavailable" error.

Re: Proliphix™ Plugin Discussion

PostPosted: Sat May 17, 2014 9:18 am
by HFTobeason
And I'm still seeing these errors pretty often:

Code: Select all
File "plugin.py", line 600, in actionControlThermostat
 File "plugin.py", line 280, in writeTstat
 File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 124, in urlopen
 File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 387, in open
 File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 498, in http_response
 File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 419, in error
 File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 360, in _call_chain
 File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 834, in http_error_401
 File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 812, in http_error_auth_reqed
 File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 822, in retry_http_basic_auth
 File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 381, in open
 File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 399, in _open
 File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 360, in _call_chain
 File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 1118, in http_open
 File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 1091, in do_open
 File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/httplib.py", line 928, in getresponse
 File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/httplib.py", line 385, in begin
 File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/httplib.py", line 349, in _read_status
<class 'httplib.BadStatusLine'>:

Re: Proliphix™ Plugin Discussion

PostPosted: Mon May 19, 2014 10:27 am
by HFTobeason
Any further thoughts on these errors?

Re: Proliphix™ Plugin Discussion

PostPosted: Mon May 19, 2014 12:11 pm
by berkinet
Nothing so far. It is pretty hard to track down a problem I can't duplicate. And even when I can, like the "writetstat" error, the problems seem to point to something in the stat not the plugin. But, I am still looking.

I need to do a complete re-write on this plugin. It was my first attempt and I have learned a lot since then.

Re: Proliphix™ Plugin Discussion

PostPosted: Mon May 19, 2014 12:20 pm
by berkinet
HFTobeason wrote:
Any further thoughts on these errors?


I probably should have provided a bit more response to this question. The errors are being thrown in urllib2 a standard Python module that is called by the plugin. Based on the error messages you have posted, an authentication error is taking place.

If this error occurred on every attempt, on every stat, it would point to a change in the firmware. But, I just can't figure out why this would happen some of the time?

I guess it is time to give their tech support team a call.

Re: Proliphix™ Plugin Discussion

PostPosted: Mon May 19, 2014 3:12 pm
by asw24b
berkinet wrote:
HFTobeason wrote:
Any further thoughts on these errors?


I probably should have provided a bit more response to this question. The errors are being thrown in urllib2 a standard Python module that is called by the plugin. Based on the error messages you have posted, an authentication error is taking place.

If this error occurred on every attempt, on every stat, it would point to a change in the firmware. But, I just can't figure out why this would happen some of the time?

I guess it is time to give their tech support team a call.



Could it just be this??:


Proliphix devices implement the Basic Access Authentication protocol specified in RFC 2617. All queries must provide proper credentials based upon the admin username/password pair. The device implements a timeout mechanism such that 20 minutes after the last successful access, the user is required to resend authentication information. This will come in the form of a 401 response even if proper credentials were sent in the current request.

Re: Proliphix™ Plugin Discussion

PostPosted: Tue May 20, 2014 1:04 am
by berkinet
asw24b wrote:
...Could it just be this??:

Proliphix devices implement the Basic Access Authentication protocol specified in RFC 2617. All queries must provide proper credentials based upon the admin username/password pair. The device implements a timeout mechanism such that 20 minutes after the last successful access, the user is required to resend authentication information. This will come in the form of a 401 response even if proper credentials were sent in the current request.


Thanks for the idea, but... probably not the cause of the problem. The plugin does a complete basic authentication on every attempt to write to the tstat.

For those that are interested, here is the code from writeTstat (the errors are occurring at f = urlopen(theUrl):
Code: Select all
      ######################################
        # create a password manager (This should be in a separate function)
        password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm()

        # Add the username and password.
        # If we knew the realm, we could use it instead of None.
        password_mgr.add_password(None, theUrl, user, passw)

        typeKey = model[0:2]
        if typeKey == "NT":
            # NT Devices use basic auth
            handler = urllib2.HTTPBasicAuthHandler(password_mgr)
            if self.logLevel > 2: self.debugLog('writeTstat: Using Basic auth for type key: %s' % (typeKey))
        else:           
            # Since it's not an NT, it must be an IMT, and we use digest auth
            handler = urllib2.HTTPDigestAuthHandler(password_mgr)
            if self.logLevel > 2: self.debugLog("writeTstat: Using Digest auth for type key: %s" % (typeKey))
        # create "opener" (OpenerDirector instance)
        opener = urllib2.build_opener(handler)
        urllib2.install_opener(opener)
        #######################################

        try:
            # req = Request(theUrl)
            f = urlopen(theUrl)     
        except URLError, e:
            # errorsDict = indigo.Dict()
            if hasattr(e, 'reason'):
                self.errorLog("writeTstat: Failed to reach device \"%s\" at %s. Reason = %s" % (device.name, address, e))
            elif hasattr(e, 'code'):
                self.errorLog("writeTstat: The device %s at \"%s\" could not fulfill the request. Reason = %s" % (device.name, address, e))       
            return     

New beta available

PostPosted: Thu May 22, 2014 6:49 am
by berkinet
I have made some changes in the way the authentication is managed. Rather than creating a new password manager on each query, a common manager is now created for all stats. Also, a specific handler is now created for each device in advance, and then re-used. So far I have not seen anymore writeTstat write errors. I have not been able to reproduce the other error reported by @HFTobeason, so I don't know if this update will address that issue.

Version 1.9.9 of the Proliphx plugin is available on dropbox.

Re: Proliphix™ Plugin Discussion

PostPosted: Fri May 23, 2014 3:06 pm
by HFTobeason
I'm not entirely certain why, but I'm no longer seeing any of the errors I reported. I'm running the 1.9.9 plugin as of yesterday, but the errors had tapered off a day or two prior. It's all just a mystery...

Re: Proliphix™ Plugin Discussion

PostPosted: Sun Nov 30, 2014 12:19 pm
by sparky21
Hi All,
I'm now to Indigo and I've got 4 Proliphix NT10e's that I would like to keep using, if possible. I'm using v1.9.9 of the plugin on Yosemite. At startup, things seem to be OK:

Code: Select all
Nov 30, 2014, 4:19:10 AM
  Starting Indigo Server version 6.0.18 (Mac OS X 10.10.1)

  Loading plugin "Proliphix Thermostat 1.9.9"
  Starting plugin "Proliphix Thermostat 1.9.9" (pid 25607)

  Proliphix Thermostat            Log level preferences are set to "Normal".

  Started plugin "Proliphix Thermostat 1.9.9"
  Proliphix Thermostat            Plugin Starting
  Proliphix Thermostat            Your plugin version, v1.9.9, is current.
  Proliphix Thermostat            Starting device Hall Thermostat

  Proliphix Thermostat            Starting device Master Thermostat
  Proliphix Thermostat            Starting device Studio Thermostat
  Proliphix Thermostat            Plugin started. Polling thermostats every 5.0 minutes with a 8.0 second timeout



The log is full of these errors:
Nov 30, 2014, 4:34:15 AM

Code: Select all
Proliphix Thermostat Error      readTstat: The device XXXXX Thermostat at "192.168.1.11" could not fulfill the request. Reason = HTTP Error 401: basic auth failed
  Proliphix Thermostat Error      readTstat: The device XXXX Thermostat at "192.168.1.22" could not fulfill the request. Reason = HTTP Error 401: basic auth failed
  Proliphix Thermostat Error      readTstat: The device XXXXX Thermostat at "192.168.1.14" could not fulfill the request. Reason = HTTP Error 401: basic auth failed


I'm sure that the credentials are correct, because I notice you can't get past the configuration dialog with bad credential.

Additionally, If I increase the log level and grab the URL, I am able to get successfully retrieve the data in the browser and I don't get a 401.

Also, If I restart the server, and I'm able to work through the app for maybe a minute, and then the 401 start coming. Even after openurl() returns 401s, putting the same URL in the browser works fine.

Any ideas on what might be the issue here?

Re: Proliphix™ Plugin Discussion

PostPosted: Sun Nov 30, 2014 4:42 pm
by sparky21
An update to my previous comment.
When I wiresharked, I couldn't find the authorization in the header, so I made the change below to the plugin.py file to make sure it gets in there each time. There are two changes, one for the read and one for the write.

So far this seems to be working:
Code: Select all
21d20
< import base64
282,284c281
<         req = urllib2.Request(theUrl);
<         base64string = base64.encodestring('%s:%s' % (user, passw)).replace('\n', '')
<         req.add_header("Authorization", "Basic %s" % base64string)
---
>
287c284
<             f = urlopen(req)     
---
>             f = urlopen(theUrl)     
377,379d373
<         req = urllib2.Request(theUrl);
<         base64string = base64.encodestring('%s:%s' % (user, passw)).replace('\n', '')
<         req.add_header("Authorization", "Basic %s" % base64string)
382c376,377
<             f = urlopen(req)
---
>             # req = Request(theUrl)
>             f = urlopen(theUrl)


I'm sure this isn't the most elegant solution, but it gets me up and running for now.