@@ -74,33 +74,11 @@ const byte subnet[] = {255, 255, 255, 0};
7474
7575#if defined(ESP8266 ) || defined(ESP32 ) // for nodemcu, weemos and esp8266
7676//# define ESPWifiManualSetup true //uncomment you don't want to use wifimanager for your credential settings on ESP
77- //# define MQTT_HTTPS_FW_UPDATE //uncomment to enable updating via mqtt message.
7877#else // for arduino boards
7978const byte ip [] = {192 , 168 , 1 , 99 };
8079const byte mac [] = {0xDE , 0xED , 0xBA , 0xFE , 0x54 , 0x95 }; //W5100 ethernet shield mac adress
8180#endif
8281
83- #ifndef NTP_SERVER
84- # define NTP_SERVER "pool.ntp.org"
85- #endif
86-
87- #ifdef MQTT_HTTPS_FW_UPDATE
88- # if defined(ESP8266 ) || defined(ESP32 )
89- //If used, this should be set to the root CA certificate of the server hosting the firmware.
90- // The certificate must be in PEM ascii format
91- const char * https_fw_server_cert PROGMEM = R "EOF("
92- -- -- - BEGIN CERTIFICATE -- -- -
93- ...
94- -- -- - END CERTIFICATE -- -- -
95- ")EOF" ;
96- # ifndef MQTT_HTTPS_FW_UPDATE_USE_PASSWORD
97- # define MQTT_HTTPS_FW_UPDATE_USE_PASSWORD 1 // Set this to 0 if not using TLS connection to MQTT broker to prevent clear text passwords being sent.
98- # endif
99- # else
100- # error "only ESP8266 and ESP32 support MQTT_HTTPS_FW_UPDATE"
101- # endif
102- #endif
103-
10482//#define ESP32_ETHERNET=true // Uncomment to use Ethernet module on OLIMEX ESP32 Ethernet gateway
10583
10684#if defined(ESPWifiManualSetup ) // for nodemcu, weemos and esp8266
@@ -157,9 +135,6 @@ const char* https_fw_server_cert PROGMEM = R"EOF("
157135#ifndef MQTT_PORT
158136# define MQTT_PORT "1883"
159137#endif
160- #ifndef MQTT_SECURE_DEFAULT
161- # define MQTT_SECURE_DEFAULT false
162- #endif
163138
164139#if defined(ESP8266 ) || defined(ESP32 )
165140// The root ca certificate used for validating the MQTT broker
@@ -172,6 +147,51 @@ const char* certificate PROGMEM = R"EOF("
172147
173148# define ATTEMPTS_BEFORE_BG 10 // Number of wifi connection attempts before going to BG protocol
174149# define ATTEMPTS_BEFORE_B 20 // Number of wifi connection attempts before going to B protocol
150+
151+ # ifndef NTP_SERVER
152+ # define NTP_SERVER "pool.ntp.org"
153+ # endif
154+
155+ # ifndef MQTT_SECURE_DEFAULT
156+ # define MQTT_SECURE_DEFAULT false
157+ # endif
158+
159+ //# define MQTT_HTTPS_FW_UPDATE //uncomment to enable updating via mqtt message.
160+
161+ # ifdef MQTT_HTTPS_FW_UPDATE
162+ // If used, this should be set to the root CA certificate of the server hosting the firmware.
163+ // The certificate must be in PEM ascii format.
164+ // The default certificate is for github.
165+ const char * OTAserver_cert PROGMEM = R "EOF("
166+ -- -- - BEGIN CERTIFICATE -- -- -
167+ MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs
168+ MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
169+ d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j
170+ ZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDEL
171+ MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3
172+ LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug
173+ RVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm
174+ +9 S75S0tMqbf5YE /yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTW
175+ PNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG ++ MXs2ziS4wblCJEM
176+ xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB
177+ Ik5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx + mM0aBhakaHPQNAQTXKFx01p8VdteZOE3
178+ hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsg
179+ EsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH /BAQDAgGGMA8GA1UdEwEB /wQF
180+ MAMBAf8wHQYDVR0OBBYEFLE + w2kD + L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaA
181+ FLE + w2kD + L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec
182+ nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe /EW1ntlMMUu4kehDLI6z
183+ eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF
184+ hS9OMPagMRYjyOfiZRYzy78aG6A9 + MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2
185+ Yzi9RKR /5 CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2 /S6cCZdkGCe
186+ vEsXCS + 0 yx5DaMkHJ8HSXPfqIbloEpw8nL + e /IBcm2PN7EeqJSdnoDfzAIJ9VNep
187+ + OkuE6N36B9K
188+ -- -- - END CERTIFICATE -- -- -
189+ ")EOF" ;
190+
191+ # ifndef MQTT_HTTPS_FW_UPDATE_USE_PASSWORD
192+ # define MQTT_HTTPS_FW_UPDATE_USE_PASSWORD 1 // Set this to 0 if not using TLS connection to MQTT broker to prevent clear text passwords being sent.
193+ # endif
194+ # endif
175195#endif
176196
177197/*------------------DEEP SLEEP parameters ------------------*/
0 commit comments