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

Upon Parent re-connection after a channel switch g_rootless_flag required to be updated on Root as well as on Leaf. #200

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Jigar3690
Copy link

On the file mwifi.c

How to Recreate the Scenario:

  • When root within mesh gets a channel switch by the router. (this channel change could be due to any possible reason)
  • Root reconnects to the router through that new channel and so all leaf nodes reconnects to the root with this new channel.
  • Just before reconnection, Leafs get into the rootless state.
    so MESH_EVENT_NETWORK_STATE event occurs and so g_rootless_flag is now set to true for all leafs.
  • further, all leafs will start looking for another parent with same mesh ID and password.
  • Eventually when they find the root on another channel - all leafs will start reconnecting to the root.
  • Here, when MESH_EVENT_PARENT_CONNECTED event occurs on the leafs - we have to set the g_rootless_flag to false for all leafs as well as for root. (Currently it is not doing it. see proposed change.)

Line 177: g_rootless_flag required to be updated on both Root and Leaf If the parent get re-connected after a channel switch.

What happens without this change:

  • Without above mentioned change, when the channel switch happens (could be initialized by router due to any possible reason) after going through the reconnection sequence - Root will get connected to the router and so all leafs will get reconnected to the root.
  • Here upon re-connection Root has g_rootless_flag set to false BUT Leafs still have g_rootless_flag set to true. Leafs are still in rootless state.
  • Now, when root sends any data to leafs, all leafs will be able to receive the data as they are part of the mesh.
  • However, when leaf will try to send data to the root,
    at Line 861: MDF_ERROR_CHECK(to_root && g_rootless_flag, MDF_ERR_MWIFI_NO_ROOT, "Current network has no root");
    Because the leaf do not have g_rootless_flag set to false after the channel switch - Leaf will not be able to send data to the root and it will keep sending an error message stating "Current network has no root".

So proposed change is working for me and has resolved the issue. Please verify this and update here if espressif team is good with this change.

Thank you.

Line 177: g_rootless_flag required to be updated on both Root and Leaf If the parent get re-connected after a channel switch.
@graineri
Copy link

I stumbled upon this issue in a similar scenario.

@tonyshuang
Copy link

tonyshuang commented Aug 23, 2024 via email

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

Successfully merging this pull request may close these issues.

3 participants