Skip to content

Commit c54f9a6

Browse files
committed
Set AP Gateway to 192.168.4.1. Fix small gremlins. Reinstate softApSetIpAddress
1 parent 34d9ad7 commit c54f9a6

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

Firmware/RTK_Everywhere/WiFi.ino

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ void wifiVerifyTables()
12851285
// verbose: Set to true to display additional WiFi debug data
12861286
RTK_WIFI::RTK_WIFI(bool verbose)
12871287
: _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},
1288+
_apGatewayAddress{IPAddress("192.168.4.1")}, _apIpAddress{IPAddress("192.168.4.1")}, _apMacAddress{0, 0, 0, 0, 0, 0},
12891289
_apSubnetMask{IPAddress("255.255.255.0")}, _espNowChannel{0}, _scanRunning{false},
12901290
_staIpAddress{IPAddress((uint32_t)0)}, _staIpType{0}, _staMacAddress{0, 0, 0, 0, 0, 0}, _staRemoteApSsid{nullptr},
12911291
_staRemoteApPassword{nullptr}, _started{false}, _stationChannel{0}, _usingDefaultChannel{true}, _verbose{verbose}
@@ -2715,7 +2715,8 @@ bool RTK_WIFI::stopStart(WIFI_ACTION_t stopping, WIFI_ACTION_t starting)
27152715
}
27162716

27172717
// Stop the DNS server
2718-
if (stopping & _started & WIFI_AP_START_DNS_SERVER)
2718+
// if (stopping & _started & WIFI_AP_START_DNS_SERVER) ???
2719+
if (stopping & WIFI_AP_START_DNS_SERVER)
27192720
{
27202721
if (settings.debugWifiState && _verbose)
27212722
systemPrintf("Calling dnsServer.stop for soft AP\r\n");
@@ -2858,8 +2859,8 @@ bool RTK_WIFI::stopStart(WIFI_ACTION_t stopping, WIFI_ACTION_t starting)
28582859
// Finish the channel selection
28592860
if (starting & WIFI_SELECT_CHANNEL)
28602861
{
2861-
_started = _started | starting & WIFI_SELECT_CHANNEL;
2862-
if (channel & (starting & WIFI_STA_START_SCAN))
2862+
_started = _started | (starting & WIFI_SELECT_CHANNEL);
2863+
if (channel && (starting & WIFI_STA_START_SCAN))
28632864
{
28642865
if (settings.debugWifiState && _verbose)
28652866
systemPrintf("Channel: %d, determined by remote AP scan\r\n", channel);
@@ -2882,12 +2883,12 @@ bool RTK_WIFI::stopStart(WIFI_ACTION_t stopping, WIFI_ACTION_t starting)
28822883
// Set the soft AP subnet mask, IP, gateway, DNS, and first DHCP addresses
28832884
if (starting & WIFI_AP_SET_IP_ADDR)
28842885
{
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-
// }
2886+
if (!softApSetIpAddress(_apIpAddress.toString().c_str(), _apSubnetMask.toString().c_str(),
2887+
_apGatewayAddress.toString().c_str(), _apDnsAddress.toString().c_str(),
2888+
_apFirstDhcpAddress.toString().c_str()))
2889+
{
2890+
break;
2891+
}
28912892
_started = _started | WIFI_AP_SET_IP_ADDR;
28922893
}
28932894

0 commit comments

Comments
 (0)