I've tried disconnecting ground or power while the module is running, and in some cases it will just stop working. Events (link up and link down) are not always displayed.
Is there any reliable and always working method to make sure that the network module is available?
1 - First thing is to use this function, but i cant use it directly.
Code: Select all
static esp_err_t w5500_verify_id(emac_w5500_t *emac)
{
esp_err_t ret = ESP_OK;
uint8_t version = 0;
ESP_GOTO_ON_ERROR(w5500_read(emac, W5500_REG_VERSIONR, &version, sizeof(version)), err, TAG, "read VERSIONR failed");
// W5500 doesn't have chip ID, we just print the version number instead
ESP_LOGI(TAG, "version=%x", version);
err:
return ret;
}
2 - Second part - i need get IP, and if ip is 0.0.0.0: restart ethernet driver.
3 - And last one. I can ping some server, and if i get fail for 3 or 5 tryes, do full restart.
Pls help me with first 2 parts.