I developed a product (IoT Device, with ESP-WROOM-32) and it is working fine ! The software in the ESP32 works very well. I use the Microsoft Azure platform to collect the data and connect my devices (As well to give back the data to my customers).
All the development of the OS to my boards, were made in the Arduino IDE (I started the business using ATMEGA processors and ESP8266, but now our products received an upgrade to ESP32, and I am very happy with it ).
I am having an Issue, with the WiFi.softAP, and I do not know what can be the problem.
When I finish the production of the PCB with the processor, I make the download of the OS in the device (directly using the bin file, as I do not need to modify it) and I make a test run before send it out to customers.
So, the product out of the box, is in WebServer mode, so the customers can configure the device to work properly in their WiFi network, so they need to connect via a SSID and Password to my device and perform the configuration.
The problem is that round about 10% of the ESP32 processors I face the same problem: In softAP (WebServer), when I try to connect using my standard password, the answer is that the password is incorrect and I cannot connect. For 90% of the processors I have no problem, they accept the password, they connect and work perfectly. Those with problems, if I set no password to connect, they also works without problem, but due to Safety request from my customers it must be Password protected. (OK the problematic ones, are still with me, because they work and I hope to find a solution).
I assembled 230 devices last month, and 19 of them presented this problem described. So I am not sure if this is a hardware problem (perhaps my soldering team are doing something wrong), quality problem from the Processor, or something I can improve in the software.
The part of the software that manage the softAP part is here:
- #define selfssid "MYSSID.LOCAL" //SSID WEB SERVER
- #define selfpassword "TheBestSecret2020" //PASSWORD WEBSERVER
- #include <WiFi.h>
- #include <WebServer.h>
- #define WIFI_EVENT_STA_CONNECTED SYSTEM_EVENT_STA_CONNECTED
- #define WIFI_EVENT_STA_DISCONNECTED SYSTEM_EVENT_STA_DISCONNECTED
- #define WIFI_EVENT_AP_STACONNECTED SYSTEM_EVENT_AP_STACONNECTED
- #define WIFI_EVENT_AP_STADISCONNECTED SYSTEM_EVENT_AP_STADISCONNECTED
- #define WIFI_EVENT_ALL SYSTEM_EVENT_MAX
- //############################ Global Variables #################################
- /* Standard IP During programming WEB Server Mode */
- IPAddress local_ip(192, 168, 4, 1);
- IPAddress gateway(192, 168, 1, 1);
- IPAddress subnet(255, 255, 255, 0);
- //Setup Web Server mode (Config Mode).
- void setupWEBServer() {
- if (WiFi.getMode()!=3){ //In case wifi is not in mode softAP, forces it to disconnect.
- WiFi.disconnect(true);
- FinishAPConnection(); //Subroutine to disconnect all active connections if existent ones...
- delay (3000);}
- Serial.println("SETUP WEB SERVER !!!!!");
- // Prepare HTML page
- SetupWebServerPages(); //Call routine to prepare the HTML pages at WebServer mode.
- // Start WiFi soft AP.
- WiFi.mode(WIFI_AP); //Set mode of the Wifi
- WiFi.softAP(selfssid, selfpassword);
- WiFi.softAPConfig(local_ip, gateway, subnet);
- delay(800);
- //Other stuff, etc...
Thank a lot.
DeivisSajermann