Skip to content

Commit

Permalink
Merge pull request #215 from paulokinho/bugfix/save-dns-static-ip
Browse files Browse the repository at this point in the history
Bugfix/save dns static ip
  • Loading branch information
vitotai authored Jan 30, 2020
2 parents f2a827a + f463ca0 commit 690eb0e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/BrewPiLess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1395,6 +1395,7 @@ class NetworkConfig:public AsyncWebHandler
syscfg->ip = ip;
syscfg->gw = gw;
syscfg->netmask = nm;
syscfg->dns = dns;
theSettings.save();
}else{
WiFiSetup.connect(ssid.c_str(),pass);
Expand Down
4 changes: 2 additions & 2 deletions src/WiFiSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ WiFiSetupClass WiFiSetup;
#endif

#if SerialDebug
#define wifi_info(a) DBG_PRINTF("%s,SSID:%s pass:%s IP:%s, gw:%s\n",(a),WiFi.SSID().c_str(),WiFi.psk().c_str(),WiFi.localIP().toString().c_str(),WiFi.gatewayIP().toString().c_str())
#define wifi_info(a) DBG_PRINTF("%s,SSID:%s pass:%s IP:%s, gw:%s, dns:%s\n",(a),WiFi.SSID().c_str(),WiFi.psk().c_str(),WiFi.localIP().toString().c_str(),WiFi.gatewayIP().toString().c_str(),WiFi.dnsIP().toString().c_str())
#else
#define wifi_info(a)
#endif
Expand Down Expand Up @@ -97,7 +97,7 @@ void WiFiSetupClass::begin(WiFiMode mode, char const *ssid,const char *passwd)

if( mode2use == WIFI_STA || mode2use == WIFI_AP_STA){
if(_ip !=INADDR_NONE){
WiFi.config(_ip,_gw,_nm);
WiFi.config(_ip,_gw,_nm,_dns);
}else{
// the weird printout of "[NO IP]" implies that explicitly specification of DHCP
// might be necessary.
Expand Down

0 comments on commit 690eb0e

Please sign in to comment.