2019-12-03 23:16:06 +00:00
|
|
|
#include <ESP8266React.h>
|
2021-03-06 22:06:09 +01:00
|
|
|
#include "ClockService.h"
|
2021-03-17 16:57:54 +00:00
|
|
|
#include "InformationService.h"
|
2018-02-26 00:11:31 +00:00
|
|
|
|
|
|
|
#define SERIAL_BAUD_RATE 115200
|
|
|
|
|
2021-03-06 23:42:48 +01:00
|
|
|
// version info
|
|
|
|
#define VERSION "v0.1.0"
|
|
|
|
|
2018-02-26 00:11:31 +00:00
|
|
|
AsyncWebServer server(80);
|
2020-07-19 19:32:08 +01:00
|
|
|
ESP8266React esp8266React(&server);
|
2021-03-06 22:06:09 +01:00
|
|
|
|
2021-03-17 16:57:54 +00:00
|
|
|
//ClockService cservice = ClockService(&server, esp8266React.getSecurityManager());
|
|
|
|
InformationService iservice = InformationService(&server, esp8266React.getSecurityManager());
|
2018-02-26 00:11:31 +00:00
|
|
|
|
|
|
|
void setup() {
|
2019-08-09 15:53:39 +01:00
|
|
|
// start serial and filesystem
|
2019-06-07 20:08:46 +01:00
|
|
|
Serial.begin(SERIAL_BAUD_RATE);
|
2021-03-17 16:57:54 +00:00
|
|
|
Serial.printf("Starting WordClock %s\n", VERSION);
|
2019-09-30 21:28:24 +01:00
|
|
|
|
|
|
|
// start the framework and demo project
|
|
|
|
esp8266React.begin();
|
2019-09-30 21:38:44 +01:00
|
|
|
|
2020-05-14 23:23:45 +01:00
|
|
|
// load the initial light settings
|
2021-03-17 16:57:54 +00:00
|
|
|
// cservice.begin();
|
|
|
|
|
|
|
|
iservice.begin();
|
2019-09-30 21:28:24 +01:00
|
|
|
|
2019-08-09 15:53:39 +01:00
|
|
|
// start the server
|
2019-06-07 20:08:46 +01:00
|
|
|
server.begin();
|
2018-02-26 00:11:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void loop() {
|
2019-08-09 15:53:39 +01:00
|
|
|
// run the framework's loop function
|
2019-09-30 21:28:24 +01:00
|
|
|
esp8266React.loop();
|
2018-02-26 00:11:31 +00:00
|
|
|
}
|