Arduino-esp32: can't change wifi name and pass on WiFi.softAP(ssid, password);

Created on 10 Jul 2020  路  6Comments  路  Source: espressif/arduino-esp32

I Try active wifi access point on esp32 with dip switch,
but odd, the wifi name and pass can't change as configure WiFi.softAP(ssid, password);
wifi name and pass still use program before

this my code

include

include

include

WiFiServer server(80);

bool hold_active_wifi=false;

const byte inset1 = 34;
const byte inset2 = 35;

const char* ssid = "kwh_jimmi";
const char* password = "123456";

define ON 0

define OFF 1

void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(inset1, INPUT);
pinMode(inset2, INPUT);

if(digitalRead(inset1) == ON){
if(hold_active_wifi == false){
active_wifi();
hold_active_wifi = true;
}

while(1){
if(digitalRead(inset1) == OFF){
ESP.restart();
}
WiFiClient client = server.available();
}
}

}

void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(inset1) == ON){
ESP.restart();
}
Serial.println("aplikasi running...");
delay(1000);
}

void active_wifi(){
Serial.println("active wifi...");
WiFi.softAP(ssid, password);
IPAddress IP = WiFi.softAPIP();
Serial.print("AP IP address: ");
Serial.println(IP);
server.begin();
}

stale

Most helpful comment

@jimmisitepu88 make your password atleast 8 character long. It will work.

All 6 comments

This site is for issues with the arduino-esp32 code, not your logic. If you cut this to just the code in active_wifi(), does it start the AP with the correct credentials?

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@jimmisitepu88 make your password atleast 8 character long. It will work.

[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future.

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jh83 picture jh83  路  124Comments

dsyleixa picture dsyleixa  路  99Comments

dbachko picture dbachko  路  84Comments

adamwilt picture adamwilt  路  63Comments

tablatronix picture tablatronix  路  72Comments