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

Reboot: auto reconnect #2967

Merged
merged 2 commits into from Oct 13, 2022
Merged

Conversation

IamPete1
Copy link
Member

@IamPete1 IamPete1 commented Oct 8, 2022

This auto reconnects after a sending a reboot command, useful when doing initial setup where lots of reboots are needed. Also handy for catching very early start up messages.

Testing:

  • direct USB reconnects
  • USB telemetry does not reconnect because the link is not closed
  • TCP to SITL does not reconnect (it would be nice to get this working in the future, maybe SITL does not close the link correctly)
  • firmware upload works as normal

if (!bootloadermode && (BaseStream is SerialPort))
{
// Direct USB will disconnect after a reboot, wait and see if we should re-connect
Thread.Sleep(500);
Copy link
Member Author

Choose a reason for hiding this comment

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

This timeout seems to work, its bit of a guess, not sure if it would work in every case, maybe there is a better way?

if (!BaseStream.IsOpen)
{
Open(true);
}
Copy link
Member Author

Choose a reason for hiding this comment

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

We could auto refresh params if the link still open. That would be the right thing in most cases but quite annoying on a very slow link.

@meee1 meee1 merged commit 018ba15 into ArduPilot:master Oct 13, 2022
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.

None yet

2 participants