π WiFiCreds v1.0.4 Released!
Secure Your Arduino Wi-Fi Projects with Confidence π

π
Release Date: August 24, 2025
π§© What is WiFiCreds?
WiFiCreds is a simple and modular Arduino library that allows you to manage Wi-Fi credentials securely and separately from your main project code β ideal for open-source sharing, classrooms, and client projects.
No more hardcoding credentials into your sketches!
β Highlights
- π Keeps SSID and password out of your codebase
- πΌ Supports multiple credential sets (e.g., home, office, guest)
- π§ Smart default: Automatically picks the first credential set when no name is specified
- π¦ Designed for ESP32, ESP8266, Raspberry Pi Pico W, Arduino UNO R4 WiFi, and more
- π§ͺ Built-in validation to avoid connection errors
- π Clean API:
WiFiCreds::getSSID(),WiFiCreds::getByName("office"),WiFiCreds::isValid(), etc. - π οΈ Multiple examples included for quick testing
- β‘ NEW: Robust implementation with enhanced memory safety
π What's New in v1.0.4
π§ Fixed multiple credential support issues
π Improved fallback logic for invalid credential names
π Added proper string.h includes and safety checks
π‘οΈ Enhanced memory safety with bounds checking
β
Added comprehensive test examples
π Updated documentation with troubleshooting guide
π§ How to Use
- Install the library via Arduino Library Manager or manually from GitHub
- Create your
credentials.hfile inWiFiCreds/src/:
const CredentialSet CREDENTIAL_SETS[] = {
// First set is always the default
{
.name = "home",
.ssid = "MyHomeWiFi",
.password = "HomePassword123"
},
{
.name = "office",
.ssid = "OfficeNetwork",
.password = "OfficePassword456"
},
{
.name = "guest",
.ssid = "GuestWiFi",
.password = "GuestPassword789"
},
{
.name = "mobile",
.ssid = "MyPhoneHotspot",
.password = "MobilePassword"
},
// Terminator entry - must be last!
{
.name = nullptr,
.ssid = nullptr,
.password = nullptr
}
};- In your sketch, include the library and call:
#include <WiFiCreds.h>
// Use default credentials (first set)
WiFi.begin(WiFiCreds::getSSID(), WiFiCreds::getPassword());
// OR use a specific profile
WiFi.begin(WiFiCreds::getSSID("office"), WiFiCreds::getPassword("office"));
// Check if credentials exist before using
if (WiFiCreds::hasCredential("home")) {
WiFi.begin(WiFiCreds::getSSID("home"), WiFiCreds::getPassword("home"));
} else {
// Falls back to default automatically
WiFi.begin(WiFiCreds::getSSID(), WiFiCreds::getPassword());
}π Test Your Setup
Use this simple test to verify your credentials are working:
#include <WiFiCreds.h>
void setup() {
Serial.begin(115200);
// Check credential count
Serial.print("Available credentials: ");
Serial.println(WiFiCreds::getCredentialCount());
// Test default credentials
Serial.print("Default network: ");
Serial.println(WiFiCreds::getSSID());
// Test specific credentials
if (WiFiCreds::hasCredential("home")) {
Serial.println("Home network: Available");
} else {
Serial.println("Home network: Not configured");
}
}π What's Included
- π Modular credential handling with optional named access
- βοΈ Static access functions for performance and simplicity
- π§ͺ Examples for multiple boards and credential sets
- π§Ύ Full Doxygen documentation
- π Git-safe setup with
.gitignoresupport - π‘οΈ NEW: Enhanced error handling and memory safety
- β NEW: Comprehensive test examples and troubleshooting guide
π Best Practices
- π Always add
credentials.hto your.gitignore - β
Use
WiFiCreds::isValid()before connecting - π§± First credential set is used by default if no name is given
- π Use
WiFiCreds::hasCredential()to check if specific credentials exist - π‘οΈ Invalid credential names automatically fall back to default
π§ Troubleshooting
- β No credentials found: Ensure
credentials.his inWiFiCreds/src/directory - β Only default works: Check credential names are case-sensitive and exact
- β Compilation errors: Library now includes proper headers automatically
- β Invalid credentials: Use the test example above to debug your setup
π¨βπ» Author
Made with β€οΈ by [Rithik Krisna M](https://github.com/me-RK)
π [GitHub Repository](https://github.com/me-RK/WiFiCreds)
π¬ [Submit an Issue](https://github.com/me-RK/WiFiCreds/issues)
π‘οΈ This library is designed for development and educational use. For production-grade applications, implement advanced credential storage and encryption strategies.