You are using staging server - a separate instance of the ESP Component Registry that allows you to try distribution tools and processes without affecting the real registry.

uploaded 1 year ago
The component offers a console that enables runtime network interface configuration and monitoring.

readme

# Console command ifconfig
The component offers a console that enables runtime network interface configuration and monitoring for any example project.

## API

### Steps to enable console in an example code:
1. Add this component to your project using ```idf.py add-dependency``` command.
2. In the main file of the example, add the following line:
    ```c
    #include "console_ifconfig.h"
    ```
3. Ensure esp-netif is initialized and default event loop is created in your app_main():
    ```c
    ESP_ERROR_CHECK(esp_netif_init());
    ESP_ERROR_CHECK(esp_event_loop_create_default());
    ```
4. In your app_main() function, add the following line as the last line:
    ```c
    console_cmd_init();     // Initialize console
    console_cmd_ifconfig_register();
    console_cmd_start();    // Start console
    ```


## Suported commands:

### Ifconfig:
* **ifconfig help:** Prints the help text for all ifconfig commands
* **ifconfig netif create/destroy \<ethernet handle id>/\<iface>:** Create or destroy a network interface with the specified ethernet handle or interface name
* **ifconfig eth init/deinit/show:** Initialize, deinitialize and display a list of available ethernet handle
* **ifconfig:** Display a list of all esp_netif interfaces along with their information
* **ifconfig \<iface>:** Provide the details of the named interface
* **ifconfig \<iface> default:** Set the specified interface as the default interface
* **ifconfig \<iface> ip6:** Enable IPv6 on the specified interface
* **ifconfig \<iface> up:** Enable the specified interface
* **ifconfig \<iface> down:** Disable the specified interface
* **ifconfig \<iface> link <up/down>:** Enable or disable the link of the specified interface
* **ifconfig \<iface> napt <enable/disable>:** Enable or disable NAPT on the specified interface.
* **ifconfig \<iface> ip <ipv4 addr>:** Set the IPv4 address of the specified interface
* **ifconfig \<iface> mask <ipv4 addr>:** Set the subnet mask of the specified interface
* **ifconfig \<iface> gw <ipv4 addr>:** Set the default gateway of the specified interface
* **ifconfig \<iface> staticip:** Enables static ip
* **ifconfig \<iface> dhcp server <enable/disable>:** Enable or disable the DHCP server.(Note: DHCP server is not supported yet)
* **ifconfig \<iface> dhcp client <enable/disable>:** Enable or disable the DHCP client.

Note: Disabling the DHCP server and client enables the use of static IP configuration.

Links

Supports all targets

License: Custom

To add this component to your project, run:

idf.py add-dependency "espressif/console_cmd_ifconfig^0.0.7"

or download archive

Stats

  • Downloaded in total
    Downloaded in total 14 times
  • Downloaded this version
    This version: 1 time

Badge

espressif/console_cmd_ifconfig version: 0.0.7
|