Credentials manager for Arduino-based projects using EEPROM (which also works with esp8266 and esp32 c++ projects). This tool will help you to store "permanently" different credentials that could be needed in your project.
The credentials currently supported to be stored are: WiFi (SSID and password), Account (email, password and an optional user id) and ** Device Id**.
#include <Credentials.h>
Credentials credentials;
credentials.begin();
Store WiFi SSID and password credentials:
bool setWiFiCredentials(char* ssid, char* password);
Get WiFi SSID and password:
char* getSSID();
char* getSSIDPassword();
Store an account email and password:
bool setAccountCredentials(char* email, char* password);
Store an account email, password and user id:
bool setAccountCredentials(char* email, char* password, char* userId);
Get email, password and user id (if is set):
char* getEmail();
char* getEmailPassword();
char* getUserId();
Store a device id for the microcontroller:
bool setDeviceId(char* deviceId);
Get device id:
char* getDeviceId();
Clear WiFi and Account credentials
bool clear();
Clear everything (use carefully, normally you won't want to delete the Device Id)
bool clearAll();
Note
The first time this library is used, it is recommended to run clearAll()
once the first time, in order to avoid unexpected behaviour or delete previous information stored from other programs or projects.
pio project init --board nodemcuv2
cd src/
ln -s ../examples/main.cpp main.cpp
- Add example
- Improve examples and add comments
- Make the library Arduino IDE friendly
- Add development instructions