Code Monkey home page Code Monkey logo

Comments (9)

shahpiyushv avatar shahpiyushv commented on June 14, 2024 5

A port for ESP32/ESP32S2 has been made available here: https://github.com/espressif/esp-apple-homekit-adk

from homekitadk.

rojer avatar rojer commented on June 14, 2024 1

FWIW, i found 1.5k i/o buffer size to be adequate. it has to be greater than 1k + some crypto padding to be able to contain 1k encrypted frames.
further, in my mongoose-os port of the library. i've successfully made all the buffers dynamic, so that at present the largest statically allocated structure is the sessions array, followed by the scratch buffer.
esp8266 build of the shelly-homekit firmware is able to support 9 concurrent connections with about 20k to spare.

the key changes are:

if there is interest, i can try to upstream the changes, as a compile-time option.

from homekitadk.

rojer avatar rojer commented on June 14, 2024

I'm also looking for guidance on the size of the scratch buffer - 32K is obviously a no go, but how much is really needed?

from homekitadk.

Clovel avatar Clovel commented on June 14, 2024

ESP32 has 200K or so

That's weird, Espressif distributes the MFi version of the HomeKit ADK for the ESP32... Surely there is some info we are missing here.

https://www.espressif.com/en/products/software/esp-homekit-sdk

from homekitadk.

rojer avatar rojer commented on June 14, 2024

they may have reduced buffer size and/or number of sessions.
this is why i'm looking for clarity on the required size. 32K seems excessive when the spec says max payload size is 1K.
@aajain-com ?

from homekitadk.

rojer avatar rojer commented on June 14, 2024

if anyone's interested, i've been gradually converting static allocations to dynamic in my Mongoose OS port: readContexts, writeContexts, eventNotifications.

i/o buffers will be more challenging, but i have no choice...

from homekitadk.

Clovel avatar Clovel commented on June 14, 2024

if anyone's interested, i've been gradually converting static allocations to dynamic

I believe that in embedded systems, dynamic allocation is generally frowned upon, and with good reasons.

Maybe compile time configuration is a more fitting solution ? Like a "easy-to-access" header defining all the buffer sizes or a configuration file used to set the defines at compile-time.

from homekitadk.

rojer avatar rojer commented on June 14, 2024

i am well aware of that.
but Mongoose OS, for one, embraces dynamic allocation, we're brave like that :)
i mean, i'm all for static allocation, but current sizes are simply not viable for many platforms, including all of the ones we support.
for me, the choice is between "no way, forget it" and "will work unless all the clients decide to request all the attributes at the same time".

"easy-to-access" header defining all the buffer sizes or a configuration file used to set the defines at compile-time.

it's perfectly possible to define all the necessary constants right now, the problem is that the produce of all the necessary buffers blows through available memory for the platforms in question.

from homekitadk.

Clovel avatar Clovel commented on June 14, 2024

it's perfectly possible to define all the necessary constants right now, the problem is that the produce of all the necessary buffers blows through available memory for the platforms in question.

Is it not possible to simply calculate the total size of the buffers beforehand ? For example, "we know the ESP8266 does not have enough memory for the default sizes, but if you set them at these values, it's going to work".
If it is possible, maybe we could make a document giving the buffer sizes that should be defined for popular platforms ?

from homekitadk.

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.