sendRawExtended, waitForExtendedReply, and timeout

Posted on
Sat Dec 10, 2016 2:13 pm
brlandy offline
Posts: 31
Joined: Feb 19, 2012

sendRawExtended, waitForExtendedReply, and timeout

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

Posted on
Sat Dec 10, 2016 3:05 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: sendRawExtended, waitForExtendedReply, and timeout

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.

Image

Posted on
Sun Dec 11, 2016 2:31 pm
brlandy offline
Posts: 31
Joined: Feb 19, 2012

Re: sendRawExtended, waitForExtendedReply, and timeout

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.

Posted on
Sun Dec 11, 2016 3:09 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: sendRawExtended, waitForExtendedReply, and timeout

Yes, I believe that for a lot of the polling/get messages you want CRC off but for the setters you need it on.

Image

Posted on
Tue Dec 13, 2016 9:13 pm
brlandy offline
Posts: 31
Joined: Feb 19, 2012

Re: sendRawExtended, waitForExtendedReply, and timeout

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
Attachments
log.txt
(11.71 KiB) Downloaded 112 times

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 6 guests