ESP32 setup portal doesn’t pop up on phones, and how do 30 units get their own token?
Me again, now doing something bigger than my cellar. A friend wants 30 of my ESP32 temperature loggers for his cold rooms. I don’t want to flash a different Hermetry token into each one, and he needs to put his own Wi-Fi in without me.
So my idea: on first boot the ESP32 opens an access point « Logger-Setup », his phone connects, a page pops up asking for the Wi-Fi name and password, done. I’ve got the AP and a web server on 192.168.4.1 working. But the page doesn’t pop up by itself. On my Android it says « No internet » and stays there, on his iPhone nothing. You have to open a browser and type the IP, which he won’t do.
Second part: where does the Hermetry credential come from for 30 devices? Same token for all of them seems wrong.
The pop-up needs a DNS server on the ESP32 that answers every name with 192.168.4.1. The phone tries some known address, gets your page instead and decides it’s a portal.
Android specifically checks for a 204 answer, if it gets anything else it should show the sign-in prompt. Your server probably isn’t being asked at all without the DNS bit.
WiFiManager does all of that for you, including custom fields on the page.
Silly question maybe, but what happens if he types the wrong password?
WiFiManager falls back to the portal again if it can’t join, that part’s handled.
For the credential, one shared token is worse than wrong. Hermetry allows one session per device, so 30 boards on one token keep throwing each other off. Use the profile’s provisioning instead. You flash the same firmware with the profile’s provisioning key and secret, and each board asks for its own credential on first start:
// first boot only, after Wi-Fi is up
// MQTT connect: username "provision", empty password, TLS
subscribe("v1/provision/res");
publish("v1/provision/req",
"{"deviceName":"logger-" + chipId + "","
""provisionDeviceKey":"pk_...","provisionDeviceSecret":"ps_..."}");
// answer: {"status":"SUCCESS","credentialsType":"ACCESS_TOKEN","credentialsValue":"..."}
// store credentialsValue in NVS, reconnect with it, never provision again
On the profile’s Provisioning tab you pick a strategy. With Allow creating new devices, each new board lands in quarantine and its data is dropped until an admin activates it. With Only pre-provisioned devices you create logger-<chipId> names beforehand from your 30 boards, and a leaked key can’t add strangers. For 30 units I’d pre-create them. Hermetry never re-issues a credential for an existing name, so keep the token safe in NVS. Details on Adding and claiming devices.
Print the chip ID on a sticker on each box. When he calls you about « the one in room 4 » you’ll want it.
DNSServer + WiFiManager and the portal pops up on both phones now. Provisioning worked first time with pre-created names; I read the 30 chip IDs over serial into a CSV first. Forgot to save the token to NVS on my first build, so on reboot it tried to provision again and got device_exists. Fixed, and stickers are printed.
- Vous devez être connecté pour répondre à ce sujet.
Rejoignez la discussion
Connectez-vous pour poser et répondre à des questions, aimer les messages utiles et marquer la réponse qui a résolu votre problème. Chaque contribution rapporte des points et des niveaux.

