A simple ESP32 WiFi connection project with secure credential management and LED signal strength indicator.
- Secure WiFi Configuration: Credentials stored in separate file (gitignored)
- Auto-reconnection: Automatically reconnects if WiFi drops
- Signal Strength LED: Built-in LED shows WiFi signal strength via blink patterns
- Serial Monitoring: Real-time connection status and debugging
- Arduino IDE Compatible: Easy to use with Arduino IDE
- Arduino IDE installed
- ESP32 board package installed in Arduino IDE
- ESP32C3 development board
Download and install Arduino IDE from arduino.cc
-
Open Arduino IDE
-
Go to File → Preferences
-
Add this URL to Additional Board Manager URLs:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
-
Go to Tools → Board → Boards Manager
-
Search for "ESP32" and install "ESP32 by Espressif Systems"
- Open Arduino IDE
- Go to File → Open
- Navigate to this project folder
- Open
esp32-wifi-config/esp32-wifi-config.ino
- Go to Tools → Board → ESP32 Arduino → ESP32C3 Dev Module
- Set CPU Frequency to
80MHz
- Set Flash Mode to
DIO
- Set Partition Scheme to
Default 4MB with spiffs
- Set Upload Speed to
115200
- Set USB CDC On Boot to
Enabled
-
Copy
wifi_config_template.h
towifi_config.h
:cp esp32-wifi-config/wifi_config_template.h esp32-wifi-config/wifi_config.h
-
Edit
esp32-wifi-config/wifi_config.h
with your WiFi credentials:const char* WIFI_SSID = "YourWiFiNetwork"; const char* WIFI_PASSWORD = "YourWiFiPassword";
Note: wifi_config.h
is gitignored for security.
- Connect your ESP32C3 to your computer via USB
- Select the correct COM port in Arduino IDE
- Click the Upload button (→) in Arduino IDE
- Wait for upload to complete
- Open Tools → Serial Monitor
- Set baud rate to
115200
- Watch for connection status and signal strength
The built-in LED shows WiFi signal strength:
- Fast blink (100ms): Strong signal (-30 to -50 dBm)
- Medium blink (500ms): Medium signal (-50 to -70 dBm)
- Slow blink (1000ms): Weak signal (below -70 dBm)
- LED off: No WiFi connection
esp32-wifi-config-cpp/
├── esp32-wifi-config/
│ ├── esp32-wifi-config.ino # Main Arduino sketch
│ ├── wifi_config.h # WiFi credentials (gitignored)
│ └── wifi_config_template.h # Credentials template
├── .gitignore # Git ignore rules
└── README.md # This file
- Check USB connection
- Install correct drivers
- Verify COM port selection
- Press and hold BOOT button while uploading
- Check board settings (CPU frequency, flash mode)
- Try different USB cable
- Verify credentials in
wifi_config.h
- Check WiFi network availability
- Ensure 2.4GHz network (ESP32 doesn't support 5GHz)
- Check board settings, especially CPU frequency (must be 80MHz for ESP32C3)
- Verify flash mode is set to DIO
- Try different partition scheme
- Set USB CDC On Boot to
Enabled
- Check baud rate (115200)
- Try different COM port
- Board: ESP32C3 Dev Module
- CPU Frequency: 80MHz
- Flash Mode: DIO
- Flash Size: 4MB
- Partition Scheme: Default 4MB with spiffs
- Upload Speed: 115200
- USB CDC On Boot: Enabled
- WiFi credentials are stored in
wifi_config.h
which is gitignored - Never commit real credentials to version control
- Use the template file for new deployments
- Change default credentials before production use
This project is licensed under the MIT License - see the LICENSE file for details.