41
41
#define COMPILE_MQTT_CLIENT // Comment out to remove MQTT Client functionality
42
42
#define COMPILE_OTA_AUTO // Comment out to disable automatic over-the-air firmware update
43
43
#define COMPILE_HTTP_CLIENT // Comment out to disable HTTP Client (PointPerfect ZTP) functionality
44
- #endif // COMPILE_WIFI || COMPILE_ETHERNET
44
+ #endif // COMPILE_WIFI || COMPILE_ETHERNET
45
45
46
46
// Always define ENABLE_DEVELOPER to enable its use in conditional statements
47
47
#ifndef ENABLE_DEVELOPER
68
68
69
69
#define NTRIP_SERVER_MAX 4
70
70
71
- #ifdef COMPILE_NETWORK
72
- #include < NetworkClient.h>
73
- #include < NetworkClientSecure.h>
74
- #include < NetworkUdp.h>
75
- #include < DNSServer.h> // Built-in.
71
+ #ifdef COMPILE_NETWORK
76
72
#include " ESP32OTAPull.h" // http://librarymanager/All#ESP-OTA-Pull Used for getting new firmware from RTK Binaries repo
73
+ #include < DNSServer.h> // Built-in.
77
74
#include < ESPmDNS.h> // Built-in.
78
75
#include < HTTPClient.h> // Built-in. Needed for ThingStream API for ZTP
79
76
#include < MqttClient.h> // http://librarymanager/All#ArduinoMqttClient by Arduino v0.1.8
80
- #endif // COMPILE_NETWORK
77
+ #include < NetworkClient.h>
78
+ #include < NetworkClientSecure.h>
79
+ #include < NetworkUdp.h>
80
+ #endif // COMPILE_NETWORK
81
81
82
- bool RTK_CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC = false ; // Flag used by the special build of libmbedtls (libmbedcrypto) to select external memory
82
+ bool RTK_CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC =
83
+ false ; // Flag used by the special build of libmbedtls (libmbedcrypto) to select external memory
83
84
84
85
volatile bool httpClientModeNeeded = false ; // This is set to true by updateProvisioning
85
86
86
- #define THINGSTREAM_SERVER " api.thingstream.io" // !< the thingstream Rest API server domain
87
- #define THINGSTREAM_ZTPPATH " /ztp/pointperfect/credentials" // !< ZTP rest api
87
+ #define THINGSTREAM_SERVER " api.thingstream.io" // !< the thingstream Rest API server domain
88
+ #define THINGSTREAM_ZTPPATH " /ztp/pointperfect/credentials" // !< ZTP rest api
88
89
static const char THINGSTREAM_ZTPURL[] = " https://" THINGSTREAM_SERVER THINGSTREAM_ZTPPATH; // full ZTP url
89
- const uint16_t HTTPS_PORT = 443 ; // !< The HTTPS default port
90
+ const uint16_t HTTPS_PORT = 443 ; // !< The HTTPS default port
90
91
91
92
#ifdef COMPILE_ETHERNET
92
93
#include < ETH.h>
93
- #endif // COMPILE_ETHERNET
94
+ #endif // COMPILE_ETHERNET
94
95
95
96
#ifdef COMPILE_WIFI
96
- #include " esp_wifi.h" // Needed for esp_wifi_set_protocol()
97
- #include < WiFi.h> // Built-in.
97
+ #include " esp_wifi.h" // Needed for esp_wifi_set_protocol()
98
+ #include < WiFi.h> // Built-in.
98
99
#include < WiFiClientSecure.h> // Built-in.
99
100
#include < WiFiMulti.h> // Built-in.
100
101
#endif // COMPILE_WIFI
@@ -286,11 +287,11 @@ char logFileName[sizeof("SFE_Reference_Station_230101_120101.ubx_plusExtraSpace"
286
287
}
287
288
#endif // COMPILE_WIFI
288
289
289
- #define MQTT_CLIENT_STOP (shutdown ) \
290
- { \
291
- if (settings.debugNetworkLayer || settings.debugMqttClientState ) \
292
- systemPrintf (" mqttClientStop(%s) called by %s %d\r\n " , shutdown ? " true" : " false" , __FILE__, __LINE__); \
293
- mqttClientStop (shutdown); \
290
+ #define MQTT_CLIENT_STOP (shutdown ) \
291
+ { \
292
+ if (settings.debugNetworkLayer || settings.debugMqttClientState ) \
293
+ systemPrintf (" mqttClientStop(%s) called by %s %d\r\n " , shutdown ? " true" : " false" , __FILE__, __LINE__); \
294
+ mqttClientStop (shutdown); \
294
295
}
295
296
296
297
#define OTA_FIRMWARE_JSON_URL_LENGTH 128
@@ -414,8 +415,8 @@ const byte haeNumberOfDecimals = 8; // Used for printing and transmitting lat/
414
415
unsigned long rtcmLastPacketReceived; // Time stamp of RTCM coming in (from BT, NTRIP, etc)
415
416
// Monitors the last time we received RTCM. Proctors PMP vs RTCM prioritization.
416
417
417
- bool usbSerialIncomingRtcm; // Incoming RTCM over the USB serial port
418
- #define RTCM_CORRECTION_INPUT_TIMEOUT (2 * 1000 )
418
+ bool usbSerialIncomingRtcm; // Incoming RTCM over the USB serial port
419
+ #define RTCM_CORRECTION_INPUT_TIMEOUT (2 * 1000 )
419
420
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
420
421
421
422
// GNSS configuration - UM980
@@ -567,7 +568,7 @@ Button *userBtn;
567
568
const uint8_t buttonCheckTaskPriority = 1 ; // 3 being the highest, and 0 being the lowest
568
569
const int buttonTaskStackSize = 2000 ;
569
570
570
- const int shutDownButtonTime = 2000 ; // ms press and hold before shutdown
571
+ const int shutDownButtonTime = 2000 ; // ms press and hold before shutdown
571
572
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
572
573
573
574
// Webserver for serving config page from ESP32 as Acess Point
@@ -576,7 +577,7 @@ const int shutDownButtonTime = 2000; // ms press and hold before shutdown
576
577
// Because the incoming string is longer than max len, there are multiple callbacks so we
577
578
// use a global to combine the incoming
578
579
#define AP_CONFIG_SETTING_SIZE 20000 // 10000 isn't enough if the SD card contains many files
579
- char *settingsCSV; // Push large array onto heap
580
+ char *settingsCSV; // Push large array onto heap
580
581
char *incomingSettings;
581
582
int incomingSettingsSpot;
582
583
unsigned long timeSinceLastIncomingSetting;
@@ -585,23 +586,25 @@ unsigned long lastDynamicDataUpdate;
585
586
#ifdef COMPILE_WIFI
586
587
#ifdef COMPILE_AP
587
588
588
- #include < DNSServer.h> // Needed for the captive portal
589
- #include < WebServer.h> // Port 80
590
- #include < esp_http_server.h> // Needed for web sockets only - on port 81
591
589
#include " form.h"
590
+ #include < DNSServer.h> // Needed for the captive portal
591
+ #include < WebServer.h> // Port 80
592
+ #include < esp_http_server.h> // Needed for web sockets only - on port 81
592
593
593
594
// https://github.com/espressif/arduino-esp32/blob/master/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino
594
595
DNSServer *dnsserver;
595
596
WebServer *webserver;
596
597
597
598
httpd_handle_t *wsserver = nullptr ;
598
- // httpd_req_t *last_ws_req;
599
+ // httpd_req_t *last_ws_req;
599
600
int last_ws_fd;
600
601
601
602
TaskHandle_t updateWebServerTaskHandle;
602
603
const uint8_t updateWebServerTaskPriority = 0 ; // 3 being the highest, and 0 being the lowest
603
- const int updateWebServerTaskStackSize = AP_CONFIG_SETTING_SIZE + 3000 ; // Needs to be large enough to hold the file manager file list
604
- const int updateWebSocketStackSize = AP_CONFIG_SETTING_SIZE + 3000 ; // Needs to be large enough to hold the full settings string
604
+ const int updateWebServerTaskStackSize =
605
+ AP_CONFIG_SETTING_SIZE + 3000 ; // Needs to be large enough to hold the file manager file list
606
+ const int updateWebSocketStackSize =
607
+ AP_CONFIG_SETTING_SIZE + 3000 ; // Needs to be large enough to hold the full settings string
605
608
606
609
#endif // COMPILE_AP
607
610
#endif // COMPILE_WIFI
0 commit comments