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)
25
ELClient
esp
(&
Serial
, &
Serial
);
26
27
// Initialize the Web-Server client
28
ELClientWebServer
webServer(&
esp
);
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!
33
void
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
45
void
setup
()
46
{
47
Serial
.begin(115200);
48
49
esp
.resetCb =
resetCb
;
50
51
ledInit
();
52
userInit
();
53
voltageInit
();
54
55
resetCb
();
56
}
57
58
void
loop
()
59
{
60
esp
.Process();
61
62
ledLoop
();
63
voltageLoop
();
64
}
65
ELClientWebServer.h
Definitions for ELClientWebServer.
ELClient.h
Definitions for ELClient.
ledLoop
void ledLoop()
Definition
LedPage.ino:30
ledInit
void ledInit()
Definition
LedPage.ino:215
Pages.h
voltageLoop
void voltageLoop()
Definition
VoltagePage.ino:26
userInit
void userInit()
Definition
UserPage.ino:75
voltageInit
void voltageInit()
Definition
VoltagePage.ino:120
ELClientWebServer
Definition
ELClientWebServer.h:118
ELClient
Definition
ELClient.h:78
setup
void setup()
Definition
webserver_controls.ino:45
esp
ELClientWebServer webServer & esp
Definition
webserver_controls.ino:28
Serial
ELClient esp & Serial
Definition
webserver_controls.ino:25
resetCb
void resetCb(void)
Definition
webserver_controls.ino:33
loop
void loop()
Definition
webserver_controls.ino:58
Gbox420_Mega_Main
ELClient
examples
webserver_controls
webserver_controls.ino
Generated by
1.9.8