diff --git a/src/main.cpp b/src/main.cpp index 0d71a41..9a02be3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -155,7 +155,7 @@ void setup() // Default IP as defined in standard https://art-net.org.uk/downloads/art-net.pdf, page 13 IPAddress ip = config.getUInt("ip", DEFAULT_IP); IPAddress subnet = config.getUInt("subnet", DEFAULT_SUBNET); - IPAddress gateway = config.getUInt("gateway", DEFAULT_GATEWAY); + IPAddress gateway = config.getUInt("gateway", NULL); config.end(); diff --git a/src/routes/config.cpp b/src/routes/config.cpp index 2f4e648..85cb4f5 100644 --- a/src/routes/config.cpp +++ b/src/routes/config.cpp @@ -78,7 +78,7 @@ void onGetConfig(AsyncWebServerRequest *request) IPAddress ip = config.getUInt("ip", DEFAULT_IP); IPAddress subnet = config.getUInt("subnet", DEFAULT_SUBNET); - IPAddress gateway = config.getUInt("gateway", DEFAULT_GATEWAY); + IPAddress gateway = config.getUInt("gateway", NULL); JsonDocument doc; doc["connection"] = config.getUInt("connection", DEFAULT_CONNECTION); @@ -87,7 +87,7 @@ void onGetConfig(AsyncWebServerRequest *request) doc["ip-method"] = config.getUInt("ip-method", DEFAULT_IP_METHOD); doc["ip"] = ip.toString(); doc["subnet"] = subnet.toString(); - doc["gateway"] = gateway.toString(); + doc["gateway"] = gateway != NULL ? gateway.toString() : ""; doc["universe-1"] = config.getUInt("universe-1", DEFAULT_UNIVERSE1); doc["direction-1"] = config.getUInt("direction-1", DEFAULT_DIRECTION1); doc["universe-2"] = config.getUInt("universe-2", DEFAULT_UNIVERSE2); diff --git a/src/routes/config.h b/src/routes/config.h index 948f0c3..4e928fa 100644 --- a/src/routes/config.h +++ b/src/routes/config.h @@ -34,7 +34,7 @@ const IpMethod DEFAULT_IP_METHOD = DHCP; extern String DEFAULT_SSID; // initialized in setup because it depends on the mac address const String DEFAULT_PASSWORD = "mbgmbgmbg"; const IPAddress DEFAULT_IP(192, 168, 4, 1); -const IPAddress DEFAULT_SUBNET(255, 0, 0, 0); +const IPAddress DEFAULT_SUBNET(255, 255, 255, 0); const IPAddress DEFAULT_GATEWAY(2, 0, 0, 1); const Direction DEFAULT_DIRECTION1 = Output;