allow configuring dhcp
This commit is contained in:
parent
d628c57f67
commit
4c2020032e
2 changed files with 6 additions and 0 deletions
|
|
@ -1,5 +1,7 @@
|
|||
{
|
||||
"networking": {
|
||||
"mode": "static",
|
||||
"comment": "You can also use dhcp here",
|
||||
"ip": "10.1.0.253",
|
||||
"netmask": "255.255.255.0",
|
||||
"gateway": "10.1.0.1"
|
||||
|
|
|
|||
|
|
@ -78,6 +78,10 @@ void setup()
|
|||
|
||||
ESP32_W5500_onEvent();
|
||||
ETH.begin(MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST);
|
||||
if(configuration["networking"]["mode"] == "static")
|
||||
{
|
||||
ETH.config(ipAddress, gatewayAddress, subnetMask, dnsAddress);
|
||||
}
|
||||
ETH.config(ipAddress, gatewayAddress, subnetMask, dnsAddress);
|
||||
|
||||
server.on(F("/"), handleRoot);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue