Skip to content

RoboticSolutionsBO/Credentials

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Credentials

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**.

Usage

Initialization

#include <Credentials.h>

Credentials credentials;
credentials.begin();

WiFi

Store WiFi SSID and password credentials:

bool setWiFiCredentials(char* ssid, char* password);

Get WiFi SSID and password:

char* getSSID();
char* getSSIDPassword();

Account

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();

Device Id

Store a device id for the microcontroller:

bool setDeviceId(char* deviceId);

Get device id:

char* getDeviceId();

Other

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.

Dev using Platformio

Init project

pio project init --board nodemcuv2

Link the example main.cpp to src (this is optional)

cd src/
ln -s ../examples/main.cpp main.cpp

TODO

  • Add example
  • Improve examples and add comments
  • Make the library Arduino IDE friendly
  • Add development instructions

About

Credentials manager for Arduino based projects using EEPROM

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages