Gbox 4.20
Grow box automation and monitoring - <a href='https://sites.google.com/site/growboxguy/'>https://sites.google.com/site/growboxguy/</a>
 
Loading...
Searching...
No Matches
webserver_controls.ino
Go to the documentation of this file.
1
17#include <ELClient.h>
18#include <ELClientWebServer.h>
19#include "Pages.h"
20
21// Initialize a connection to esp-link using the normal hardware serial port
22//
23// DEBUG is disasbled as
24// - packet logging is slow and UART receive buffer can overrun (HTML form submission)
26
27// Initialize the Web-Server client
29
30
31// Callback made form esp-link to notify that it has just come out of a reset. This means we
32// need to initialize it!
33void resetCb(void) {
34 Serial.println("EL-Client (re-)starting!");
35 bool ok = false;
36 do {
37 ok = esp.Sync(); // sync up with esp-link, blocks for up to 2 seconds
38 if (!ok) Serial.println("EL-Client sync failed!");
39 } while(!ok);
40 Serial.println("EL-Client synced!");
41
42 webServer.setup();
43}
44
45void setup()
46{
47 Serial.begin(115200);
48
49 esp.resetCb = resetCb;
50
51 ledInit();
52 userInit();
54
55 resetCb();
56}
57
58void loop()
59{
60 esp.Process();
61
62 ledLoop();
64}
65
Definitions for ELClientWebServer.
Definitions for ELClient.
void ledLoop()
Definition LedPage.ino:30
void ledInit()
Definition LedPage.ino:215
void voltageLoop()
void userInit()
Definition UserPage.ino:75
void voltageInit()
void setup()
ELClientWebServer webServer & esp
ELClient esp & Serial
void resetCb(void)
void loop()