Arduino: Automatic set advanced network config

when first value of dns or gateway is filled
#268
This commit is contained in:
Florian committed 2018-09-13 22:11:54 +02:00
1 parent cd3a2a0499
commit 5d4c788e20
2 files changed
+10 -5

No files matched your search

+8 -2
View File
@@ -527,8 +527,14 @@ void setup_wifimanager(){
#else // Arduino case
void setup_ethernet() {
Ethernet.begin(mac, ip); //Comment and uncomment the following line if you want to use advanced network config
//Ethernet.begin(mac, ip, Dns, gateway, subnet);
if (gateway[0] != 0 || Dns[0]!=0)
{
trc(F("Advanced ethernet config"));
Ethernet.begin(mac, ip, Dns, gateway, subnet);
}else{
trc(F("Simple ethernet config"));
Ethernet.begin(mac, ip);
}
trc(F("OpenMQTTGateway ip: "));
Serial.println(Ethernet.localIP());
trc(F("Ethernet ok"));