Arduino: Automatic set advanced network config
when first value of dns or gateway is filled #268
This commit is contained in:
1 parent
cd3a2a0499
commit
5d4c788e20
2 files changed
+10
-5
No files matched your search
+8
-2
@@ -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"));
|
||||
|
||||
+2
-3
@@ -68,9 +68,8 @@ char mqtt_port[6] = "1883";
|
||||
#endif
|
||||
|
||||
const byte ip[] = { 192, 168, 1, 99 }; //ip adress
|
||||
// Advanced network config (optional) if you want to use these parameters uncomment line 158, 172 and comment line 171 of OpenMQTTGateway.ino
|
||||
const byte gateway[] = { 192, 168, 1, 1 }; //ip adress
|
||||
const byte Dns[] = { 192, 168, 1, 1 }; //ip adress
|
||||
const byte gateway[] = { 0, 0, 0, 0 }; //ip adress, if first value is different from 0 advanced config network will be used and you should fill gateway & dns
|
||||
const byte Dns[] = { 0, 0, 0, 0 }; //ip adress, if first value is different from 0 advanced config network will be used and you should fill gateway & dns
|
||||
const byte subnet[] = { 255, 255, 255, 0 }; //ip adress
|
||||
|
||||
/*-------------DEFINE YOUR OTA PARAMETERS BELOW----------------*/
|
||||
|
||||
Reference in new issue
Block a user