Skip to content

Commit fc91fb9

Browse files
committed
docs(iot_eth): add eth relate docs
1 parent 73fc400 commit fc91fb9

File tree

22 files changed

+898
-165
lines changed

22 files changed

+898
-165
lines changed

components/iot_eth/idf_component.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ version: "0.1.0"
22
description: Ethernet driver for USB Ethernet adapter
33
url: https://github.com/espressif/esp-iot-solution/tree/master/components/iot_eth
44
repository: https://github.com/espressif/esp-iot-solution.git
5+
documentation: https://docs.espressif.com/projects/esp-iot-solution/en/latest/solution/4g/iot_eth.html
56
issues: https://github.com/espressif/esp-iot-solution/issues
67
examples:
78
- path: ../../examples/usb/host/usb_rndis_4g_module

components/usb/iot_usbh_modem/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ menu "IoT USB Host Modem"
66

77
config MODEM_TARGET_USER
88
bool "User Defined"
9+
config MODEM_TARGET_NT26
10+
bool "NT26"
911
config MODEM_TARGET_ML302_DNLM
1012
bool "ML302-DNLM/CNLM"
1113
config MODEM_TARGET_AIR724UG_NFM
@@ -46,6 +48,7 @@ menu "IoT USB Host Modem"
4648

4749
config MODEM_TARGET_NAME
4850
string
51+
default "NT26" if MODEM_TARGET_NT26
4952
default "ML302-DNLM/CNLM" if MODEM_TARGET_ML302_DNLM
5053
default "EC600NCNLC-N06" if MODEM_TARGET_EC600N_CNLC_N06
5154
default "AIR780E" if MODEM_TARGET_AIR780_E
@@ -74,6 +77,7 @@ menu "IoT USB Host Modem"
7477

7578
config MODEM_USB_ITF
7679
hex "Modem USB CDC interface"
80+
default 0x03 if MODEM_TARGET_NT26
7781
default 0x00 if MODEM_TARGET_ML302_DNLM
7882
default 0x04 if MODEM_TARGET_EC600N_CNLC_N06
7983
default 0x06 if MODEM_TARGET_MC610_EU

components/usb/iot_usbh_modem/README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# IoT USB Modem
22

3-
This component using ESP32-S2, ESP32-S3 series SoC as a USB host to dial-up 4G Cat.1 through PPP to access the Internet, with the help of ESP32-Sx Wi-Fi softAP function, share the Internet with IoT devices or mobile devices. Realize low-cost "medium-high-speed" Internet access.
3+
This component using ESP32-S2, ESP32-S3, ESP32-P4 series SoC as a USB host to dial-up 4G Cat.1 through PPP to access the Internet, with the help of ESP32-Sx Wi-Fi softAP function, share the Internet with IoT devices or mobile devices. Realize low-cost "medium-high-speed" Internet access.
44

55
**Features Supported:**
66

@@ -10,7 +10,7 @@ This component using ESP32-S2, ESP32-S3 series SoC as a USB host to dial-up 4G C
1010
* Network self-recovery
1111
* Wi-Fi hotspot
1212

13-
**Supported 4G Cat.1 Module:**
13+
**Supported 4G Cat.1 Module:**
1414

1515
| Name | PPP | Secondary AT Port |
1616
| :-------------: | :-----: | :---------------: |
@@ -25,26 +25,25 @@ This component using ESP32-S2, ESP32-S3 series SoC as a USB host to dial-up 4G C
2525

2626
> Secondary AT Port can be used for AT command when main modem port is in ppp network mode
2727
28-
> There are different sub-models of the above modules. The communication stands may be different. For example, LTE-FDD 5(UL)/10(DL), LTE-TDD 1(UL)/8(DL). And endpoint address may different also, if you encounter problems, try modifying parameters using a custom device mode.
28+
> There are different sub-models of the above modules. The communication stands may be different. For example, LTE-FDD 5(UL)/10(DL), LTE-TDD 1(UL)/8(DL). And interface number may different also, if you encounter problems, try modifying parameters using a custom device mode.
2929
3030
**Other 4G Cat.1 module adaptation methods**
3131

3232
1. Confirm whether the 4G module **supports USB Fullspeed mode**;
3333
2. Confirm whether the 4G module **supports USB PPP dial-up interface**;
3434
3. Confirm that the **4G SIM card is activated** and the Internet access is turned on;
3535
4. Confirm that the **necessary signal wires have been connected** in accordance with the hardware wiring;
36-
5. Confirm the module's PPP interface input endpoint (IN) and output endpoint (OUT) addresses, and modify the following options in `menuconfig`:
36+
5. Confirm the module's PPP interface input endpoint (IN) and output endpoint (OUT) addresses, and modify the following options in `menuconfig`:
3737

