"plugin stopped" after router upgrade (AD2Pi)

User avatar
Professor Falken
Posts: 293
Joined: Sun Mar 29, 2015 7:07 am

"plugin stopped" after router upgrade (AD2Pi)

Post by Professor Falken »

I recently upgraded my router, which resulted in all devices on my network getting new IP addresses, in a completely different range from the old one. Getting the AD2Pi visible back on the network was a challenge (I am by no means a pi expert, or a coder at all), but eventually after finding an old copy of the disc image and reflashing the SD card, I was able to get it to assigned a new IP address in the correct range. I set it back up with the same credentials as before, and it does function with the alarmdecoder web app.

However, the plugin won't load in Indigo. I have tried just reloading, disabling then re-enabling, restarting indigo, all to no avail. I even tried downgrading a version, with the same result.

I am running version 1.8.2 of the plugin on Indigo 7.2 (stuck there until I can figure out how to convert some mission critical apple scripts). Everything worked fine until I upgraded my router and lost contact with the AD2Pi last week. The plugin won't load far enough to even have config options in the plugin menu to see if there is something I need to do to point Indigo to the AD2Pi device.

Suggestions? If possible, I would like to keep all of my devices/triggers/schedules/control pages/etc. I have a fair amount of time invested in alarm items in Indigo.

This is what I get on an attempted reload (this was when I tried downgrading to 1.8.1, I am now back on 1.8.2):

Code: Select all

 Reloading plugin "AD2USB Alarm Interface 1.8.1"
   Starting plugin "AD2USB Alarm Interface 1.8.1" (pid 23905)
   AD2USB Alarm Interface          Indigo logging level set to:INFO (20)
   AD2USB Alarm Interface          Plugin logging level set to:INFO (20)
   AD2USB Alarm Interface Error    Error in plugin execution InitializeMain:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "plugin.py", line 285, in __init__
  File "/Library/Application Support/Perceptive Automation/Indigo 7.2/Plugins/ad2usb 2.indigoPlugin/Contents/Server Plugin/ad2usb.py", line 68, in __init__
  File "/Library/Application Support/Perceptive Automation/Indigo 7.2/Plugins/ad2usb 2.indigoPlugin/Contents/Server Plugin/ad2usb.py", line 981, in readAlarmDecoderConfig
UnboundLocalError: local variable 'configConnection' referenced before assignment

   Stopping plugin "AD2USB Alarm Interface 1.8.1" (pid 23905)
   Stopped plugin "AD2USB Alarm Interface 1.8.1"

Thanks.
ab39870
Posts: 44
Joined: Wed Dec 09, 2015 6:55 am

Re: "plugin stopped" after router upgrade (AD2Pi)

Post by ab39870 »

My first recommendation is to work through your AppleScript changes and move to a Python 3 version (Indigo 2021.2 or later) and AD2USB Plugin 3.2.0 and later to support the latest AD2USB firmware.

That said, the error you're seeing is related to the Plugin attempting to communicate to your Pi on startup. Here's what I would check, in order:

1. Are you set in the Plugin Config to Serial or IP? From what you describe it should be IP.
2. Is the IP address and Port correct in the Plugin Config for what the Pi is set to?
3. Have you tested communication from your Mac to the Pi via a Terminal program like "nc" (or telnet is your Mac is old enough) to ensure you know that is working?
User avatar
Professor Falken
Posts: 293
Joined: Sun Mar 29, 2015 7:07 am

Re: "plugin stopped" after router upgrade (AD2Pi)

Post by Professor Falken »

Thanks.
My first recommendation is to work through your AppleScript changes and move to a Python 3 version (Indigo 2021.2 or later) and AD2USB Plugin 3.2.0 and later to support the latest AD2USB firmware.
Yes, it would be nice to get the Apple Scripts converted. Not doing so is also preventing me from updating to a newer Mac Mini as well. I have minimal coding experience in the last 30 years, so I'd have to do some significant learning.
1. Are you set in the Plugin Config to Serial or IP? From what you describe it should be IP.
2. Is the IP address and Port correct in the Plugin Config for what the Pi is set to?
I can't even get to the config option. I assume that is because the plugin is crashing before that can load. When I hover over the plugin in the dropdown list, my only options are Enable/Disable (depending on whether or not it's enabled), Reload, or the About link. So there are no config or other options even visible.
3. Have you tested communication from your Mac to the Pi via a Terminal program like "nc" (or telnet is your Mac is old enough) to ensure you know that is working?
I can SSH into it from the terminal. I can also reach and control it via the local webapp. So the device is functioning correctly (I think) on my network. I just can't quite get Indigo to talk to it anymore.
ab39870
Posts: 44
Joined: Wed Dec 09, 2015 6:55 am

Re: "plugin stopped" after router upgrade (AD2Pi)

Post by ab39870 »

You said in your original post, "all devices on my network getting new IP addresses". If this included the Raspberry Pi that has your AlarmDecoder then you need to go thru the Configure menu of the Plugin to change the IP address accordingly to the new IP address of the Raspberry Pi. Connecting from a terminal via ssh and via a browser to the web interface is great for verifying that the AlarmDecoder is up and running, but that is not how the Plugin connects. It connects via the data you enter in the Configure menu/dialog box that allows you to enter the IP address and Port number.

These instructions from the current docs still apply to the older version.

https://github.com/bla260/ad2usb/blob/m ... st-install

If the Configure menu doesn't work you may need to completely remove the Plugin and reinstall so it asks for this on install.
User avatar
Professor Falken
Posts: 293
Joined: Sun Mar 29, 2015 7:07 am

Re: "plugin stopped" after router upgrade (AD2Pi)

Post by Professor Falken »

Hmm, ok. So that would be different than when I downgraded a version? I kinda thought that was like reinstalling it.

Do you know if I lose all of my devices/dependencies if I do that?


Sent from my iPhone using Tapatalk Pro
ab39870
Posts: 44
Joined: Wed Dec 09, 2015 6:55 am

Re: "plugin stopped" after router upgrade (AD2Pi)

Post by ab39870 »

One thing you may want to try. The Plugin Preferences is a XML file stored here on your Indigo Server:

Code: Select all

/Library/Application Support/Perceptive Automation/Indigo 7.2/Preferences/Plugins
The filename is:

Code: Select all

com.berkinet.ad2usb.indiPref
Edit it with a safe plain text editor (vi, TextEdit in Plain Text mode, ...). A snippet of a sample file is below. Note the ad2usbAddress and ad2usbPort tags that are the IP and Port of your Raspberry Pi AlarmDecoder.

1. Stop Indigo Server.
2. Edit the file and change these values
3. Start Indigo Server and then the Plugin.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<Prefs type="dict">
        <ad2usbAddress type="string">192.168.200.113</ad2usbAddress>
        <ad2usbCommType type="string">IP</ad2usbCommType>
        <ad2usbPort type="string">15003</ad2usbPort>
        ...
User avatar
Professor Falken
Posts: 293
Joined: Sun Mar 29, 2015 7:07 am

Re: "plugin stopped" after router upgrade (AD2Pi)

Post by Professor Falken »

That worked perfectly.

Thanks so much for all the help.
ab39870
Posts: 44
Joined: Wed Dec 09, 2015 6:55 am

Re: "plugin stopped" after router upgrade (AD2Pi)

Post by ab39870 »

Glad it worked!
Post Reply

Return to “AD2USB Alarm Interface”