Page 1 of 2

New(?) error on startup...

PostPosted: Sat Apr 17, 2021 1:16 pm
by dclonts
getting the following in Cynical Behaviors on startup...

Cynical Behaviors Error error:
File ".../Server Plugin/cyin/plug.py", line 284, in deviceStartComm
iom.start_object(io, io.deviceTypeId)
File ".../Server Plugin/cyin/iom.py", line 183, in start_object
iom.start()
File ".../Server Plugin/kpl.py", line 70, in start
self.setLed()
File ".../Server Plugin/kpl.py", line 93, in setLed
if self.device.canSetLed(self.button):
File ".../Server Plugin/cyin/stddevice.py", line 91, in canSetLed
return ledno <= len(self.ledConfig) and self.ledConfig[ledno-1]
File ".../Server Plugin/cyin/stddevice.py", line 141, in ledConfig
config = self.buttonConfiguration()
File ".../Server Plugin/cyin/stddevice.py", line 131, in buttonConfiguration
reply = self.sendRaw([0x1F, 0x00], waitUntilAck=True)
File ".../Server Plugin/cyin/stddevice.py", line 70, in sendRaw
suppressLogging=suppressLogging and not cyin.DEBUG)
InterfaceError: interface INSTEON is not connected or enabled


May be unrelated, but the Update LEDs does not seem to update KPL leds to match the corresponding device states...

Re: New(?) error on startup...

PostPosted: Sun Apr 18, 2021 4:30 pm
by matt (support)
Do you get the error if you choose the Plugins->Cynical Behaviors->Reload menu item? The problem might just be that the plugin is loading before Indigo has completed connecting to the Insteon PowerLinc.

Re: New(?) error on startup...

PostPosted: Mon Apr 26, 2021 12:19 pm
by dclonts
Ha! brilliant.

So how do I delay startup of the plugin?

Re: New(?) error on startup...

PostPosted: Mon Apr 26, 2021 4:28 pm
by norcoscia
I would also love to know how to delay a plug-in startup (if possible)….

New(?) error on startup...

PostPosted: Mon Apr 26, 2021 4:57 pm
by kw123
That has been discussed before.

Conclusion in principle :
Has to be done within in the plugin.

Indigo does not offer a start/stop plugin command. Only a reload.

you could though have a script that reloads the plugin a minute after indigo starts.
You would still get the error messages the first time the plugin loads.


Sent from my iPhone using Tapatalk

Re: New(?) error on startup...

PostPosted: Mon Apr 26, 2021 5:11 pm
by norcoscia
So could I go in and add a step in the first few lines of the plug-in to count to 5000 or more (in a loop) before it continues or will that slow down everything Indigo is doing?

Re: New(?) error on startup...

PostPosted: Mon Apr 26, 2021 5:18 pm
by kw123
add:

in

Code: Select all
.   def startup(self):
        self.sleep(60.)


make sure you have the right indent (4 spaces vs 1 tab )

Karl

Re: New(?) error on startup...

PostPosted: Mon Apr 26, 2021 5:35 pm
by norcoscia
Thanks Karl - I’ll try tomorrow :-)

Re: New(?) error on startup...

PostPosted: Mon Apr 26, 2021 5:39 pm
by norcoscia
Hmm, thought it was dirt on my screen but it is a period or dot as the first character - is that supposed to be in there?

Re: New(?) error on startup...

PostPosted: Mon Apr 26, 2021 5:54 pm
by kw123
No dot
Sorry


Sent from my iPhone using Tapatalk

Re: New(?) error on startup...

PostPosted: Mon Apr 26, 2021 6:45 pm
by kw123
Code: Select all
   def startup(self):
      self.sleep(60.)

Code: Select all
    def startup(self):
        self.sleep(60.)


first one w tabs, the second w 4 spaces they look identical, but mixing tabs and space will make the plugin not run.

Karl

Re: New(?) error on startup...

PostPosted: Wed Apr 28, 2021 9:21 am
by dclonts
Wont this blow up the plugin with a timeout? Thought you couldn't do long sleeps in a plugin...

Re: New(?) error on startup...

PostPosted: Wed Apr 28, 2021 10:06 am
by kw123
I believe the time out is only for script executed within Indigo, NOT for external scripts and not for plugins. they can sleep as long as you like

I tried 20000 seconds in a plugin and no complains


Karl

Re: New(?) error on startup...

PostPosted: Wed Apr 28, 2021 10:43 am
by norcoscia
Wanted to try this but not smart enough to be sure what file I should put it in - is the first file a plug-in runs always called plugin.py

Should I put it in as the very first item before the import time line?

Thanks for any further help :-)

New(?) error on startup...

PostPosted: Wed Apr 28, 2021 10:46 am
by kw123
Replace
def startup():

In plugin.py

With the posted lines

def startup():
self.sleep(60.)

With the proper indents.


Sent from my iPhone using Tapatalk