3838
* Choose a `User Defined` board:
3939
```
4040
Component config → ESP-MODEM → Choose Modem Board → User Defined
41-
41+
4242
```
43-
* Configure the endpoint address of 4G Modem:
43+
* Configure the interface number of 4G Modem:
4444
```
45-
Component config → ESP-MODEM → USB CDC endpoint address config
46-
→ Modem USB CDC IN endpoint address
47-
→ Modem USB CDC OUT endpoint address
45+
Component config → ESP-MODEM → USB CDC interface config
46+
→ Modem USB CDC interface
4847
```
4948

5049
6. Check outputs log to confirm that the `AT` command can be executed;

components/usb/iot_usbh_modem/idf_component.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ targets:
66
description: esp-iot-solution USB Host Modem driver
77
url: https://github.com/espressif/esp-iot-solution
88
repository: https://github.com/espressif/esp-iot-solution.git
9+
documentation: https://docs.espressif.com/projects/esp-iot-solution/en/latest/usb/usb_host/usb_ppp.html
910
issues: https://github.com/espressif/esp-iot-solution/issues
1011
dependencies:
1112
idf: ">=4.4.1"

components/usb/usb_host_rndis/idf_component.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ targets:
44
- esp32s3
55
- esp32p4
66
description: USB Host ETH RNDIS Driver
7+
url: https://github.com/espressif/esp-iot-solution
8+
repository: https://github.com/espressif/esp-iot-solution.git
9+
documentation: https://docs.espressif.com/projects/esp-iot-solution/en/latest/usb/usb_host/usb_rndis.html
10+
issues: https://github.com/espressif/esp-iot-solution/issues
711
dependencies:
812
idf: ">=4.4"
913
espressif/iot_usbh_cdc:

docs/Doxyfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ INPUT = \
4949
$(PROJECT_PATH)/components/display/tools/esp_mmap_assets/include/esp_mmap_assets.h \
5050
$(PROJECT_PATH)/components/display/touch_panel/touch_panel.h \
5151
$(PROJECT_PATH)/components/i2c_bus/include/i2c_bus.h \
52+
$(PROJECT_PATH)/components/iot_eth/include/iot_eth.h \
5253
$(PROJECT_PATH)/components/ir/ir_learn/include/ir_learn.h \
5354
$(PROJECT_PATH)/components/keyboard_button/include/keyboard_button.h \
5455
$(PROJECT_PATH)/components/knob/include/iot_knob.h \
@@ -78,6 +79,7 @@ INPUT = \
7879
$(PROJECT_PATH)/components/usb/usb_device_uvc/include/usb_device_uvc.h \
7980
$(PROJECT_PATH)/components/usb/usb_stream/include/usb_stream.h \
8081
$(PROJECT_PATH)/components/utilities/adc_tp_calibration/include/adc_tp_calibration.h \
82+
$(PROJECT_PATH)/components/usb/usb_host_rndis/include/usb_host_rndis.h \
8183
$(PROJECT_PATH)/components/zero_detection/include/zero_detection.h \
8284

8385
## Get warnings for functions that have no documentation for their parameters or return value

docs/en/solution/4g/index.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
4G Solutions
2+
============
3+
4+
:link_to_translation:`zh_CN:[中文]`
5+
6+
.. toctree::
7+
:maxdepth: 2
8+
9+
IOT Ethernet <iot_eth>

docs/en/solution/4g/iot_eth.rst

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
IOT ETH Ethernet
2+
=================
3+
4+
:link_to_translation:`zh_CN:[中文]`
5+
6+
`iot_eth` provides a complete solution for connecting 4G modules to Ethernet, offering an abstraction layer for the underlying hardware and a default network interface based on LWIP. It also supports user-defined network interfaces.
7+
8+
Features
9+
---------
10+
11+
- Advanced factory mode, supporting various underlying connection methods
12+
- Default support for LWIP network interface, also supports user-defined network interfaces
13+
14+
User Guide
15+
-----------
16+
17+
1. First, initialize the `driver` layer to provide lower-level hardware abstraction
18+
19+
.. code:: c
20+
21+
usb_host_rndis_config_t rndis_cfg = {
22+
.auto_detect = true, // auto detect 4G module
23+
.auto_detect_timeout = pdMS_TO_TICKS(1000), // auto detect timeout
24+
.rx_buffer_size = 1024 * 4, // rx ringbuffer size
25+
.tx_buffer_size = 1024 * 4, // tx ringbuffer size
26+
};
27+
28+
iot_eth_driver_t *rndis_handle = NULL;
29+
esp_err_t ret = iot_eth_new_usb_rndis(&rndis_cfg, &rndis_handle);
30+
if (ret != ESP_OK || rndis_handle == NULL) {
31+
ESP_LOGE(TAG, "Failed to create USB RNDIS driver");
32+
return;
33+
}
34+
35+
2. Initialize the `iot_eth` layer
36+
37+
.. code:: c
38+
39+
iot_eth_config_t eth_cfg = {
40+
.driver = rndis_handle,
41+
.on_lowlevel_init_done = NULL,
42+
.on_lowlevel_deinit = NULL,
43+
.stack_input = NULL,
44+
.user_data = NULL,
45+
};
46+
47+
iot_eth_handle_t eth_handle = NULL;
48+
ret = iot_eth_install(&eth_cfg, &eth_handle);
49+
if (ret != ESP_OK) {
50+
ESP_LOGE(TAG, "Failed to install USB RNDIS driver");
51+
return;
52+
}
53+
54+
3. Start the `iot_eth` layer
55+
56+
.. code:: c
57+
58+
ret = iot_eth_start(eth_handle);
59+
if (ret != ESP_OK) {
60+
ESP_LOGE(TAG, "Failed to start USB RNDIS driver");
61+
return;
62+
}
63+
64+
Using Other Network Interfaces
65+
-------------------------------
66+
67+
1. Transmission: Call `iot_eth_transmit` to send data.
68+
69+
2. Reception: Configure the `stack_input` callback function in `iot_eth_config_t`. This callback is called when data is received.
70+
71+
3. Get the MAC address of the 4G module: Call `iot_eth_get_addr` to retrieve the MAC address.
72+
73+
Supported Network Interfaces
74+
-----------------------------
75+
76+
- USB interface-based RNDIS :doc:`/usb/usb_host/usb_rndis.rst`
77+
78+
- USB interface-based PPP :doc:`/usb/usb_host/usb_ppp.rst`
79+
80+
API Reference
81+
-------------
82+
83+
.. include-build-file:: inc/iot_eth.inc

