You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/usb/iot_usbh_modem/README.md
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# IoT USB Modem
2
2
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.
4
4
5
5
**Features Supported:**
6
6
@@ -10,7 +10,7 @@ This component using ESP32-S2, ESP32-S3 series SoC as a USB host to dial-up 4G C
10
10
* Network self-recovery
11
11
* Wi-Fi hotspot
12
12
13
-
**Supported 4G Cat.1 Module:**
13
+
**Supported 4G Cat.1 Module:**
14
14
15
15
| Name | PPP | Secondary AT Port |
16
16
| :-------------: | :-----: | :---------------: |
@@ -25,26 +25,25 @@ This component using ESP32-S2, ESP32-S3 series SoC as a USB host to dial-up 4G C
25
25
26
26
> Secondary AT Port can be used for AT command when main modem port is in ppp network mode
27
27
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.
29
29
30
30
**Other 4G Cat.1 module adaptation methods**
31
31
32
32
1. Confirm whether the 4G module **supports USB Fullspeed mode**;
33
33
2. Confirm whether the 4G module **supports USB PPP dial-up interface**;
34
34
3. Confirm that the **4G SIM card is activated** and the Internet access is turned on;
35
35
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`:
37
37
38
38
* Choose a `User Defined` board:
39
39
```
40
40
Component config → ESP-MODEM → Choose Modem Board → User Defined
41
-
41
+
42
42
```
43
-
* Configure the endpoint address of 4G Modem:
43
+
* Configure the interface number of 4G Modem:
44
44
```
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
48
47
```
49
48
50
49
6. Check outputs log to confirm that the `AT` command can be executed;
`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(ð_cfg, ð_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`
`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(ð_cfg, ð_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`
0 commit comments