Page 1 of 1

sendRawExtended, waitForExtendedReply, and timeout

PostPosted: Sat Dec 10, 2016 2:13 pm
by brlandy
Hi, I have a keypadlinc that I have noticed often fails to respond in time to this query to get the current button states:

reply = indigo.insteon.sendRawExtended(instnAddr, [0x2E, 0x00], waitForExtendedReply=True)

However, if I instead use Indigo's GUI to trigger a status request on that same keypadlinc, it always succeeds in printing the proper button states into the log.

Is the GUI using a different mechanism or longer timeout when it issues extended messages, such that it succeeds but a python script fails? Is there anything I can do to make the script call as reliable as the GUI?

Thanks,
Brian

Re: sendRawExtended, waitForExtendedReply, and timeout

PostPosted: Sat Dec 10, 2016 3:05 pm
by matt (support)
Hi Brian,

To help us understand what is going on, can you perform the commands both from the GUI and from the script to illustrate the problem (so repeat the script test until it times out)?

Also if you could copy/paste from the Event Log file itself and not just the Indigo Event Log Window that would be helpful, as it will have timestamps on every single line.

Re: sendRawExtended, waitForExtendedReply, and timeout

PostPosted: Sun Dec 11, 2016 2:31 pm
by brlandy
I have a theory, maybe you can confirm?

When using the python API it defaults to 'calcCrc=True'. I took a guess and disabled that for extended message that queries the current LED states and my success rate increased dramatically. When setting the LEDs, however, I still need to use calcCrc=True.

So my queries are something like:

Code: Select all
reply = indigo.insteon.sendRawExtended(instnAddr, [0x2E, 0x00], calcCrc=False, waitForExtendedReply=True)
reply = indigo.insteon.sendRawExtended(instnAddr, buttonMask, calcCrc=True, waitForAck=True)


Is it possible that the Status Request when performed from the GUI disables calcCrc?

I'll post better logs shortly.

Re: sendRawExtended, waitForExtendedReply, and timeout

PostPosted: Sun Dec 11, 2016 3:09 pm
by matt (support)
Yes, I believe that for a lot of the polling/get messages you want CRC off but for the setters you need it on.

Re: sendRawExtended, waitForExtendedReply, and timeout

PostPosted: Tue Dec 13, 2016 9:13 pm
by brlandy
Sorry, my definition of "shortly" was incorrect. Anyway, this is 10 minutes of testing that shows the high success rate I was getting using the status request button vs. the poor success rate using the Insteon commands plugin GUI or a direct call to python.

Anyway, things are working much better since I changed my code to set calcCrc=False. If you think that's better you might want to make the same change in the Insteon Commands plugin where appropriate.

Thanks,
Brian