Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Custom user_settings.h with wolfSSL in HomeKit after Version Update #7969

Open
AchimPieters opened this issue Sep 12, 2024 · 2 comments
Assignees

Comments

@AchimPieters
Copy link

Version

5.7.2

Description

Hi everyone and @gojimmypi,

I'm working on an ESP-IDF HomeKit project and using wolfSSL as a managed component to simplify version updates. I've added wolfSSL as a component by including it in components/homekit/idf_component.yml, which makes it easier to update just by adjusting the version number.

Screenshot 2024-09-11 at 18 21 24

In the components/homekit/user_settings.h file, I’ve set the necessary configurations to ensure smooth compilation.

Screenshot 2024-09-11 at 18 21 47

However, my challenge is maintaining these custom settings across version updates. After updating to a new version of wolfSSL (e.g., from 5.7.2 to 5.7.3), I'd like my user_settings.h file to be used by default, without requiring additional manual steps.

Screenshot 2024-09-11 at 18 22 03

Here’s a summary of what I've done so far:

wolfSSL is added as a managed component in components/homekit/idf_component.yml
Custom configurations are set in components/homekit/user_settings.h
wolfSSL is automatically downloaded as a managed component during the build process.

Question:

What adjustments or changes can I make to ensure my custom user_settings.h file is used automatically after updating the wolfSSL version in idf_component.yml? In other words, how can I ensure the project works "out of the box" with custom configurations after a version update?

Any suggestions or insights on how to approach this would be greatly appreciated!

Thanks in advance.

Best regards,
Achim Pieters

@gojimmypi gojimmypi self-assigned this Sep 12, 2024
@gojimmypi
Copy link
Contributor

Hi @AchimPieters

Thank you again for all your help in getting wolfSSL working well with your awesome ESP32 Apple HomeKit examples. Not only is that a cool project, but your use-case has been helpful in the design of the wolfSSL Managed Component.

What adjustments or changes can I make to ensure my custom user_settings.h file is used automatically ?

That's an excellent question! The answer is that to use the Managed Components, a custom user_settings.h is not possible at this time. The user_settings.h is currently part of the component; If the component manager sees that any part of the component has changed, then the component needs to be converted to a non-managed component. This of course defeats the purpose and value of having a Managed Component in the first place.

In order to customize wolfSSL for a given project, the current plan is to use the Espressif method of having all settings defined via the idy.py menuconfig. This means having sdkconfig.defaults available with an appropriate Kconfig file as described in the Project Configuration Documentation.

I suppose in theory, it might be possible to have a cleverly-crafted CMakeLists.txt that points to a wolfSSL user_settings.h in a user-defined directory outside of the component. I could see that as being both beneficial, but also potentially problematic. I'll need to experiment a bit with that. The trick would be having a user settings both inside and outside of the component. Perhaps some sort of "supplementary user settings file"? I don't know.

For now, please take a look at my current reference template app. Introduced in #7866 I have many new settings available in the respective Kconfig file that will allow use of menuconfig and the respective sdkconfig.default files.

  • Please let me know what settings you need that are not included in the template app ASAP.

I'm expecting a wolfSSL release in the relatively near future (and a Managed Component update shortly thereafter). I'd like to add any relevant settings that the Apple HomeKit support might need. It would be great to have those included in the next release.

Like your examples, I have many different ESP32 examples, not only here in the wolfSSL repo, but also:

I would also like to have a common user_settings.h, CMakeLists.txt, and Kconfig in the components/wolfssl directory used by all of the examples.

how can I ensure the project works "out of the box" with custom configurations after a version update?

I think the best method is with the sdkconfig.defaults and respective support in the user_settings.h file as well as in settings.h (see also #7953 and the related changes to settings.h).

Note that the template user_settings.h already has a specific Apple HomeKit Section ready for any defaults across all HomeKit apps.

I'm interested in your feedback and suggestions.

Cheers

@AchimPieters
Copy link
Author

AchimPieters commented Sep 15, 2024

Hi @gojimmypi

Thank you for your detailed response. I’ve attached my current user_settings.h file.

user_settings.h.txt

After going through your message, I agree that using a sdkconfig.defaults OR Kconfig file could indeed be the solution here. Where sdkconfig.defaults has my preference.

This way, you can set up the necessary configurations per project, outside of the wolfSSL managed component. This would allow for seamless updates to the latest version of wolfSSL without having to manually adjust everything.

One idea could be to include a sample sdkconfig.defaults file as a template, which could be copied for each project and modified as needed. This would make it easier for users to customize settings while maintaining the benefits of the managed component.

Looking forward to hearing your thoughts on this approach!

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants