ESP32 kurulum portalı telefonlarda açılmıyor, 30 cihaz kendi token'ını nasıl alacak?
Yapay zekâ tarafından English dilinden çevrildi ·
Yine ben, şimdi mahzenimden çok daha büyük bir iş yapıyorum. Bir arkadaşım soğuk odaları için ESP32 sıcaklık kaydediciლerimden 30 tane istiyor. Her birine farklı bir Hermetry token’ı yazmak istemiyorum ve o, benim yardımım olmadan kendi Wi-Fi bilgisini girebilmeli.Fikrim şu: ilk açılışta ESP32 “Logger-Setup” adında bir erişim noktası açsın, arkadaşımın telefonu bağlansın, Wi-Fi adı ve şifresini soran bir sayfa kendiliğinden açılsın, iş bitsin. AP’yi ve 192.168.4.1 üzerindeki web sunucusunu çalışır hale getirdim. Ama sayfa kendiliğinden açılmıyor. Android telefonumda “İnternet yok” yazıyor ve öyle kalıyor, arkadaşımın iPhone’unda ise hiçbir şey olmuyor. Tarayıcıyı açıp IP’yi yazmak gerekiyor, bunu da o yapmayacak.İkinci kısım: 30 cihaz için Hermetry kimlik bilgisi nereden gelecek? Hepsine aynı token vermek yanlış görünüyor.
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.
Yapay zekâ tarafından English dilinden çevrildi ·
Açılır pencerenin çıkması için ESP32 üzerinde her adı 192.168.4.1 ile yanıtlayan bir DNS sunucusu gerekir. Telefon bilinen bir adresi dener, bunun yerine sizin sayfanızı alır ve bunun bir portal olduğuna karar verir.
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.
Yapay zekâ tarafından English dilinden çevrildi ·
Android özellikle 204 yanıtını kontrol eder; başka bir yanıt alırsa oturum açma istemini göstermelidir. DNS kısmı olmadan sunucunuza muhtemelen hiç istek gelmiyor.
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.
Yapay zekâ tarafından English dilinden çevrildi ·
WiFiManager bunların hepsini sizin için yapar; sayfadaki özel alanlar dahil.
WiFiManager does all of that for you, including custom fields on the page.
Yapay zekâ tarafından English dilinden çevrildi ·
Belki aptalca bir soru ama o yanlış şifreyi yazarsa ne olur?
Silly question maybe, but what happens if he types the wrong password?
Yapay zekâ tarafından English dilinden çevrildi ·
WiFiManager, bağlanamazsa portala yeniden geri döner, bu kısım çözülmüş durumda.Kimlik bilgisi konusunda, tek bir ortak token yanlıştan da kötüdür. Hermetry cihaz başına tek oturuma izin verir, dolayısıyla tek token paylaşan 30 kart birbirinin oturumunu sürekli düşürür. Bunun yerine profilin provisioning özelliğini kullanın. Aynı firmware’i profilin provisioning anahtarı ve sırrıyla yükleyin; her kart ilk açılışta kendi kimlik bilgisini ister:
// 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
Profilin Provisioning sekmesinde bir strateji seçersiniz. Yeni cihaz oluşturmaya izin ver seçilirse, her yeni kart karantinaya düşer ve bir yönetici etkinleştirene kadar verileri atılır. Yalnızca önceden provizyonlanmış cihazlar seçilirse, 30 kartınız için logger-<chipId> adlarını önceden oluşturursunuz ve sızan bir anahtar yabancı cihaz ekleyemez. 30 birim için önceden oluşturmanızı öneririm. Hermetry mevcut bir ad için kimlik bilgisini yeniden vermez, bu yüzden token’ı NVS’de güvende tutun. Ayrıntılar için Cihaz ekleme ve sahiplenme sayfasına bakın.
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.
Yapay zekâ tarafından English dilinden çevrildi ·
Her kutunun üzerindeki etikete chip ID’sini yazdırın. Sizi arayıp “oda 4’teki cihaz” dediğinde buna ihtiyacınız olacak.
Print the chip ID on a sticker on each box. When he calls you about “the one in room 4” you’ll want it.
Yapay zekâ tarafından English dilinden çevrildi ·
DNSServer + WiFiManager eklendi ve artık portal her iki telefonda da açılıyor. Provisioning, önceden oluşturulmuş isimlerle ilk denemede çalıştı; önce 30 çip ID’sini seri port üzerinden okuyup bir CSV dosyasına kaydettim. İlk derlemede token’ı NVS’e kaydetmeyi unutmuştum, bu yüzden yeniden başlatmada provisioning tekrar denendi ve device_exists hatası aldı. Düzeltildi, etiketler de basıldı.
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.
- Bu konuyu yanıtlamak için giriş yapmış olmalısınız.
Sohbete katılın
Soru sormak ve yanıtlamak, yararlı gönderileri beğenmek ve sorununuzu çözen yanıtı işaretlemek için oturum açın. Her katkı puan ve seviye kazandırır.

