AD2PI with existing Raspberry Pi

General Discussion

Re: AD2PI with existing Raspberry Pi

Postby Scott » Wed May 11, 2016 2:03 pm

Sounds like a plan. I'm here 10:30 to 6:00 PDT normally. Enjoy the vacation!
Scott
Expert Nut
Expert Nut
 
Posts: 118
Joined: Thu Dec 12, 2013 11:17 am

Re: AD2PI with existing Raspberry Pi

Postby R305 » Fri Dec 23, 2016 2:02 pm

Hi AD2* Team,

I am having the same issue as in this thread, but what was the conclusion? I have an AD2PI with a rPi 3. The alarmdecoder image flashed to it. The thing is hooked up and works nicely through the web app as a keypad. But following the smartthings integration steps on github, it stops at the "refresh" step for the smart app. Doesn't find the appliance.

Both the AD appliance and the ST hub are on the same network. I can access both at their respective addresses. Have deleted and re-installed / published the device handlers and smart app a couple times. A little help please?

Regards,
Rob
Last edited by R305 on Thu Dec 29, 2016 9:22 pm, edited 1 time in total.
R305
newt
newt
 
Posts: 14
Joined: Thu Dec 22, 2016 10:02 am

Re: AD2PI with existing Raspberry Pi

Postby kevin » Thu Dec 29, 2016 8:36 am

Please look at your alarmdecoder webapp log files and see if the discovery thread is running (device being announced via ssdp)
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

[SOLVED] Re: AD2PI with existing Raspberry Pi

Postby R305 » Thu Dec 29, 2016 9:05 pm

Hi Kevin and Scott,
Thank you very much for the help today via email. Excellent customer service. I am just documenting here in the forum what we did so that others can use it in the future.

1. Look at the webapp logs to see if "discovery" was working. On the alarmdecoder raspbian image, that is found in /opt/alarmdecoder-webapp/instance/logs. The file will be "info.log" or "info.log.1" etc., whichever has the most recent date modified.

2. In that log file, look for an entry near the most recent boot up time about whether discovery is running or had an error.
--Here is an example of discovery running correctly:
Code: Select all
INFO in discovery [/var/ad2usb_webapp/webapp/ad2web/discovery.py:69]:
Discovery running: loc=10.10.0.9:5000,
uuid=1213ec96-e17a-11e5-8c63-902b34538595

--Here is an example of discovery NOT running:
Code: Select all
2016-12-24 12:36:19,793 ERROR: Error [in /opt/alarmdecoder-webapp/ad2web/app.py:142]
Traceback (most recent call last):
  File "/opt/alarmdecoder-webapp/ad2web/app.py", line 135, in init_app
    app.decoder.init()
  File "/opt/alarmdecoder-webapp/ad2web/decoder.py", line 213, in init
    self._discovery_thread = DiscoveryServer(self)
  File "/opt/alarmdecoder-webapp/ad2web/discovery.py", line 59, in __init__
    sock.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq)
  File "<string>", line 1, in setsockopt
error: [Errno 19] No such device


3. If discovery.py not starting is the problem, then first try to reboot the webapp. At the TTY command prompt enter "sudo reboot".

4. After reboot, check the logs and also check to see if the smartthings / smartapp steps will discover the AD2Pi. If no difference then a minor code edit is needed. Here are the directions from Scott:
Code: Select all
   1. Open /opt/alarmdecoder-webapp/ad2web/discovery.py in whatever text
   editor you're comfortable in. (I used vi)
   2. Find the following line. (should be line 56)
      - sock.bind(('', self.MCAST_PORT))
   3. Change the line to read:
      - sock.bind((self.MCAST_ADDRESS, self.MCAST_PORT))
   4. Save and exit
   5. Reboot


5. One thing to note about this code change it'll keep the auto-updater from working correctly.. so when you get a notification that an update is available you'll have to go revert this change before it'll update. That can be done with the following command:
Code: Select all
cd /opt/alarmdecoder-webapp/ad2web && git checkout -- discovery.py


These steps solved the issue for my case.

Regards,
Rob
R305
newt
newt
 
Posts: 14
Joined: Thu Dec 22, 2016 10:02 am

Re: AD2PI with existing Raspberry Pi

Postby mastruck » Fri Dec 30, 2016 6:29 am

Thanks for posting this update. I am trying to determine if I have the same problem. I am also using AD2Pi with an existing Raspberry Pi, but I had no issues with device discovery during SmartThings install. I also added Zones (I'd be interested in a summary of your code changes as I want to make sure I didn't miss anything).

A couple of questions:
1. In the WebApp itself, when you go to the Zones and Keypad "tabs" what do you see? They are empty for me.
2. If I am able to successfully discover and install device during the SmartApp setup does that rule out that I have the problem that you experienced? Or, should I still try your solution?

Thanks, Mike
mastruck
newt
newt
 
Posts: 11
Joined: Thu Dec 29, 2016 5:14 pm

Re: AD2PI with existing Raspberry Pi

Postby mastruck » Fri Dec 30, 2016 6:52 am

I did check the app log (via WebApp Log tab) and it looks like Discovery is running OK per your description:

2016-12-30 14:49:15,712 INFO: AlarmDecoder Webapp booting up - v0.6.2-0-g6558799 [in /opt/alarmdecoder-webapp/ad2web/decoder.py:193]
2016-12-30 14:49:21,820 INFO: Discovery running: loc=192.168.1.34:5000, uuid=c0a167f3-0e52-11e6-898c-b827ebd0b2c6 [in /opt/alarmdecoder-webapp/ad2web/discovery.py:69]
2016-12-30 14:49:21,826 INFO: Attempting to reconnect to the AlarmDecoder [in /opt/alarmdecoder-webapp/ad2web/decoder.py:452]
2016-12-30 14:49:21,905 INFO: AlarmDecoder device was opened. [in /opt/alarmdecoder-webapp/ad2web/decoder.py:315]

I'm thinking I have a different problem.
mastruck
newt
newt
 
Posts: 11
Joined: Thu Dec 29, 2016 5:14 pm

Re: AD2PI with existing Raspberry Pi

Postby kevin » Fri Dec 30, 2016 8:41 am

If you are able to install and setup the smartapp and discover the alarmdecoder you are not having the same issue.

Zones and Keypad tab are unpopulated, those are user defined items that map a zone number to a name for human readable in notifications for example - nothing to do with smartthings at all.

If you are having trouble with SmartThings integration, I suggest emailing ad2usb@support.nutech.com with detailed issues and steps you have taken.
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: AD2PI with existing Raspberry Pi

Postby jgrant50 » Sun Mar 12, 2017 11:27 am

My apologies to everyone involved / following this thread. I dropped the ball and got side tracked, but decided to pick this up again over the weekend. I used the exact same hardware, but re-flashed the image to the SD card of my RPi 2. There have been 2 or 3 SmartThings firmware updates since May of 2016 as well. I followed the instructions exactly as written again and had no issues whatsoever this time. I was not able to configure a static IP for my device for whatever reason, so I just set a DHCP reservation and rebooted the device.

So far so good. Arm / DisArm / Stay / Away all work great.

If there's anything I can share to help other's, please feel free to ask.

Thanks.

Jason
jgrant50
newt
newt
 
Posts: 13
Joined: Mon Apr 25, 2016 1:05 pm

Previous

Return to General

Who is online

Users browsing this forum: Google [Bot] and 6 guests

cron