EPD Display  1.0.0
Library and application for EPD smart displays
Classes | Macros | Enumerations | Functions | Variables
EPD Display - application

Application for ESP32. More...

Classes

class  DisplayContent_t
 Definition of data variables. More...
 
class  DisplayDrawer
 Drawing the choosen display modes. More...
 
class  EpdSetup
 Device and displayed data management with setup data. More...
 
class  EpdWebServer
 Establing and creating network connection / Reading remote host API GET response. More...
 
class  JsonParse
 Parsing Data and Setup from remote host API. More...
 

Macros

#define APIURL   "http://192.168.1.18:8000/"
 
#define SETUPURL   "http://192.168.1.18:8000/setup/84:CC:A8:48:58:C4"
 
#define PARAM_INPUT_SSID   "SsidInput"
 
#define PARAM_INPUT_PASS   "PasswordInput"
 
#define WIFI_TIMEOT_MS   5000
 
#define AP_TIMEOT_MS   60000
 
#define ssidAP   "ESP32-EPaper"
 
#define passwordAP   "password"
 
#define MAC   WiFi.macAddress().c_str()
 

Enumerations

enum  SettingType { SETTING_CARD, SETTING_TABLE, SETTING_MEETING }
 

Functions

void notFound (AsyncWebServerRequest *request)
 Error - host not found. More...
 
AsyncWebServer server (80)
 
String readFile (fs::FS &fs, const char *path)
 Reading Flash memory files with network credentials. More...
 
void writeFile (fs::FS &fs, const char *path, const char *message)
 Writing Flash memory files with network credentials. More...
 
String processor (const String &var)
 Replaces placeholder with stored values. More...
 
 DisplayDrawer::DisplayDrawer (EPD_Display *display)
 
void DisplayDrawer::SetDesign (uint8_t design)
 Setting up the design. More...
 
void DisplayDrawer::DrawConnect ()
 Design and item layout for the Connecting screen. More...
 
void DisplayDrawer::DrawAP ()
 Design and item layout for the Wireless network initialization screen. More...
 
void DisplayDrawer::DrawCard (DisplayContent_t *data)
 Design and item layout for the Nameplate (card) mode. More...
 
void DisplayDrawer::DrawTable (DisplayContent_t *data, int hour, String date, String day)
 Design and item layout for the Timetable mode. More...
 
void DisplayDrawer::DrawMeeting (DisplayContent_t *data, int hour, String date, String day)
 Design and item layout for the Timetable mode. More...
 
void DisplayDrawer::Show ()
 Shows the content - Sends the image buffer in RAM to e-Paper and displays. More...
 
 EpdSetup::EpdSetup (String setup)
 Construct a new Epd Setup:: Epd Setup object. More...
 
void EpdWebServer::createSoftAP ()
 Create and start Soft Acces Point mode for network setup. More...
 
void EpdWebServer::connectToWifi (EPD_Display *display)
 Connecting to the choosen Wireless Network (reading credentials in internal memory) More...
 
String EpdWebServer::getApiResponse (String who, String what, String id)
 API GET Method - reading remote host endpoint with data. More...
 
String EpdWebServer::getSetup ()
 API GET Method - reading remote host endpoint. More...
 
void JsonParse::getParseData (String payload, DisplayContent_t *data)
 Parsing Data and Setup from remote host API. More...
 

Variables

const char index_html[] PROGMEM
 
HTTPClient http
 
String valuePassword
 
String valueSsid
 
String SsidInput
 
String PasswordInput
 
int setting
 

Detailed Description

Application for ESP32.

Macro Definition Documentation

◆ AP_TIMEOT_MS

#define AP_TIMEOT_MS   60000

◆ APIURL

#define APIURL   "http://192.168.1.18:8000/"

URL - remote host NoSQL Database (API)

◆ MAC

#define MAC   WiFi.macAddress().c_str()

Device MAC adress

◆ PARAM_INPUT_PASS

#define PARAM_INPUT_PASS   "PasswordInput"

◆ PARAM_INPUT_SSID

#define PARAM_INPUT_SSID   "SsidInput"

default values for the TextBox inputs

◆ passwordAP

#define passwordAP   "password"

◆ SETUPURL

#define SETUPURL   "http://192.168.1.18:8000/setup/84:CC:A8:48:58:C4"

◆ ssidAP

#define ssidAP   "ESP32-EPaper"

Soft Acces Point (Network) credentials

◆ WIFI_TIMEOT_MS

#define WIFI_TIMEOT_MS   5000

Wait/Idle time for establishing connection

Enumeration Type Documentation

◆ SettingType

Display mode setting

Enumerator
SETTING_CARD 
SETTING_TABLE 
SETTING_MEETING 

Function Documentation

◆ connectToWifi()

