Short answer

How does a production ESP32 get its SSID without a USB cable?

  • Provisioning is a product flow: SoftAP, BLE, or a phone app. The Station example assumes the SSID is already in NVS or the code.
  • A hotspot used only in the lab is not a factory method. Decide how the first user, or the line, writes credentials.
  • After join, store the SSID in NVS and stop advertising the setup AP. Leaving an open setup network in the field is a support call.
  • Read the official provisioning example before you invent a captive portal. Most of the state machine is already there.

中文

短答

量产的 ESP32 没有 USB 时,SSID 怎么进去?

  • 配网是产品流程:SoftAP、BLE 或手机应用。Station 例程默认 SSID 已经在 NVS 或代码里。
  • 实验室里开热点不是产线方法。要定第一位用户或产线怎么写入凭证。
  • 加入之后把 SSID 写入 NVS,并关掉配网 AP。现场一直开着配网热点会变成售后电话。
  • 自己做门户页之前先看官方配网例程。状态机大部分已经有了。