Skip to content

Commit 31f1e8e

Browse files
committed
Increase NTRIP Client and WiFi connection timeouts
Related to issue #285
1 parent 792cfe0 commit 31f1e8e

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

Firmware/RTK_Surveyor/NtripClient.ino

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static const int MAX_NTRIP_CLIENT_CONNECTION_ATTEMPTS = 3;
4747
static const uint32_t NTRIP_CLIENT_RESPONSE_TIMEOUT = 10 * 1000; //Milliseconds
4848

4949
//NTRIP client receive data timeout
50-
static const uint32_t NTRIP_CLIENT_RECEIVE_DATA_TIMEOUT = 10 * 1000; //Milliseconds
50+
static const uint32_t NTRIP_CLIENT_RECEIVE_DATA_TIMEOUT = 30 * 1000; //Milliseconds
5151

5252
//Most incoming data is around 500 bytes but may be larger
5353
static const int RTCM_DATA_SIZE = 512 * 4;
@@ -317,8 +317,6 @@ void ntripClientUpdate()
317317
if (ntripClientConnectLimitReached())
318318
//Display the WiFi failure
319319
paintNtripWiFiFail(4000, true);
320-
321-
//TODO WiFi not available, give up, disable future attempts
322320
}
323321
}
324322
else

Firmware/RTK_Surveyor/WiFi.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
//----------------------------------------
4646

4747
//If we cannot connect to local wifi, give up/go to Rover
48-
static const int WIFI_CONNECTION_TIMEOUT = 8 * 1000; //Milliseconds
48+
static const int WIFI_CONNECTION_TIMEOUT = 10 * 1000; //Milliseconds
4949

5050
//Interval to use when displaying the IP address
5151
static const int WIFI_IP_ADDRESS_DISPLAY_INTERVAL = 12 * 1000; //Milliseconds
@@ -215,6 +215,8 @@ void wifiStart(char* ssid, char* pw)
215215
{
216216
wifiSetState(WIFI_NOTCONNECTED);
217217

218+
WiFi.mode(WIFI_STA);
219+
218220
#ifdef COMPILE_ESPNOW
219221
if (espnowState > ESPNOW_OFF)
220222
{
@@ -231,8 +233,6 @@ void wifiStart(char* ssid, char* pw)
231233
esp_wifi_set_protocol(WIFI_IF_STA, WIFI_PROTOCOL_11B | WIFI_PROTOCOL_11G | WIFI_PROTOCOL_11N); //Set basic WiFi protocols. Stops WiFi Station.
232234
#endif
233235

234-
WiFi.mode(WIFI_STA);
235-
236236
Serial.printf("WiFi connecting to %s\r\n", ssid);
237237
WiFi.begin(ssid, pw);
238238
wifiTimer = millis();

0 commit comments

Comments
 (0)