void EpdWebServer::connectToWifi ( EPD_Display display)

Connecting to the choosen Wireless Network (reading credentials in internal memory)

◆ createSoftAP()

void EpdWebServer::createSoftAP ( )

Create and start Soft Acces Point mode for network setup.

◆ DisplayDrawer()

DisplayDrawer::DisplayDrawer ( EPD_Display display)

◆ DrawAP()

void DisplayDrawer::DrawAP ( )

Design and item layout for the Wireless network initialization screen.

◆ DrawCard()

void DisplayDrawer::DrawCard ( DisplayContent_t content)

Design and item layout for the Nameplate (card) mode.

Parameters
*contentThe displayed data (content)

◆ DrawConnect()

void DisplayDrawer::DrawConnect ( )

Design and item layout for the Connecting screen.

◆ DrawMeeting()

void DisplayDrawer::DrawMeeting ( DisplayContent_t meeting_content,
int  hour,
String  date,
String  day 
)

Design and item layout for the Timetable mode.

Parameters
*meeting_contentThe displayed data (content)
hourThe current hour of the day
dateThe current date
dayThe current day of the week

◆ DrawTable()

void DisplayDrawer::DrawTable ( DisplayContent_t table_content,
int  hour,
String  date,
String  day 
)

Design and item layout for the Timetable mode.

Parameters
*table_contentThe displayed data (content)
hourThe current hour of the day
dateThe current date
dayThe current day of the week

◆ EpdSetup()

EpdSetup::EpdSetup ( String  setup)

Construct a new Epd Setup:: Epd Setup object.

Parameters
setupThe remote data (API GET)

◆ getApiResponse()

String EpdWebServer::getApiResponse ( String  who,
String  what,
String  id 
)

API GET Method - reading remote host endpoint with data.

Parameters
whoEpd
whatDisplay mode /card/table/meet
idIdentificator of an specific entity (user/room)

◆ getParseData()

void JsonParse::getParseData ( String  payload,
DisplayContent_t data 
)

Parsing Data and Setup from remote host API.

Parameters
payloadThe data from remote host (API GET)
dataDisplay Content

◆ getSetup()

String EpdWebServer::getSetup ( )

API GET Method - reading remote host endpoint.

◆ notFound()

void notFound ( AsyncWebServerRequest *  request)

Error - host not found.

Parameters
request

◆ processor()

String processor ( const String &  var)

Replaces placeholder with stored values.

◆ readFile()

String readFile ( fs::FS &  fs,
const char *  path 
)

Reading Flash memory files with network credentials.

◆ server()

AsyncWebServer server ( 80  )

◆ SetDesign()

void DisplayDrawer::SetDesign ( uint8_t  design)

Setting up the design.

Parameters
designDisplay design depending on the display size /2/4/7 inch

◆ Show()

void DisplayDrawer::Show ( )

Shows the content - Sends the image buffer in RAM to e-Paper and displays.

◆ writeFile()

void writeFile ( fs::FS &  fs,
const char *  path,
const char *  message 
)

Writing Flash memory files with network credentials.

Variable Documentation

◆ http

HTTPClient http

◆ PasswordInput

String PasswordInput

◆ PROGMEM

const char index_html [] PROGMEM
Initial value:
= R"rawliteral(
<!DOCTYPE HTML><html>
<title>ESP Input Form</title>
<head><meta name="viewport" content="width=device-width, initial-scale=1">
<style>html { font-family: Courier New; display: inline-block; margin: 0px auto; text-align: center;background-color:#e0e0e0}
</style></head>
<script>
function submitMessage(){
var xhttp = new XMLHttpRequest();
xhttp.open("GET", "/restartESP", true);
xhttp.send();
alert("Connecting to the choosen network");
setTimeout(function(){document.location.reload(false);},500)
}
</script>
</head>
<body><h1 style="background-color:#900C3F; color:white;">Smart E-Paper Nameplate Project</h1>
<form action="/get" target="hidden-form">
Insert<B> SSID</B>: <br/> <input type="text" name="SsidInput" size="17" value=%SsidInput%>
<br/><br/>
Insert <B> Password</B>: <br/> <input type="text " name="PasswordInput" size="17" value=%PasswordInput%>
<br/><br/>
<input type = "submit" style= "width:80px;height:40px;" value= "Connect" onclick = "submitMessage()" >
<p style="background-color:#900C3F; color:white;">
designed by <B>Bc. David Janosfalvi</B> <br/> Slovak University of Technology 2022</p>
<iframe style="display:none" name="hidden-form"></iframe>
</body></html>)rawliteral"

Soft Acces Point web page to handle 2 textboxes (for SSID and Password)

◆ setting

int setting

◆ SsidInput

String SsidInput

◆ valuePassword

String valuePassword

◆ valueSsid

String valueSsid