espressif / esp-homekit-sdk

541 stars 98 forks source link

IDF v5 support #95

Open mbuckaway opened 1 year ago

mbuckaway commented 1 year ago

I'm wondering about support for v5.0 of the IDF. Currently, attempting to compile against this version of the IDF does not work.

There are a few minor changes that need to be made along with some changes to the build system. Warning as errors is enabled by default. For example:

hkdf.c:315: int hkdfResult(HKDFContext context, uint8_t prk[USHAMaxHashSize], const unsigned char info, int info_len, uint8_t okm[USHAMaxHashSize], int okm_len)

okm requires a fully qualified type.

hmac.c:221L int hmacResult(HMACContext *context, uint8_t digest[USHAMaxHashSize])

digest requires a fully qualified type.

As for the build system, I am unable to find the CMakefile combination that allows the code to compile.

It would appear the following is required: idf_component_register(SRC_DIRS src REQUIRES esp_hw_support mbedtls log driver nvs_flash esp_event esp_wifi esp32-button app_hap_setup_payload esp_hap_apple_profiles esp_hap_core esp_hap_platform esp_system INCLUDE_DIRS include)

...but each attempt gets a different result of a missing routine.

Any recommendations?

shahpiyushv commented 1 year ago

@mbuckaway , the release v5.0 is not yet tagged and there have been quite some breaking changes, some of which are still ongoing. Once the changes are frozen internally, we will add support for it

loicmorvan commented 1 year ago

As you say in #99 , esp-idf v5.0 is now out.

I tried building the lightbulb example with that version of idk, and here are my two cents:

mbuckaway commented 1 year ago

@loicmorvan , most of the missing head file issues are result of Espressif removing the default modules from the "regular" config. You will have to spend many compile cycles to figure out the dependancies and add them to the CMakefile (ie. esp_wifi, and some 20 others). Check the release notes for IDF 5 for more details. I eventually gave up and just used IDF 4.4 because I didn't need any of the new features. I suspect Espressif will fix the Homekit module eventually.

loicmorvan commented 1 year ago

@mbuckaway , thanks for your post, I saw that you have tried that a few months ago. I don't master cmake (yet!) nor the framework IDF, but I will try making HomeKit working with IDF 5. I'll keep you posted and maybe try to launch a Pull Request.

shahpiyushv commented 1 year ago

Sorry for the delay. We will check this on priority.

shahpiyushv commented 1 year ago

Support for idf v5.0 has been added now.