Skip to content

Commit e211c5e

Browse files
authored
Merge pull request #388 from LeeLeahy2/no-wifi-new
Compile successfully when comment out COMPILE_WIFI
2 parents b24e775 + 0a7ad7e commit e211c5e

File tree

5 files changed

+20
-10
lines changed

5 files changed

+20
-10
lines changed

Firmware/RTK_Everywhere/Developer.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ void discardTcpServerBytes(RING_BUFFER_OFFSET previousTail, RING_BUFFER_OFFSET n
153153

154154
void menuWiFi() {systemPrintln("**WiFi not compiled**");}
155155
bool wifiConnect(unsigned long timeout) {return false;}
156+
bool wifiConnect(unsigned long timeout, bool useAPSTAMode, bool *wasInAPmode) {return false;}
156157
IPAddress wifiGetGatewayIpAddress() {return IPAddress((uint32_t)0);}
157158
IPAddress wifiGetIpAddress() {return IPAddress((uint32_t)0);}
158159
IPAddress wifiGetSubnetMask() {return IPAddress((uint32_t)0);}
@@ -162,6 +163,7 @@ bool wifiIsConnected() {return false;}
162163
bool wifiIsNeeded() {return false;}
163164
int wifiNetworkCount() {return 0;}
164165
void wifiPrintNetworkInfo() {}
166+
void wifiSetApMode() {}
165167
void wifiStart() {}
166168
void wifiStop() {}
167169
void wifiUpdate() {}

Firmware/RTK_Everywhere/RTK_Everywhere.ino

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
#ifdef COMPILE_WIFI
2929
#define COMPILE_AP // Requires WiFi. Comment out to remove Access Point functionality
3030
#define COMPILE_ESPNOW // Requires WiFi. Comment out to remove ESP-Now functionality.
31-
#define COMPILE_MQTT_CLIENT // Requires WiFi. Comment out to remove MQTT Client functionality
32-
#define COMPILE_OTA_AUTO // Requires WiFi. Comment out to disable automatic over-the-air firmware update
3331
#endif // COMPILE_WIFI
3432

3533
#define COMPILE_L_BAND // Comment out to remove L-Band functionality
@@ -40,6 +38,8 @@
4038

4139
#if defined(COMPILE_WIFI) || defined(COMPILE_ETHERNET)
4240
#define COMPILE_NETWORK
41+
#define COMPILE_MQTT_CLIENT // Requires WiFi. Comment out to remove MQTT Client functionality
42+
#define COMPILE_OTA_AUTO // Requires WiFi. Comment out to disable automatic over-the-air firmware update
4343
#endif // COMPILE_WIFI || COMPILE_ETHERNET
4444

4545
// Always define ENABLE_DEVELOPER to enable its use in conditional statements
@@ -67,21 +67,23 @@
6767

6868
#define NTRIP_SERVER_MAX 4
6969

70+
#ifdef COMPILE_NETWORK
7071
#include <NetworkClient.h>
7172
#include <NetworkClientSecure.h>
7273
#include <NetworkUdp.h>
74+
#include <DNSServer.h> //Built-in.
75+
#include "ESP32OTAPull.h" //http://librarymanager/All#ESP-OTA-Pull Used for getting new firmware from RTK Binaries repo
76+
#include <ESPmDNS.h> //Built-in.
77+
#include <HTTPClient.h> //Built-in. Needed for ThingStream API for ZTP
78+
#include <MqttClient.h> //http://librarymanager/All#ArduinoMqttClient by Arduino v0.1.8
79+
#endif // COMPILE_NETWORK
7380

7481
#ifdef COMPILE_ETHERNET
7582
#include <ETH.h>
7683
#endif // COMPILE_ETHERNET
7784

7885
#ifdef COMPILE_WIFI
79-
#include "ESP32OTAPull.h" //http://librarymanager/All#ESP-OTA-Pull Used for getting new firmware from RTK Binaries repo
8086
#include "esp_wifi.h" //Needed for esp_wifi_set_protocol()
81-
#include <DNSServer.h> //Built-in.
82-
#include <ESPmDNS.h> //Built-in.
83-
#include <HTTPClient.h> //Built-in. Needed for ThingStream API for ZTP
84-
#include <MqttClient.h> //http://librarymanager/All#ArduinoMqttClient by Arduino v0.1.8
8587
#include <WiFi.h> //Built-in.
8688
#include <WiFiClientSecure.h> //Built-in.
8789
#include <WiFiMulti.h> //Built-in.

Firmware/RTK_Everywhere/WiFi.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,12 @@ byte wifiGetStatus()
184184
return WiFi.status();
185185
}
186186

187+
// Set AP mode
188+
void wifiSetApMode()
189+
{
190+
WiFi.mode(WIFI_AP);
191+
}
192+
187193
// Update the state of the WiFi state machine
188194
void wifiSetState(byte newState)
189195
{

Firmware/RTK_Everywhere/menuFirmware.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ void otaUpdate()
595595

596596
// Update failed. If we were in WIFI_AP mode, return to WIFI_AP mode
597597
if (wasInAPmode)
598-
WiFi.mode(WIFI_AP);
598+
wifiSetApMode();
599599

600600
// Update failed. If WiFi was originally off, turn it off again
601601
if (previouslyConnected == false)

Firmware/RTK_Everywhere/settings.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,7 +1986,7 @@ struct struct_tasks
19861986
bool updateWebServerTaskStopRequest = false;
19871987
} task;
19881988

1989-
#ifdef COMPILE_WIFI
1989+
#ifdef COMPILE_NETWORK
19901990
// AWS certificate for PointPerfect API
19911991
static const char *AWS_PUBLIC_CERT = R"=====(
19921992
-----BEGIN CERTIFICATE-----
@@ -2010,5 +2010,5 @@ o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU
20102010
rqXRfboQnoZsG4q5WTP468SQvvG5
20112011
-----END CERTIFICATE-----
20122012
)=====";
2013-
#endif // COMPILE_WIFI
2013+
#endif // COMPILE_NETWORK
20142014
#endif // __SETTINGS_H__

0 commit comments

Comments
 (0)