ESP32-WROOM 32 - can't detect wifi (scan)

fphilip.On
Posts: 6
Joined: Sun Apr 20, 2025 5:07 pm

ESP32-WROOM 32 - can't detect wifi (scan)

Postby fphilip.On » Sun Apr 20, 2025 5:29 pm

Hello,
I I'm trying to connect with the ESP32 to the wifi service.
I'm using an Arduino sketch to scan the available Wi-Fi networks

FYI here is the code I'm using;

Code: Select all

/*
 *  This sketch demonstrates how to scan WiFi networks.
 *  The API is based on the Arduino WiFi Shield library, but has significant changes as newer WiFi functions are supported.
 *  E.g. the return value of `encryptionType()` different because more modern encryption is supported.
 */
#include "WiFi.h"

void setup() {
  Serial.begin(115200);

  // Set WiFi to station mode and disconnect from an AP if it was previously connected.
  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  delay(100);

  Serial.println("Setup done");
}

void loop() {
  Serial.println("Scan start");

  // WiFi.scanNetworks will return the number of networks found.
  int n = WiFi.scanNetworks();
  Serial.println("Scan done");
  if (n == 0) {
    Serial.println("no networks found");
  } else {
    Serial.print(n);
    Serial.println(" networks found");
    Serial.println("Nr | SSID                             | RSSI | CH | Encryption");
    for (int i = 0; i < n; ++i) {
      // Print SSID and RSSI for each network found
      Serial.printf("%2d", i + 1);
      Serial.print(" | ");
      Serial.printf("%-32.32s", WiFi.SSID(i).c_str());
      Serial.print(" | ");
      Serial.printf("%4ld", WiFi.RSSI(i));
      Serial.print(" | ");
      Serial.printf("%2ld", WiFi.channel(i));
      Serial.print(" | ");
      switch (WiFi.encryptionType(i)) {
        case WIFI_AUTH_OPEN:            Serial.print("open"); break;
        case WIFI_AUTH_WEP:             Serial.print("WEP"); break;
        case WIFI_AUTH_WPA_PSK:         Serial.print("WPA"); break;
        case WIFI_AUTH_WPA2_PSK:        Serial.print("WPA2"); break;
        case WIFI_AUTH_WPA_WPA2_PSK:    Serial.print("WPA+WPA2"); break;
        case WIFI_AUTH_WPA2_ENTERPRISE: Serial.print("WPA2-EAP"); break;
        case WIFI_AUTH_WPA3_PSK:        Serial.print("WPA3"); break;
        case WIFI_AUTH_WPA2_WPA3_PSK:   Serial.print("WPA2+WPA3"); break;
        case WIFI_AUTH_WAPI_PSK:        Serial.print("WAPI"); break;
        default:                        Serial.print("unknown");
      }
      Serial.println();
      delay(10);
    }
  }
  Serial.println("");

  // Delete the scan result to free memory for code below.
  WiFi.scanDelete();

  // Wait a bit before scanning again.
  delay(5000);
}
This is the a 'stock' example from the Arduino IDE using the board
DOIT ESP32 DEVKIT V1
.

The serial window shows the following output (again and again):
ESP32 Wifi-ScanOutput 2025-04-19T19-20-13.png
ESP32 Wifi-ScanOutput 2025-04-19T19-20-13.png (28.83 KiB) Viewed 543 times
But I don't get the information that's supposed to be provided by the sketch.
It's not even posting the messages "Setup done" and "Scan Start"
What did I do wrong here?
Any suggestion is much appreciated.

(It's my first attempt to deal with an MCU and Wi-Fi).

lbernstone
Posts: 1132
Joined: Mon Jul 22, 2019 3:20 pm

Re: ESP32-WROOM 32 - can't detect wifi (scan)

Postby lbernstone » Mon Apr 21, 2025 7:02 am

Probably a power issue. Do you get serial output if you just do a simple `Serial.println("Hello World");` sketch? How are you powering the device? Is this a dev board or homemade?

fphilip.On
Posts: 6
Joined: Sun Apr 20, 2025 5:07 pm

Re: ESP32-WROOM 32 - can't detect wifi (scan)

Postby fphilip.On » Tue Apr 22, 2025 1:34 pm

Hello,

Yes, a simple "Hello World" sketch with an blink of the onboard LED is working fine.
Every time when I'm using a sketch with Wi-Fi is posting this block of information.
Upload is completing w/o any error.
I'm using the board "DOIT ESP32 DEV Kit V1".

I'm wondering, where is the block of information coming from? Is it returned by the board?
And what does it stands for?
Many questions. :-)
Thanks for taking the time reading this.

lbernstone
Posts: 1132
Joined: Mon Jul 22, 2019 3:20 pm

Re: ESP32-WROOM 32 - can't detect wifi (scan)

Postby lbernstone » Wed Apr 23, 2025 6:17 am

The text you are seeing is the boot log. It shows the reset reason, and then the segments it is loading from the flash for the bootloader. The system is crashing, and not giving you any backtrace. This makes me think it is not getting adequate power. Try another usb cable, try a different usb port.

Who is online

Users browsing this forum: Baidu [Spider], Qwantbot and 3 guests