Networking and Communications
Feature What I learned
My Xiao ESP32 Networking & Communication Experience
While working on Xiao ESP32 for the first time, I got to explore something very new and exciting — Networking and Communication. Honestly, before this, I only thought microcontrollers were for blinking LEDs or controlling motors. But this time, I made my ESP32 talk to my mobile hotspot like a smart device!
What is Networking & Communication (as I understood it)
In simple words, networking and communication are all about connecting devices so they can share information. It could be through WiFi, Bluetooth, or other wireless systems.
Component / Aspect | What it Does / Why it's Important |
---|---|
WiFi Module | Helps ESP32 connect wirelessly to a network |
MAC Address | Unique permanent identity of every ESP32 device |
IP Address | Temporary address given to ESP32 when connected to WiFi |
Router / Hotspot | Provides internet connection & assigns IP address |
Web Server | Allows ESP32 to host and display a webpage |
How I Connected XIAO ESP32
This was my first step. I came to know that every device has a unique MAC Address like a fingerprint. I used Arduino IDE for this.
Steps I followed:
Step 1: Connected Xiao ESP32 to laptop
Step 2: Opened Arduino IDE → Selected correct board and port
Add ESP32 Board to Arduino IDE Open Arduino IDE → Preferences
In Additional Board Manager URLs,
Go to → Tools → Board → Board Manager
Search for ESP32
Install esp32 by Espressif Systems
Step 3: Uploaded this simple code:
void setup() {
Serial.begin(115200); // Start Serial at 115200 baud rate
delay(1000); // Wait for Serial to start
Serial.println("Hello from ESP32 Xiao!");
}
void loop() {
Serial.println("Still running...");
delay(1000); // Wait 1 second
}
How I Got MAC Address of Xiao ESP32
While working on networking and communication using Xiao ESP32, I wanted to find out my board's MAC address.
A MAC address is like a unique identity given to every device by the manufacturer. It is really useful while connecting devices in a network or for identification.
Steps I followed:
Step 1: I opened Arduino IDE.
Step 2: Then selected the correct board: Tools → Board → Seeed Xiao ESP32C3
Step 3: After that, I selected the right port: Tools → Port → (My device port)
Library I used:
For getting the MAC address, I didn’t have to install any extra library. The Xiao ESP32 board package already comes with an in-built library called: 'WiFi.h'
This library has a simple function called → WiFi.macAddress() which directly gives the MAC address.
Code I uploaded:
include
void setup() {
Serial.begin(115200);
Serial.println("MAC Address of my Xiao ESP32 is:");
Serial.println(WiFi.macAddress());
}
void loop() {
// Nothing here
}
Output I got:
Once I uploaded this code and opened the Serial Monitor (baud rate: 115200), I got my MAC address like this:
' DC:DA:0C:17:81:D4 '
Note: This MAC address will be different for every board because each ESP32 device has its own unique MAC.
Communication Between 2 Xiao ESP32 (Sender & Receiver)
As a part of exploring Networking and Communication, I tried connecting two Xiao ESP32 boards — where one was sending a message and the other was receiving it.
This method uses a feature called ESP-NOW — which allows ESP32 devices to communicate directly without any WiFi router or internet. It's super useful for short-distance communication between boards.
Libraries Required: → No extra libraries are needed!
Everything comes built-in with ESP32 boards in Arduino IDE.
Just include: