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
net: openthread: add pskd join loop #25589
net: openthread: add pskd join loop #25589
Conversation
da9a313
to
c048b5b
Compare
All checks are passing now. Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages. |
f399e2c
to
e9be59e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some high-level comments for now.
fc08d40
to
37c0c92
Compare
37c0c92
to
ac117c8
Compare
@rlubos : In Philipp-Wohlgenannt-Tridonic-com:feature-pskd-joinloop there is the new commit (bc0add9130598d94b708e929db1ae1e0b23abd47) with the desired changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the rework, the retransmit logic looks much better now. There are still some issues left though.
|
||
static void ot_joiner_restart_timer(void *dummy) | ||
{ | ||
k_work_submit(&joiner_restart); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could simply use k_delayed_work_submit
instead of timer + work combo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have tried that but that did not work with our zephyr devices.
47c3603
to
318342a
Compare
/* for rebooting after a period if join not successful */ | ||
#include <power/reboot.h> | ||
/* need to immediately print to stdout if rebooting */ | ||
#include <stdio.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include <stdio.h>
is no longer needed, should be removed. While removing, please move #inlclude <power/reboot.h>
to the top, together with other includes.
if (CONFIG_OPENTHREAD_JOINER_REBOOT != 0 && | ||
join_attempts >= CONFIG_OPENTHREAD_JOINER_REBOOT) { | ||
log_panic(); | ||
LOG_WRN("Joining failed %d times ... " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please stick to networking logging macros for consistency, i. e. NET_WARN
.
/* need to immediately print to stdout if rebooting */ | ||
#include <stdio.h> | ||
|
||
static char *joiner_pskd = OT_JOINER_PSKD; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static const char *
void ot_joiner_start_handler(otError error, void *context) | ||
{ | ||
struct openthread_context *ot_context = context; | ||
|
||
static u32_t restart_delay; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, looking at PR #25679 which got just merged,it seems we should use uint32_t
now.
318342a
to
c7a4aa6
Compare
We have reverted it to to timer implementation because the previous versions with k_work_submit() or k_delayed_work_submit() caused crashes on our local zephyr devices. |
c7a4aa6
to
c7cc68c
Compare
Just as a clarifying comment: it was the use k_delayed_work item that was causing us (so far non-understood) crashes in certain use cases of the joiner, so we went back to using the timer and k_work, which survives the same case fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just please address the Shippable failure (currently this code does not build due to timer handler function signature mismatch).
c7cc68c
to
c80bcc2
Compare
restart joiner if: -in autostart mode and join hasn't succeeded yet -joiner is back to idle Signed-off-by: Philipp Wohlgenannt <philipp.wohlgenannt@tridonic.com>
c80bcc2
to
0304b2d
Compare
Removing my -1 in order not to block this during my vacation.
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. |
restart joiner if in autostart mode and join hasn't succeded yet or if joiner is back to idle
Signed-off-by: Philipp Wohlgenannt philipp.wohlgenannt@tridonic.com