Failed to open the device: 'AlarmDecoder' object has no attr

General Discussion

Failed to open the device: 'AlarmDecoder' object has no attr

Postby wls-canada » Tue May 15, 2018 10:43 pm

Having a very old version of the webapp for an AD2USB, I installed the latest from Git https://github.com/nutechsoftware/alarmdecoder-webapp

However, after setting the AlarmDecoder settings, Device Testing fails thus:

Opening device ✘ Failed to open the device: 'AlarmDecoder' object has no attribute 'on_ready_changed'
Saving device configuration ✘ There was an error sending the command to the device.
Keypad communication (Send) ✘ There was an error sending the command to the device.
Keypad communication (Receive) ✘ There was an error sending the command to the device.

I can't find anything on that first critical bit... here is the gunicorn log

May 16 02:35:45 flamen gunicorn[16065]: ERROR in decoder [/opt/alarmdecoder-webapp/ad2web/decoder.py:927]:
May 16 02:35:45 flamen gunicorn[16065]: Error while testing device open.
May 16 02:35:45 flamen gunicorn[16065]: --------------------------------------------------------------------------------
May 16 02:35:45 flamen gunicorn[16065]: Traceback (most recent call last):
May 16 02:35:45 flamen gunicorn[16065]: File "/opt/alarmdecoder-webapp/ad2web/decoder.py", line 919, in _test_open
May 16 02:35:45 flamen gunicorn[16065]: self._alarmdecoder.open()
May 16 02:35:45 flamen gunicorn[16065]: File "/opt/alarmdecoder-webapp/ad2web/decoder.py", line 292, in open
May 16 02:35:45 flamen gunicorn[16065]: self.bind_events()
May 16 02:35:45 flamen gunicorn[16065]: File "/opt/alarmdecoder-webapp/ad2web/decoder.py", line 323, in bind_events
May 16 02:35:45 flamen gunicorn[16065]: self.device.on_ready_changed += build_message_handler('ready')
May 16 02:35:45 flamen gunicorn[16065]: AttributeError: 'AlarmDecoder' object has no attribute 'on_ready_changed'
wls-canada
newt
newt
 
Posts: 7
Joined: Sun Dec 20, 2015 9:10 pm

Re: Failed to open the device: 'AlarmDecoder' object has no

Postby wls-canada » Wed May 16, 2018 12:06 am

Found the problem in https://github.com/nutechsoftware/alarmdecoder

The pip install for alarmdecoder installs an older version that does not have the class definitions for the latest alarmdecoder-webapp. I had to go to the source.
wls-canada
newt
newt
 
Posts: 7
Joined: Sun Dec 20, 2015 9:10 pm

Re: Failed to open the device: 'AlarmDecoder' object has no

Postby jasonsf » Wed May 16, 2018 8:24 pm

Can you give some detail on how you fixed this. I'm using the current docker image and getting the same issue. I'm not familiar enough with python.pip to know what the solution is.

Jason

EDIT: After looking a bit more, I don't think I'm having the same issue. I didn't instal Alarmdecoder through pip. I have the latest from the git repo.
jasonsf
Senior Nut
Senior Nut
 
Posts: 60
Joined: Sun Oct 16, 2016 2:43 pm

Re: Failed to open the device: 'AlarmDecoder' object has no

Postby wls-canada » Fri May 18, 2018 8:55 am

Jason,

I'm no python programmer either, but take a look in your alarmdecoder source for decoder.py, for the class AlarmDecoder(object) definition. Verify that you see the on_ready_ changed. (Note, this is a different file than the similarly-named decoder.py that exists in your webapp source).

Code: Select all
class AlarmDecoder(object):
    """
    High-level wrapper around `AlarmDecoder`_ (AD2) devices.
    """

    # High-level Events
    on_arm = event.Event("This event is called when the panel is armed.\n\n**Callback definition:** *def callback(device, stay)*")
    on_disarm = event.Event("This event is called when the panel is disarmed.\n\n**Callback definition:** *def callback(device)*")
    on_power_changed = event.Event("This event is called when panel power switches between AC and DC.\n\n**Callback definition:** *def callback(device, status)*")
    on_ready_changed = event.Event("This event is called when panel ready state changes.\n\n**Callback definition:** *def callback(device, status)*")
wls-canada
newt
newt
 
Posts: 7
Joined: Sun Dec 20, 2015 9:10 pm

Re: Failed to open the device: 'AlarmDecoder' object has no

Postby jasonsf » Sun May 20, 2018 11:08 am

Thanks for the response, wls-canada. I've reinstalled from the pre-configured docker image and am getting a different issue now. I posted here: viewtopic.php?f=3&t=809

Jason
jasonsf
Senior Nut
Senior Nut
 
Posts: 60
Joined: Sun Oct 16, 2016 2:43 pm


Return to General

Who is online

Users browsing this forum: No registered users and 9 guests

cron