You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// uncomment the following line to get additional compile-time information about how the project gets compiled
17
+
// #define SHOW_COMPILE_TIME_INFORMATION
16
18
17
-
// include version_of_servers.h to include version information
18
-
#include"./servers/version_of_servers.h"
19
-
// include dmesg.hpp which is useful for run-time debugging - for dmesg telnet command
20
-
#include"./servers/dmesg.hpp"
21
19
20
+
// 1. TIME: #define which time settings, wil be used with time_functions.h - will be included later
21
+
// define which 3 NTP servers will be called to get current GMT (time) from
22
+
// this information will be written into /etc/ntp.conf file if file_system.h will be included
23
+
#defineDEFAULT_NTP_SERVER_1 "1.si.pool.ntp.org" // <- replace with your information
24
+
#defineDEFAULT_NTP_SERVER_2 "2.si.pool.ntp.org" // <- replace with your information
25
+
#defineDEFAULT_NTP_SERVER_3 "3.si.pool.ntp.org" // <- replace with your information
26
+
// define time zone to calculate local time from GMT
27
+
#defineTZ "CET-1CEST,M3.5.0,M10.5.0/3" // default: Europe/Ljubljana, or select another (POSIX) time zones: https://github.com/nayarsystems/posix_tz_db/blob/master/zones.csv
22
28
23
-
// 1. TIME LOCALIZATION: #define which time settings, wil be used with time_functions.h - will be included later
24
-
// define which 3 NTP servers will be called to get current GMT (time) from
25
-
// this information will be written into /etc/ntp.conf file if file_system.h will be included
26
-
#defineDEFAULT_NTP_SERVER_1 "1.si.pool.ntp.org" // <- replace with your information
27
-
#defineDEFAULT_NTP_SERVER_2 "2.si.pool.ntp.org" // <- replace with your information
28
-
#defineDEFAULT_NTP_SERVER_3 "3.si.pool.ntp.org" // <- replace with your information
29
-
// define time zone to calculate local time from GMT
30
-
#defineTZ "CET-1CEST,M3.5.0,M10.5.0/3" // default: Europe/Ljubljana, or select another (POSIX) time zones: https://github.com/nayarsystems/posix_tz_db/blob/master/zones.csv
31
29
30
+
// 2. FILE SYSTEM: #define which file system you want to use
31
+
// the file system must correspond to Tools | Partition scheme setting: FILE_SYSTEM_FAT (for FAT partition scheme), FILE_SYSTEM_LITTLEFS (for SPIFFS partition scheme) or FILE_SYSTEM_SD_CARD (if SD card is attached)
32
+
// FAT file system can be bitwise combined with FILE_SYSTEM_SD_CARD, like #define FILE_SYSTEM (FILE_SYSTEM_FAT | FILE_SYSTEM_SD_CARD), LITTLEFS uses less memory
32
33
33
-
// 2. FILE SYSTEM: #define which file system you want to use
34
-
// the file system must correspond to Tools | Partition scheme setting: FILE_SYSTEM_FAT (for FAT partition scheme), FILE_SYSTEM_LITTLEFS (for SPIFFS partition scheme) or FILE_SYSTEM_SD_CARD (if SC card is attached)
35
-
// FAT file system can be bitwise combined with FILE_SYSTEM_SD_CARD, like #define FILE_SYSTEM (FILE_SYSTEM_FAT | FILE_SYSTEM_SD_CARD)
36
-
#defineFILE_SYSTEM FILE_SYSTEM_LITTLEFS // LittleFS uses the least of memory, which may be needed for all the functionalities to run
34
+
#defineFILE_SYSTEM FILE_SYSTEM_LITTLEFS // FILE_SYSTEM_LITTLEFS or FILE_SYSTEM_FAT or FILE_SYSTEM_SD_CARD or FILE_SYSTEM_FAT | FILE_SYSTEM_SD_CARD
37
35
38
36
39
37
// 3. NETWORK: #define how ESP32 will use the network
40
-
// STA(tion)
41
-
// #define how ESP32 will connecto to WiFi router
42
-
// this information will be written into /etc/wpa_supplicant/wpa_supplicant.conf file if file_system.h will be included
43
-
// if these #definitions are missing STAtion will not be set up
44
-
#defineDEFAULT_STA_SSID "YOUR_STA_SSID" // <- replace with your information
45
-
#defineDEFAULT_STA_PASSWORD "YOUR_STA_PASSWORD" // <- replace with your information
46
-
// the use of DHCP or static IP address wil be set in /network/interfaces if fileSystem.hpp is included.
47
-
// The following is information needed for static IP configuration. If these #definitions are missing DHCP is assumed
48
-
// #define DEFAULT_STA_IP "10.18.1.200" // <- replace with your information
49
-
// #define DEFAULT_STA_SUBNET_MASK "255.255.255.0" // <- replace with your information
50
-
// #define DEFAULT_STA_GATEWAY "10.18.1.1" // <- replace with your information
51
-
// #define DEFAULT_STA_DNS_1 "193.189.160.13" // <- replace with your information
52
-
// #define DEFAULT_STA_DNS_2 "193.189.160.23" // <- replace with your information
53
-
54
-
// A(ccess) P(oint)
55
-
// #define how ESP32 will set up its access point
56
-
// this information will be writte into /etc/dhcpcd.conf and /etc/hostapd/hostapd.conf files if file_system.h will be included
57
-
// if these #definitions are missing Access Point will not be set up
58
-
// #define DEFAULT_AP_SSID HOSTNAME // <- replace with your information,
59
-
// #define DEFAULT_AP_PASSWORD "YOUR_AP_PASSWORD" // <- replace with your information, at least 8 characters
60
-
// #define DEFAULT_AP_IP "192.168.0.1" // <- replace with your information
61
-
// #define DEFAULT_AP_SUBNET_MASK "255.255.255.0" // <- replace with your information
62
-
63
-
// define the name Esp32 will use as its host name
64
-
#defineHOSTNAME "MyEsp32Server" // <- replace with your information, max 32 bytes
65
-
66
-
67
-
// power saving
68
-
#definePOVER_SAVING_MODE WIFI_PS_NONE // WIFI_PS_NONE or WIFI_PD_MIN_MODEM or WIFI_PS_MAX_MODEM // please check: https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/network/esp_wifi.html
69
-
70
-
71
-
// replace MACHINETYPE with your information if you want, it is only used in uname telnet command
72
-
#ifCONFIG_IDF_TARGET_ESP32
73
-
#defineMACHINETYPE "ESP32"
74
-
#elifCONFIG_IDF_TARGET_ESP32S2
75
-
#defineMACHINETYPE "ESP32-S2"
76
-
#elifCONFIG_IDF_TARGET_ESP32S3
77
-
#defineMACHINETYPE "ESP32-S3"
78
-
#elifCONFIG_IDF_TARGET_ESP32C3
79
-
#defineMACHINETYPE "ESP32-C3"
80
-
#elifCONFIG_IDF_TARGET_ESP32C6
81
-
#defineMACHINETYPE "ESP32-C6"
82
-
#elifCONFIG_IDF_TARGET_ESP32H2
83
-
#defineMACHINETYPE "ESP32-H2"
84
-
#else
85
-
#defineMACHINETYPE "ESP32 (other)"
86
-
#endif
38
+
// STA(tion)
39
+
// #define how ESP32 will connecto to WiFi router
40
+
// this information will be written into /etc/wpa_supplicant/wpa_supplicant.conf file if file_system.h will be included
41
+
// if these #definitions are missing STAtion will not be set up
42
+
#defineDEFAULT_STA_SSID "YOUR_STA_SSID" // <- replace with your information
43
+
#defineDEFAULT_STA_PASSWORD "YOUR_STA_PASSWORD" // <- replace with your information
44
+
// the use of DHCP or static IP address wil be set in /network/interfaces if file_system.h will be included, the following is information needed for static IP configuration
45
+
// if these #definitions are missing DHCP will be assumed
46
+
// #define DEFAULT_STA_IP "10.18.1.200" // <- replace with your information
47
+
// #define DEFAULT_STA_SUBNET_MASK "255.255.255.0" // <- replace with your information
48
+
// #define DEFAULT_STA_GATEWAY "10.18.1.1" // <- replace with your information
49
+
// #define DEFAULT_STA_DNS_1 "193.189.160.13" // <- replace with your information
50
+
// #define DEFAULT_STA_DNS_2 "193.189.160.23" // <- replace with your information
51
+
52
+
// A(ccess) P(oint)
53
+
// #define how ESP32 will set up its access point
54
+
// this information will be writte into /etc/dhcpcd.conf and /etc/hostapd/hostapd.conf files if file_system.h will be included
55
+
// if these #definitions are missing Access Point will not be set up
56
+
// #define DEFAULT_AP_SSID HOSTNAME // <- replace with your information,
57
+
// #define DEFAULT_AP_PASSWORD "YOUR_AP_PASSWORD" // <- replace with your information, at least 8 characters
58
+
// #define DEFAULT_AP_IP "192.168.0.1" // <- replace with your information
59
+
// #define DEFAULT_AP_SUBNET_MASK "255.255.255.0" // <- replace with your information
60
+
61
+
// power saving
62
+
#definePOVER_SAVING_MODE WIFI_PS_NONE // WIFI_PS_NONE or WIFI_PD_MIN_MODEM or WIFI_PS_MAX_MODEM // please check: https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/network/esp_wifi.html
63
+
64
+
// use mDNS so the servers can be accessed in local network by HOSTNAME, but uses some additional memory
65
+
#defineUSE_mDNS// comment this line out to save some memory and code space
66
+
67
+
// define the name Esp32 will use as its host name, if USE_mDNS is #dfined this is also the name by wich you can address your ESP32 on your local network
68
+
#defineHOSTNAME "MyESP32Server" // <- replace with your information, max 32 bytes (ESP_NETIF_HOSTNAME_MAX_SIZE) - if you are using mDNS make sure host name complies also with mDNS requirements
69
+
// replace MACHINETYPE with your information if you want, it is only used in uname telnet command
70
+
#ifCONFIG_IDF_TARGET_ESP32
71
+
#defineMACHINETYPE "ESP32"
72
+
#elifCONFIG_IDF_TARGET_ESP32S2
73
+
#defineMACHINETYPE "ESP32-S2"
74
+
#elifCONFIG_IDF_TARGET_ESP32S3
75
+
#defineMACHINETYPE "ESP32-S3"
76
+
#elifCONFIG_IDF_TARGET_ESP32C3
77
+
#defineMACHINETYPE "ESP32-C3"
78
+
#elifCONFIG_IDF_TARGET_ESP32C6
79
+
#defineMACHINETYPE "ESP32-C6"
80
+
#elifCONFIG_IDF_TARGET_ESP32H2
81
+
#defineMACHINETYPE "ESP32-H2"
82
+
#else
83
+
#defineMACHINETYPE "ESP32 (other)"
84
+
#endif
87
85
88
86
89
87
// 4. USERS: #define what kind of user management you want before #including user_management.h
90
-
#defineUSER_MANAGEMENTUNIX_LIKE_USER_MANAGEMENT // or HARDCODED_USER_MANAGEMENT or NO_USER_MANAGEMENT
91
-
// if UNIX_LIKE_USER_MANAGEMENT is selected you must also include file_system.h to be able to use /etc/passwd and /etc/shadow files
92
-
#defineDEFAULT_ROOT_PASSWORD "rootpassword" // <- replace with your information if UNIX_LIKE_USER_MANAGEMENT or HARDCODED_USER_MANAGEMENT are used
93
-
#defineDEFAULT_WEBADMIN_PASSWORD "webadminpassword" // <- replace with your information if UNIX_LIKE_USER_MANAGEMENT is used
94
-
#defineDEFAULT_USER_PASSWORD "changeimmediatelly" // <- replace with your information if UNIX_LIKE_USER_MANAGEMENT is used
88
+
#defineUSER_MANAGEMENT UNIX_LIKE_USER_MANAGEMENT // NO_USER_MANAGEMENT or HARDCODED_USER_MANAGEMENT or UNIX_LIKE_USER_MANAGEMENT
89
+
// if UNIX_LIKE_USER_MANAGEMENT is selected you must also include file_system.h to be able to use /etc/passwd and /etc/shadow files
90
+
#defineDEFAULT_ROOT_PASSWORD "rootpassword" // <- replace with your information if UNIX_LIKE_USER_MANAGEMENT or HARDCODED_USER_MANAGEMENT are used
91
+
#defineDEFAULT_WEBADMIN_PASSWORD "webadminpassword" // <- replace with your information if UNIX_LIKE_USER_MANAGEMENT is used
92
+
#defineDEFAULT_USER_PASSWORD "changeimmediatelly" // <- replace with your information if UNIX_LIKE_USER_MANAGEMENT is used
95
93
96
94
97
95
// 5. #include (or comment-out) the functionalities you want (or don't want) to use
98
-
#ifdefFILE_SYSTEM
99
-
#include"./servers/fileSystem.hpp"// most functionalities can run even without a file system if everything is stored in RAM (smaller web pages, ...)
100
-
#endif
101
-
#include"./servers/netwk.h"// fileSystem.hpp is needed prior to #including network.h if you want to store the default parameters
102
-
#include"./servers/time_functions.h"// fileSystem.hpp is needed prior to #including time_functions.h if you want to store the default parameters
103
-
#include"./servers/httpClient.h"// support to access web pages from other servers and curl telnet command
104
-
#ifdefFILE_SYSTEM
105
-
#include"./servers/ftpClient.h"// fileSystem.hpp is needed prior to #including ftpClient.h if you want to store the default parameters
106
-
#endif
107
-
#include"./servers/smtpClient.h"// fileSystem.hpp is needed prior to #including smtpClient.h if you want to store the default parameters
108
-
#include"./servers/userManagement.hpp"// fileSystem.hpp is needed prior to #including userManagement.hpp in case of UNIX_LIKE_USER_MANAGEMENT
109
-
#include"./servers/telnetServer.hpp"// needs almost all the above files for whole functionality, but can also work without them
110
-
#ifdefFILE_SYSTEM
111
-
#include"./servers/ftpServer.hpp"// fileSystem.hpp is also necessary to use ftpServer.h
112
-
#endif
113
-
#ifdefFILE_SYSTEM
114
-
#defineWEB_SESSIONS// comment this line out if you won't use web sessions
115
-
#endif
116
-
#ifdefFILE_SYSTEM
117
-
#defineUSE_I2S_INTERFACE// I2S interface improves web based oscilloscope analog sampling (of a single signal) if ESP32 board has one
118
-
// check #definitions in oscilloscope.h if the signals are inverted
119
-
#include"./servers/oscilloscope.h"// web based oscilloscope: you must #include httpServer.hpp as well to use it
120
-
#endif
121
-
#include"./servers/httpServer.hpp"// fileSystem.hpp is needed prior to #including httpServer.h if you want server also to serve .html and other files from built-in flash disk
96
+
#include"./servers/dmesg.hpp"// include dmesg_functions.h which is useful for run-time debugging - for dmesg telnet command
97
+
#include"./servers/fileSystem.hpp"// most functionalities can run even without a file system if everything is stored in RAM (smaller web pages, ...)
98
+
#include"./servers/time_functions.h"// fileSystem.hpp is needed prior to #including time_functions.h if you want to store the default parameters
99
+
#include"./servers/netwk.h"// fileSystem.hpp is needed prior to #including network.h if you want to store the default parameters
100
+
#include"./servers/httpClient.h"// support to access web pages from other servers and curl telnet command
101
+
#include"./servers/smtpClient.h"// fileSystem.hpp is needed prior to #including smtpClient.h if you want to store the default parameters
102
+
#include"./servers/userManagement.hpp"// fileSystem.hpp is needed prior to #including userManagement.hpp in case of UNIX_LIKE_USER_MANAGEMENT
103
+
#include"./servers/esp32_ping.hpp"// include esp32_ping.hpp to occasioanly ping the router to check if ESP32 is still connected to WiFi
104
+
#include"./servers/version_of_servers.h"// include version_of_servers.h to include version information
105
+
#include"./servers/telnetServer.hpp"// needs almost all the above files for whole functionality, but can also work without them
106
+
#include"./servers/ftpServer.hpp"// fileSystem.hpp is also necessary to use ftpServer.h
107
+
#ifdefFILE_SYSTEM
108
+
#defineUSE_WEB_SESSIONS// comment this line out to save some memory if you won't use web sessions
109
+
#endif
110
+
#ifdefFILE_SYSTEM
111
+
#defineUSE_I2S_INTERFACE// I2S interface improves web based oscilloscope analog sampling (of a single signal) if ESP32 board has one
112
+
// check INVERT_ADC1_GET_RAW and INVERT_I2S_READ #definitions in oscilloscope.h if the signals are inverted
113
+
#include"./servers/oscilloscope.h"// web based oscilloscope: you must #include httpServer.hpp as well to use it
114
+
#endif
115
+
#include"./servers/httpServer.hpp"// fileSystem.hpp is needed prior to #including httpServer.h if you want server also to serve .html and other files from built-in flash disk
0 commit comments