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