-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiotsaDataLogger.ino
72 lines (57 loc) · 1.81 KB
/
iotsaDataLogger.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//
// Boilerplate for configurable web server (probably RESTful) running on ESP8266.
//
// The server always includes the Wifi configuration module. You can enable
// other modules with the preprocessor defines. With the default defines the server
// will allow serving of web pages and other documents, and of uploading those.
//
#include "iotsa.h"
#include "iotsaWifi.h"
// CHANGE: Add application includes and declarations here
#define WITH_NTP // Use network time protocol to synchronize the clock.
#define WITH_RTC // Backup time from an RTC module
#define WITH_OTA // Enable Over The Air updates from ArduinoIDE. Needs at least 1MB flash.
#undef WITH_FILES // Enable static files webserver
#undef WITH_FILESUPLOAD // Enable upload of static files for webserver
#undef WITH_FILESBACKUP // Enable backup of all files including config files and webserver files
IotsaApplication application("Iotsa Data Logger Server");
IotsaWifiMod wifiMod(application);
#ifdef WITH_NTP
#include "iotsaNtp.h"
IotsaNtpMod ntpMod(application);
#endif
#ifdef WITH_RTC
#define PIN_ENA 23
#define PIN_CLK 21
#define PIN_DAT 22
#include "iotsaRtc.h"
IotsaRtcMod rtcMod(application, PIN_ENA, PIN_CLK, PIN_DAT);
#endif
#ifdef WITH_OTA
#include "iotsaOta.h"
IotsaOtaMod otaMod(application);
#endif
#ifdef WITH_FILES
#include "iotsaFiles.h"
IotsaFilesMod filesMod(application);
#endif
#ifdef WITH_FILESUPLOAD
#include "iotsaFilesUpload.h"
IotsaFilesUploadMod filesUploadMod(application);
#endif
#ifdef WITH_FILESBACKUP
#include "iotsaFilesBackup.h"
IotsaFilesBackupMod filesBackupMod(application);
#endif
#include "iotsaDataLogger.h"
IotsaDataLoggerMod iotsaDataLoggerMod(application);
void setup(void){
application.setup();
application.serverSetup();
#ifndef ESP32
ESP.wdtEnable(WDTO_120MS);
#endif
}
void loop(void){
application.loop();
}