@@ -1283,9 +1283,10 @@ void wifiVerifyTables()
1283
1283
// Constructor
1284
1284
// Inputs:
1285
1285
// verbose: Set to true to display additional WiFi debug data
1286
+ // For AP on RTK Firmware, we set the Gateway to 192.168.4.1, not 0.0.0.0. Let's do the same here.
1286
1287
RTK_WIFI::RTK_WIFI (bool verbose)
1287
1288
: _apChannel{0 }, _apCount{0 }, _apDnsAddress{IPAddress ((uint32_t )0 )}, _apFirstDhcpAddress{IPAddress (" 192.168.4.32" )},
1288
- _apGatewayAddress{( uint32_t ) 0 }, _apIpAddress{IPAddress (" 192.168.4.1" )}, _apMacAddress{0 , 0 , 0 , 0 , 0 , 0 },
1289
+ _apGatewayAddress{IPAddress ( " 192.168.4.1 " ) }, _apIpAddress{IPAddress (" 192.168.4.1" )}, _apMacAddress{0 , 0 , 0 , 0 , 0 , 0 },
1289
1290
_apSubnetMask{IPAddress (" 255.255.255.0" )}, _espNowChannel{0 }, _scanRunning{false },
1290
1291
_staIpAddress{IPAddress ((uint32_t )0 )}, _staIpType{0 }, _staMacAddress{0 , 0 , 0 , 0 , 0 , 0 }, _staRemoteApSsid{nullptr },
1291
1292
_staRemoteApPassword{nullptr }, _started{false }, _stationChannel{0 }, _usingDefaultChannel{true }, _verbose{verbose}
@@ -2715,7 +2716,8 @@ bool RTK_WIFI::stopStart(WIFI_ACTION_t stopping, WIFI_ACTION_t starting)
2715
2716
}
2716
2717
2717
2718
// Stop the DNS server
2718
- if (stopping & _started & WIFI_AP_START_DNS_SERVER)
2719
+ // if (stopping & _started & WIFI_AP_START_DNS_SERVER) ???
2720
+ if (stopping & WIFI_AP_START_DNS_SERVER)
2719
2721
{
2720
2722
if (settings.debugWifiState && _verbose)
2721
2723
systemPrintf (" Calling dnsServer.stop for soft AP\r\n " );
@@ -2858,8 +2860,8 @@ bool RTK_WIFI::stopStart(WIFI_ACTION_t stopping, WIFI_ACTION_t starting)
2858
2860
// Finish the channel selection
2859
2861
if (starting & WIFI_SELECT_CHANNEL)
2860
2862
{
2861
- _started = _started | starting & WIFI_SELECT_CHANNEL;
2862
- if (channel & (starting & WIFI_STA_START_SCAN))
2863
+ _started = _started | ( starting & WIFI_SELECT_CHANNEL) ;
2864
+ if (channel && (starting & WIFI_STA_START_SCAN))
2863
2865
{
2864
2866
if (settings.debugWifiState && _verbose)
2865
2867
systemPrintf (" Channel: %d, determined by remote AP scan\r\n " , channel);
@@ -2882,12 +2884,12 @@ bool RTK_WIFI::stopStart(WIFI_ACTION_t stopping, WIFI_ACTION_t starting)
2882
2884
// Set the soft AP subnet mask, IP, gateway, DNS, and first DHCP addresses
2883
2885
if (starting & WIFI_AP_SET_IP_ADDR)
2884
2886
{
2885
- // if (!softApSetIpAddress(_apIpAddress.toString().c_str(), _apSubnetMask.toString().c_str(),
2886
- // _apGatewayAddress.toString().c_str(), _apDnsAddress.toString().c_str(),
2887
- // _apFirstDhcpAddress.toString().c_str()))
2888
- // {
2889
- // break;
2890
- // }
2887
+ if (!softApSetIpAddress (_apIpAddress.toString ().c_str (), _apSubnetMask.toString ().c_str (),
2888
+ _apGatewayAddress.toString ().c_str (), _apDnsAddress.toString ().c_str (),
2889
+ _apFirstDhcpAddress.toString ().c_str ()))
2890
+ {
2891
+ break ;
2892
+ }
2891
2893
_started = _started | WIFI_AP_SET_IP_ADDR;
2892
2894
}
2893
2895
0 commit comments