Skip to content

Commit

Permalink
Use static dns when connecting to wifi if static ip is being used
Browse files Browse the repository at this point in the history
  • Loading branch information
Paulo Nascimento committed Jan 24, 2020
1 parent 2babe03 commit f463ca0
Showing 1 changed file with 2 additions and 2 deletions.
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 f463ca0

Please sign in to comment.