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

mgmt: hawkbit: use SMF #70787

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

maass-hamburg
Copy link
Collaborator

@maass-hamburg maass-hamburg commented Mar 27, 2024

@maass-hamburg maass-hamburg force-pushed the hawkbit_less_global branch 7 times, most recently from 49080dc to 80fa584 Compare April 8, 2024 11:26
@maass-hamburg maass-hamburg changed the title mgmt: hawkbit: make hb_context non global mgmt: hawkbit: use SMF Apr 8, 2024
@maass-hamburg maass-hamburg force-pushed the hawkbit_less_global branch 3 times, most recently from d1a50eb to 4ae2630 Compare April 16, 2024 09:25
@kartben
Copy link
Collaborator

kartben commented Apr 17, 2024

cc @glenn-andrews

@maass-hamburg maass-hamburg force-pushed the hawkbit_less_global branch 2 times, most recently from d01cb3b to 93104c8 Compare April 18, 2024 11:41
Copy link
Collaborator

@glenn-andrews glenn-andrews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider transitioning to an error-handling state rather than using smf_set_state(SMF_CTX(s), NULL);

subsys/mgmt/hawkbit/hawkbit.c Outdated Show resolved Hide resolved
@real-tintin
Copy link

This is great! We have considered rewriting the implementation to use a state machine due to multiple issue (I previously wrote in the roadmap issue). As I wrote there, we have made adaptions and bug fixes e.g., issues with double freeing and handling of NULL response (crashes hard during download if not checked). But I see that you have improved on the malloc and I strongly believe that the SMF will solve a bunch of issues itself.

I would like to give this a try. I will merge (locally for testing) our adaptions e.g., a dynamic config e.g., setting endpoints and tokens (during a device provisioning over BLE) - I saw that it already exist a PR for a similar change.

@maass-hamburg
Copy link
Collaborator Author

maass-hamburg commented Apr 18, 2024

This is great! We have considered rewriting the implementation to use a state machine due to multiple issue (I previously wrote in the roadmap issue). As I wrote there, we have made adaptions and bug fixes e.g., issues with double freeing and handling of NULL response (crashes hard during download if not checked). But I see that you have improved on the malloc and I strongly believe that the SMF will solve a bunch of issues itself.

I would like to give this a try. I will merge (locally for testing) our adaptions e.g., a dynamic config e.g., setting endpoints and tokens (during a device provisioning over BLE) - I saw that it already exist a PR for a similar change.

Thanks for the feedback!
If you find bugs, please feel free to open an issue. And if you have a fix for it, it would be wonderful if you contribute it back into the zephyr main. It makes thinks easier for all of us.

The same is true for new features, feel free to contribute. Just look at the features we added to hawkBit in the last weeks: here

@maass-hamburg maass-hamburg force-pushed the hawkbit_less_global branch 5 times, most recently from c78cf8d to 2a5891a Compare April 22, 2024 09:44
@real-tintin
Copy link

Hi! What is the status of this? Is it possible to get this into the 3.7 release? FYI, we have already rolled this out in our prod and done rigorous real-world-testing prior to it.

@maass-hamburg
Copy link
Collaborator Author

Hi! What is the status of this? Is it possible to get this into the 3.7 release? FYI, we have already rolled this out in our prod and done rigorous real-world-testing prior to it.

If #71037 gets approved and merged, we could start with this.

@ycsin what do you think?

staticly init hawkbit_work_handle

Signed-off-by: Fin Maaß <[email protected]>
add option for autohandler to only run once.

Signed-off-by: Fin Maaß <[email protected]>
Add hawkbit_autohandler_wait() to be able
to wait for the autohandler to finish.

Signed-off-by: Fin Maaß <[email protected]>
Also use a workqueue, when execution of
hawkBit is requested via shell.

Signed-off-by: Fin Maaß <[email protected]>
If the run of the autohandler is started from shell,
it will be logged.

Signed-off-by: Fin Maaß <[email protected]>
Be able to delay the next run of
the hawkbit autohandler.

Signed-off-by: Fin Maaß <[email protected]>
Mention change of hawkbit autohandler and shell in the
migration guide and the release notes.

Signed-off-by: Fin Maaß <[email protected]>
Add function to get the poll interval.
This is needed to seperate the autohandler
from the main hawkbit code.

Signed-off-by: Fin Maaß <[email protected]>
seperate the autohandler from the main
hawkbit source. This way the autohandler can
be disabled if it is not needed.

Signed-off-by: Fin Maaß <[email protected]>
seperate the hawkbit header files, to make
it clearer.

Signed-off-by: Fin Maaß <[email protected]>
move HAWKBIT_JSON_URL out of the header.

Signed-off-by: Fin Maaß <[email protected]>
Mention change of the hawkbit header files.

Signed-off-by: Fin Maaß <[email protected]>
use smf for hawkbit.

Signed-off-by: Fin Maaß <[email protected]>
remove unused hawkbit responses.

Signed-off-by: Fin Maaß <[email protected]>
allow the use of other tenants.

Signed-off-by: Fin Maaß <[email protected]>
rename close to cancel, as it is more fitting.

Signed-off-by: Fin Maaß <[email protected]>
add callbacks for events.

Signed-off-by: Fin Maaß <[email protected]>
add event callbacks to sample.

Signed-off-by: Fin Maaß <[email protected]>
maove to zephyr specific heap functions.

Signed-off-by: Fin Maaß <[email protected]>
Copy link

github-actions bot commented Aug 5, 2024

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

Copy link

github-actions bot commented Oct 5, 2024

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Oct 5, 2024
@real-tintin
Copy link

@glenn-andrews what is your opinion on this? I would very much see that this is merged. Huge improvement to the current implementation.

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