docs/en/solution/index.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Solutions
2+
=========
3+
4+
:link_to_translation:`zh_CN:[中文]`
5+
6+
.. toctree::
7+
:maxdepth: 2
8+
9+
4G Solutions <4g_solution/index>

docs/en/usb/usb_host/iot_eth.rst

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
IOT ETH Ethernet
2+
===============
3+
4+
:link_to_translation:`zh_CN:[中文]`
5+
6+
`iot_eth` provides a complete solution for connecting 4G modules to Ethernet, offering an abstraction layer for the underlying hardware and a default network interface based on LWIP. It also supports user-defined network interfaces.
7+
8+
Features
9+
--------
10+
11+
- Advanced factory mode, supporting various underlying connection methods
12+
- Default support for LWIP network interface, also supports user-defined network interfaces
13+
14+
User Guide
15+
----------
16+
17+
1. First, initialize the `driver` layer to provide lower-level hardware abstraction
18+
19+
.. code:: c
20+
21+
usb_host_rndis_config_t rndis_cfg = {
22+
.auto_detect = true, // auto detect 4G module
23+
.auto_detect_timeout = pdMS_TO_TICKS(1000), // auto detect timeout
24+
.rx_buffer_size = 1024 * 4, // rx ringbuffer size
25+
.tx_buffer_size = 1024 * 4, // tx ringbuffer size
26+
};
27+
28+
iot_eth_driver_t *rndis_handle = NULL;
29+
esp_err_t ret = iot_eth_new_usb_rndis(&rndis_cfg, &rndis_handle);
30+
if (ret != ESP_OK || rndis_handle == NULL) {
31+
ESP_LOGE(TAG, "Failed to create USB RNDIS driver");
32+
return;
33+
}
34+
35+
2. Initialize the `iot_eth` layer
36+
37+
.. code:: c
38+
39+
iot_eth_config_t eth_cfg = {
40+
.driver = rndis_handle,
41+
.on_lowlevel_init_done = NULL,
42+
.on_lowlevel_deinit = NULL,
43+
.stack_input = NULL,
44+
.user_data = NULL,
45+
};
46+
47+
iot_eth_handle_t eth_handle = NULL;
48+
ret = iot_eth_install(&eth_cfg, &eth_handle);
49+
if (ret != ESP_OK) {
50+
ESP_LOGE(TAG, "Failed to install USB RNDIS driver");
51+
return;
52+
}
53+
54+
3. Start the `iot_eth` layer
55+
56+
.. code:: c
57+
58+
ret = iot_eth_start(eth_handle);
59+
if (ret != ESP_OK) {
60+
ESP_LOGE(TAG, "Failed to start USB RNDIS driver");
61+
return;
62+
}
63+
64+
Using Other Network Interfaces
65+
------------------------------
66+
67+
1. Transmission: Call `iot_eth_transmit` to send data.
68+
69+
2. Reception: Configure the `stack_input` callback function in `iot_eth_config_t`. This callback is called when data is received.
70+
71+
3. Get the MAC address of the 4G module: Call `iot_eth_get_addr` to retrieve the MAC address.
72+
73+
Supported Network Interfaces
74+
----------------------------
75+
76+
- USB interface-based RNDIS :doc:`/usb/usb_host/usb_rndis.rst`
77+
78+
- USB interface-based PPP :doc:`/usb/usb_host/usb_ppp.rst`
79+
80+
API Reference
81+
-------------
82+
83+
.. include-build-file:: inc/iot_eth.inc

0 commit comments

Comments
 (0)