Skip to content

Fancy wifi provisioning #436

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Fancy wifi provisioning #436

wants to merge 7 commits into from

Conversation

gorbit99
Copy link
Contributor

@gorbit99 gorbit99 commented May 5, 2025

Depends on #435

Attempts to implement #71

This PR reworks the wifi provisioning, which originally used SmartConfig, to instead use an ESP-Now based implemenation.

When a tracker can't connect to any of its credentials options, it starts sending out esp-now packets on all possible channels. If another tracker that's currently provisioning gets these packets, it will reply with the SSID and password of the wifi network it is connected to. The searching tracker then receive these and attempt to connect with the provided credentials.

A tracker can be put into provisioning mode by either sending it the "START PROVISION" serial command, or sending it a WifiProvisioning packet (packet id 27, only parameter a boolean saying if the provisioning should be started or stopped).

Caveats:

  • Seems like the range on the esp-now packets - at least using official slime boards - isn't great. The tracker needs to be basically next to the provisioning one to catch the packets. From reading online, this might be somewhat determined by the 2.4ghz channel we use for sending (which needs to be the same as the channel of the WiFi network), and the attenuation might also play a role. I propose to call this a security feature.

TODO:

  • Finetune timeout and interval parameters. Increasing the latter might make catching packets a bit more consistent
  • Test extensively, both on ESP8266 and ESP32

@gorbit99 gorbit99 marked this pull request as ready for review May 5, 2025 01:15
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.

2 participants