Skip to content

Commit 9de1fb5

Browse files
committed
Firmware update via WebConfig works. Remove consumer AP_STA.
When a consumer requests NETCONSUMER_WIFI_STA, the bit field looks different from NETCONSUMER_WIFI_AP_STA, at which point the network is shut down (bad). The solution is to remove NETCONSUMER_WIFI_AP_STA and just use a combination of bits _AP and _STA.
1 parent 353fe1f commit 9de1fb5

File tree

4 files changed

+8
-27
lines changed

4 files changed

+8
-27
lines changed

Firmware/RTK_Everywhere/Network.ino

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,25 +1409,14 @@ void networkUpdate()
14091409
// then stop all networks and let the lower code restart the network accordingly
14101410
if (consumerTypes != previousConsumerTypes)
14111411
{
1412-
previousConsumerTypes = networkGetConsumerTypes(); // Update the previous consumer types
1412+
if (settings.debugNetworkLayer)
1413+
systemPrintf("Changing from consumer type 0x%02X to 0x%02X\r\n", previousConsumerTypes, consumerTypes);
14131414

1414-
// if (networkConsumersOnline() > 0 && networkShutdownRequest == false)
1415-
// {
1416-
// // Tell consumers to shut down
1417-
// networkShutdownRequest = true;
1418-
// if (settings.debugNetworkLayer)
1419-
// systemPrintln("Notifying consumers of impending network shutdown");
1420-
// }
1421-
// else
1422-
// {
1423-
// // We're clear to shutdown
1424-
// if (settings.debugNetworkLayer)
1425-
// systemPrintln("Stopping all networks because of consumer type change");
1415+
previousConsumerTypes = networkGetConsumerTypes(); // Update the previous consumer types
14261416

14271417
// Shutdown all networks
14281418
for (int index = 0; index < NETWORK_OFFLINE; index++)
14291419
networkStop(index, settings.debugNetworkLayer);
1430-
// }
14311420

14321421
}
14331422

@@ -1440,8 +1429,7 @@ void networkUpdate()
14401429
// If a consumer is requesting a particular type, it gets priority
14411430

14421431
// Consumer is requesting WiFi specifically
1443-
if ((consumerTypes && (1 << NETCONSUMER_WIFI_STA)) || (consumerTypes && (1 << NETCONSUMER_WIFI_AP)) ||
1444-
(consumerTypes && (1 << NETCONSUMER_WIFI_AP_STA)))
1432+
if ((consumerTypes && (1 << NETCONSUMER_WIFI_STA)) || (consumerTypes && (1 << NETCONSUMER_WIFI_AP)))
14451433
{
14461434
if (settings.debugNetworkLayer)
14471435
systemPrintln("Starting WiFi Specific Network");
@@ -1640,7 +1628,7 @@ uint8_t networkConsumers(uint16_t *consumerTypes)
16401628

16411629
// TODO Make web server over ethernet work here as well
16421630
if (settings.wifiConfigOverAP == true)
1643-
*consumerTypes |= (1 << NETCONSUMER_WIFI_AP_STA); //WebConfig requires both AP and STA (for firmware check)
1631+
*consumerTypes |= ((1 << NETCONSUMER_WIFI_AP) | (1 << NETCONSUMER_WIFI_STA)); //WebConfig requires both AP and STA (for firmware check)
16441632
}
16451633

16461634
// Debug

Firmware/RTK_Everywhere/WiFi.ino

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -523,14 +523,7 @@ bool wifiForceStart()
523523
startWiFiStation = true;
524524
}
525525

526-
// The consumers need both (explicit)
527-
else if (consumerTypes & (1 << NETCONSUMER_WIFI_AP_STA))
528-
{
529-
startWiFiStation = true;
530-
startWiFiAP = true;
531-
}
532-
533-
// The consumers need both (implicit)
526+
// The consumers need both
534527
else if ((consumerTypes & (1 << NETCONSUMER_WIFI_AP)) && (consumerTypes & (1 << NETCONSUMER_WIFI_STA)))
535528
{
536529
startWiFiStation = true;

Firmware/RTK_Everywhere/menuFirmware.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ void otaUpdate()
857857
if (!networkIsConnected(&otaPriority))
858858
otaUpdateStop();
859859
if (settings.debugFirmwareUpdate)
860-
systemPrintln("Firmware update checking SparkFun released firmware version");
860+
systemPrintln("Checking for latest firmware version");
861861

862862
// If we are using auto updates, only update to production firmware, disable release candidates
863863
if (settings.enableAutoFirmwareUpdate)

Firmware/RTK_Everywhere/settings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ enum
556556
NETCONSUMER_NONE = 0, // No consumers
557557
NETCONSUMER_WIFI_STA, // The consumer needs STA
558558
NETCONSUMER_WIFI_AP, // The consumer needs AP
559-
NETCONSUMER_WIFI_AP_STA, // The consumer needs STA and AP
559+
//NETCONSUMER_WIFI_AP_STA, // The consumer needs STA and AP - Don't use. Use combination of STA and AP bits
560560
NETCONSUMER_CELLULAR, // The consumer needs Cellular
561561
NETCONSUMER_ETHERNET, // The consumer needs Ethernet
562562
NETCONSUMER_ANY, // The consumer doesn't care what type of network access is granted

0 commit comments

Comments
 (0)