diff --git a/components/modules/eth.c b/components/modules/eth.c index 284687a5..50e7cbd4 100644 --- a/components/modules/eth.c +++ b/components/modules/eth.c @@ -220,7 +220,7 @@ static int leth_init( lua_State *L ) eth_phy_config_t phy_cfg = ETH_PHY_DEFAULT_CONFIG(); - phy_cfg.phy_addr = opt_checkint_range( L, "addr", -1, 0, 31 ); + phy_cfg.phy_addr = opt_checkint_range( L, "addr", -1, -1, 31 ); phy_cfg.reset_gpio_num = opt_checkint_range( L, "power", -1, -1, GPIO_NUM_MAX-1 ); // optional @@ -240,7 +240,7 @@ static int leth_init( lua_State *L ) esp_netif_config_t netif_cfg = ESP_NETIF_DEFAULT_ETH(); esp_netif_t *new_eth = esp_netif_new(&netif_cfg); - err = esp_eth_set_default_handlers(eth); + err = esp_eth_set_default_handlers(new_eth); if (err != ESP_OK) goto cleanup_netif; diff --git a/docs/modules/wifi.md b/docs/modules/wifi.md index 15be8fed..8eb1e9be 100644 --- a/docs/modules/wifi.md +++ b/docs/modules/wifi.md @@ -186,8 +186,10 @@ wifi.sta.config(station_cfg) ## wifi.sta.connect() Connects to the configured AP in station mode. You will want to call this -on start-up after [`wifi.start()`](#wifistart), and probably also in -response to getting `disconnected` events in order to reconnect. +on start-up after [`wifi.start()`](#wifistart). The system will attempt +to connect until it succeeds or [`wifi.sta.disconnect()`](#wifistadisconnect) +is called. Each failed connect attempt will fire the `disconnected` +event. #### Syntax `wifi.sta.connect()`