Fancy wifi provisioning #88

Open
opened 2026-04-05 17:51:49 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @gorbit99 on 5/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.

If a tracker is given the "START PROVISION" serial command or the "StartWifiProvisioning" packet (ID 28) while it's connected to a Wi-Fi, it enters provisioning mode. During this it sends out advertisement packets to the trackers around it.

If a tracker doesn't have Wi-Fi credentials set or can't connect using them, it will start listening to these advertisement packets. After a short authorization back and forth, the provisioner tracker sends the target the wifi credentials, using which it can connect to the wifi.

The target tracker sends packets back to the provisioner, reporting its status or any potential failures it encounters.

The following image describes the behaviour of the feature:
kép

Security:
It seems that ESP-Now can't really go through walls. This, combined with the fact that a potential hacker would need to use a device compatible with the protocol and do that in the 1 minute available for provisioning makes the process quite unlikely to be exploited.

TODO:

  • Finetune timeout and interval parameters. Increasing the latter might make catching packets a bit more consistent
  • Test extensively, both on ESP8266 and ESP32
*Originally created by @gorbit99 on 5/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. If a tracker is given the "START PROVISION" serial command or the "StartWifiProvisioning" packet (ID 28) while it's connected to a Wi-Fi, it enters provisioning mode. During this it sends out advertisement packets to the trackers around it. If a tracker doesn't have Wi-Fi credentials set or can't connect using them, it will start listening to these advertisement packets. After a short authorization back and forth, the provisioner tracker sends the target the wifi credentials, using which it can connect to the wifi. The target tracker sends packets back to the provisioner, reporting its status or any potential failures it encounters. The following image describes the behaviour of the feature: <img width="826" height="864" alt="kép" src="https://github.com/user-attachments/assets/cf7644c7-99da-4801-92b3-a79e1806ef76" /> Security: It seems that ESP-Now can't really go through walls. This, combined with the fact that a potential hacker would need to use a device compatible with the protocol and do that in the 1 minute available for provisioning makes the process quite unlikely to be exploited. TODO: - [X] Finetune timeout and interval parameters. Increasing the latter *might* make catching packets a bit more consistent - [X] Test extensively, both on ESP8266 and ESP32
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/SlimeVR-Tracker-ESP#88