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

Maybe fix lost communication after a node reboot or power failure #32

Merged
merged 3 commits into from
Dec 15, 2024

Conversation

pdxlocations
Copy link
Member

The connection reliability has been poor in my testing. Any lost connections result in an endless loop of "Got bad Magic"

This PR:

  • Clears pb_buf after "Got bad magic" to end the loop.
  • Listens for a reboot tag and sends a want_config to reestablish pb flow.

toRadio.which_payload_variant = meshtastic_ToRadio_want_config_id_tag;
want_config_id = random(0x7FffFFff); // random() can't handle anything bigger
toRadio.want_config_id = want_config_id;

Copy link
Member

Choose a reason for hiding this comment

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

do we want the config again? if not, use the magic 'skip config'

Copy link
Member Author

Choose a reason for hiding this comment

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

Is it possible the node rebooted due to a config change? Maybe getting the config again could be useful?

I'm looking around but cant find a reference to skip config

Copy link
Member

Choose a reason for hiding this comment

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

I think caveman referred to the SPECIAL_NONCE. It will only skip sending NodeInfos of other nodes.

Copy link
Member Author

Choose a reason for hiding this comment

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

That makes sense to only pull in your own config and not other nodes. I dug around and have determined that implementing this is outside of my current skillset.

Copy link
Member

Choose a reason for hiding this comment

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

Replacing the random want_config_id with 69420 should do it 😀

Copy link
Member Author

Choose a reason for hiding this comment

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

Ya know I'd typed that in and thought, "there's no way it's that easy" and gave up. Also gave my wife a laugh with that one.

@GUVWAF GUVWAF merged commit 431a0ab into meshtastic:master Dec 15, 2024
2 checks passed
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.

4 participants