WiFi LoRa 32 (V3) - WIFI Connection Problems

Dear Community,

I switched from WiFi LoRa 32 V2 to V3. With V3 I have problems with connecting to WIFI.

Example Code:
// connect Wifi

  WiFi.mode(WIFI_STA);
  WiFi.persistent(false);
  WiFi.setAutoReconnect(true);
  WiFi.setSleep(false);

  Serial.println("\nConnecting");
  WiFi.begin(ssid, password);

  int timeout_counter = 0;

  while (WiFi.status() != WL_CONNECTED) {
    // failed, retry
    Serial.print(".");
    delay(500);
    timeout_counter++;
    if(timeout_counter >= CONNECTION_TIMEOUT*5){
        ESP.restart();
    }
  }

  Serial.println("You're connected to the network");
  Serial.print("Connected, IP address: ");
  Serial.println(WiFi.localIP());
  Serial.println(WiFi.getHostname());
  Serial.println();
  delay(1000);
  bool success = Ping.ping("www.google.com", 3);
  if(!success){
    Serial.println("Ping failed");
    return;
  }
  Serial.println("Ping succesful.");
  delay(1000);

I now put in the ESP.restart(), sometimes it connects after 5s, sometimes after 3 minutes.

I had a look at the logs of the WIFI controller, it gives the following error:
WPA2 Key message 4 from Station xx:xx:xx:xx:xx:xx xx:xx:xx:xx:xx:xx ap2661 did not match the replay counter 01 vs 02
Reason Ptk Challenge Failed

SO there is an error with syncing the WIFI Key, with V2 there is completely no problem, so there is something wrong with WIFO with ESP32 S3 Chip.

DO you have any Idea? Is there a firmware update for that Board?

Thanks in Advance,
BR Mark

Mark, I would imagine you are trying to adjust your V2 code.

I never had a V2 of this board, only the new V3.

I clone this repository to my computer:

V3 libs

Then look at this factory test file.

examples/Factory_Test/WiFi_LoRa_32FactoryTest/WiFi_LoRa_32FactoryTest.ino

LIne 56 is where you key in your magic strings.

WiFi.begin("Your WiFi SSID","Your Password");//fill in "Your WiFi SSID","Your Password"

This worked for me right out of the box!.

Now the Lora stuff is all screwed up. The Heltec libs are all for the SX1278.
The V3 uses the SX1262 radio.

If you are doing Lora, you might want to look at:

RadioLib code

1 Like

Thanks for your answer, but its not the problem I am pointing to.
Of course I have this line implemented.

The point ist that, that the V3 has problems with connecting / getting an IP, compared to the V2 with the SAME Code for connecting to WIFI.

The Factory_Text Code works perfectly on V2, but on V3 not, that’s the problem :confused:

I haven’t found a solution to the problem, but I too have a V3 board that can take ages to connect to WiFi. Sometimes, it will connect almost immediately, others it can seem to sit there for minutes on end, failing to connect. Sometimes it will lose the connection and, once again, spend forever trying to reconnect. Resetting the board usually overcomes the endless failure cycle, and most of the time, once it’s connected it stays that way. The WiFi router is in the same room.

There was a thread some time back that suggested that the onboard antenna wasn’t really up to the task, but since the board did ultimately connect, and I had other things to do, I haven’t investigated this any further.

I also have a V2 board in the same room that doesn’t seem to display this problem, but it is an ‘operational’ device so I’m not watching its Serial Monitor. The V3 board is still in a test environment, which is changing regularly, so I’m watching everything it does, constantly. So it is possible that I’m just not noticing what’s going on with the V2 board. But they both seem to be OK, most of the time, once they do get connected.

So you’re not alone… if that helps…