Skip to content

Connect multiple times on startup and speed up initial connect #104

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

Merged
merged 4 commits into from
Nov 30, 2021

Conversation

puddly
Copy link
Collaborator

@puddly puddly commented Nov 30, 2021

Instead of just sending the bootloader skip bytes and connecting a single time, zigpy-znp now connects multiple times (similar to the way Z2M currently does it):

  1. First just connect to the serial port.
  2. If that doesn't work, try sending the bootloader skip bytes and try again.
  3. If that doesn't work, try toggling the RTS pin and try once more.

This increases the chances of a connection attempt succeeding significantly while still taking the same amount of time as before.

A side effect of this change (and the original motivation) is that the CC2530 with an external USB-serial adapter is now fully supported.

To support custom coordinator boards (e.g. where RTS or DTR is mapped to RST), the pin toggling behavior is now configurable as well.

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.

1 participant