Giter Site home page Giter Site logo

Sleepy Thread devices about aiohomekit HOT 8 OPEN

roysjosh avatar roysjosh commented on July 3, 2024
Sleepy Thread devices

from aiohomekit.

Comments (8)

roysjosh avatar roysjosh commented on July 3, 2024

Well, changing ACK_TIMEOUT from 2.0 to 12.0 didn't seem to help this particular user. I need to order a few sleepy Thread devices so I can get this sorted out.

from aiohomekit.

Jc2k avatar Jc2k commented on July 3, 2024

Wemo Stage and Eve Thermo are the sleepy HAP devices I'm testing with FWIW.

from aiohomekit.

Jc2k avatar Jc2k commented on July 3, 2024

As I said in ^, bumping ACK_TIMEOUT to 10 has got rid of thousands of "Received Type.ACK from but could not match it to a running exchange" warnings in my logs.

Looking at https://github.com/chrysn/aiocoap/blob/419c88cb7bec693f3c33b188a8e394e6666983c5/aiocoap/messagemanager.py#L215, they were caused by original transmission and the retransmission sharing an entry in self._active_exchanges. If both are ACK'd, original will clear the entire in active exchanges first, then the retransmission won't be able to find itself in active exchanges any more, causing that log spam.

So I think even if its not the root cause for your user, its something we need to resolve as that error message is very common and comes up a lot in HA tickets.

from aiohomekit.

jfroy avatar jfroy commented on July 3, 2024

I need to read the Thread spec to see how much buffering is allowed for sleepy devices. Bumping the timeout for connections to sleepy Thread devices would probably be an OK fix. Handling re-transmit ACKs per the COAP protocol spec would also be a good fix.

from aiohomekit.

Jc2k avatar Jc2k commented on July 3, 2024

I think we want both - it seems daft (and wasteful) to retransmit when we know sleepy thread devices will "timeout" half the time.

But equally if it's valid to ACK a retransmission and the original then aiocoap should be silently handling that.

from aiohomekit.

Jc2k avatar Jc2k commented on July 3, 2024

(But yes, I plucked 10s out of the air, we should use something closer to the spec - I thought it was 5s but haven't checked)

from aiohomekit.

Jc2k avatar Jc2k commented on July 3, 2024

This has been said in other tickets, but duping here.

Latest aiocoap should no longer RST in violation of spec and makes re-transmit dupe ACK's less noisy in the logs. They do however still generate noise, so we need to handle the timeouts and make them longer than the sleep interval of the device.

Sleepy devices I have do sleep for 5s, however it's set by a characteristic called "Sleep Interval". So we need to tune the retry interval per endpoint, respecting that char.

from aiohomekit.

Jc2k avatar Jc2k commented on July 3, 2024

chrysn/aiocoap#294 will let us avoid re-transmits during a sleepy devices sleep interval. We'll probably want a TransportTuning per connection, and we should use the "Sleep Interval" characteristic value if its available to configure it.

from aiohomekit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.