mirror of
https://github.com/lumapu/ahoy.git
synced 2025-08-04 00:48:24 +02:00
fix #1049 static IP
This commit is contained in:
parent
6767792601
commit
b67176cbf9
1 changed files with 11 additions and 1 deletions
|
@ -32,7 +32,17 @@ void ahoyeth::setup(settings_t *config, uint32_t *utcTimestamp, OnNetworkCB onNe
|
|||
|
||||
DPRINTLN(DBG_INFO, F("[ETH]: begin..."));
|
||||
Serial.flush();
|
||||
if(mConfig->sys.ip.ip[0] != 0) {
|
||||
IPAddress ip(mConfig->sys.ip.ip);
|
||||
IPAddress mask(mConfig->sys.ip.mask);
|
||||
IPAddress dns1(mConfig->sys.ip.dns1);
|
||||
IPAddress dns2(mConfig->sys.ip.dns2);
|
||||
IPAddress gateway(mConfig->sys.ip.gateway);
|
||||
if(!ETH.config(ip, gateway, mask, dns1, dns2))
|
||||
DPRINTLN(DBG_ERROR, F("failed to set static IP!"));
|
||||
}
|
||||
ETH.begin(ETH_MISO_GPIO, ETH_MOSI_GPIO, ETH_SCK_GPIO, ETH_CS_PIN, ETH_INT_GPIO, ETH_SPI_CLOCK_MHZ, ETH_SPI_HOST);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -240,4 +250,4 @@ void ahoyeth::onEthernetEvent(WiFiEvent_t event, arduino_event_info_t info)
|
|||
|
||||
}
|
||||
|
||||
#endif /* defined(ETHERNET) */
|
||||
#endif /* defined(ETHERNET) */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue