Any concerns? support@freenove.com
Chapter 5 WiFi Working Modes
When ESP32-S3 WROOM successfully connects to “ssid_Router”, serial monitor will print out the IP address
assigned to ESP32-S3 WROOM by the router.
The following is the program code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <WiFi.h>
const char *ssid_Router = "********"; //Enter the router name
const char *password_Router = "********"; //Enter the router password
void setup(){
Serial.begin(115200);
delay(2000);
Serial.println("Setup start");
WiFi.begin(ssid_Router, password_Router);
Serial.println(String("Connecting to ")+ssid_Router);
while (WiFi.status() != WL_CONNECTED){
delay(500);
Serial.print(".");
}
Serial.println("\nConnected, IP address: ");
Serial.println(WiFi.localIP());
Serial.println("Setup End");
}
void loop() {
}
Include the WiFi Library header file of ESP32-S3.
Enter correct router name and password.
const char *ssid_Router = "********"; //Enter the router name
const char *password_Router = "********"; //Enter the router password
Set ESP32-S3 in Station mode and connect it to your router.
WiFi.begin(ssid_Router, password_Router);
Check whether ESP32-S3 has connected to router successfully every 0.5s.
while (WiFi.status() != WL_CONNECTED){
delay(500);
Serial.print(".");
}
Serial monitor prints out the IP address assigned to ESP32-S3 WROOM
Serial.println(WiFi.localIP());
Every time when using WiFi, you need to include header file "WiFi.h.".
begin(ssid, password,channel, bssid, connect): ESP32-S3 is used as Station to connect hotspot.
ssid: WiFi hotspot name