Skip to content

Commit 01eb468

Browse files
committed
Merge branch 'feat/4g_ppp_support_p4_wifi' into 'master'
feat(4g_ppp): esp32p4 support create AP with c6 See merge request ae_group/esp-iot-solution!1285
2 parents 700fc42 + d13d849 commit 01eb468

File tree

12 files changed

+42
-22
lines changed

12 files changed

+42
-22
lines changed

components/usb/iot_usbh_cdc/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# ChangeLog
22

3+
## v1.1.0 - 2025-05-13
4+
5+
### Features:
6+
7+
* Skip open usb hub device.
8+
39
## v1.1.0 - 2025-04-21
410

511
### Features:

components/usb/iot_usbh_cdc/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "1.1.0"
1+
version: "1.1.1"
22
targets:
33
- esp32s2
44
- esp32s3

components/usb/iot_usbh_cdc/iot_usbh_cdc.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,16 +233,22 @@ static void usb_event_cb(const usb_host_client_event_msg_t *event_msg, void *arg
233233
}
234234
assert(current_device);
235235

236+
const usb_device_desc_t *device_desc;
237+
ESP_ERROR_CHECK(usb_host_get_device_descriptor(current_device, &device_desc));
238+
239+
if (device_desc->bDeviceClass == USB_CLASS_HUB) {
240+
ESP_LOGI(TAG, "Detect hub device, skip");
241+
usb_host_device_close(p_usbh_cdc_obj->cdc_client_hdl, current_device);
242+
return;
243+
}
244+
236245
new_dev_cb_t *new_dev_cb;
237246
SLIST_FOREACH(new_dev_cb, &p_usbh_cdc_obj->new_dev_cb_list, list_entry) {
238247
if (new_dev_cb->cb) {
239248
new_dev_cb->cb(current_device, new_dev_cb->user_data);
240249
}
241250
}
242251

243-
const usb_device_desc_t *device_desc;
244-
ESP_ERROR_CHECK(usb_host_get_device_descriptor(current_device, &device_desc));
245-
246252
usbh_cdc_t *cdc;
247253
bool if_opened = false;
248254
SLIST_FOREACH(cdc, &p_usbh_cdc_obj->cdc_devices_list, list_entry) {
@@ -707,6 +713,12 @@ static esp_err_t _cdc_find_and_open_usb_device(usbh_cdc_t *cdc)
707713
const usb_device_desc_t *device_desc;
708714
ESP_ERROR_CHECK(usb_host_get_device_descriptor(current_device, &device_desc));
709715

716+
if (device_desc->bDeviceClass == USB_CLASS_HUB) {
717+
ESP_LOGD(TAG, "Detect hub device, skip");
718+
usb_host_device_close(p_usbh_cdc_obj->cdc_client_hdl, current_device);
719+
continue;
720+
}
721+
710722
if ((cdc->vid == device_desc->idVendor || cdc->vid == CDC_HOST_ANY_VID) &&
711723
(cdc->pid == device_desc->idProduct || cdc->pid == CDC_HOST_ANY_PID)) {
712724
// Return path 2:

docs/en/usb/usb_host/usb_ppp.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ The following table lists the supported 4G module models. They can be configured
3333
+=================+
3434
| ML302-DNLM/CNLM |
3535
+-----------------+
36+
| NT26 |
37+
+-----------------+
3638
| EC600NCNLC-N06 |
3739
+-----------------+
3840
| AIR780E |

docs/zh_CN/usb/usb_host/usb_ppp.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ PPP 是一种网络中最为基础的协议。PPP 协议(Point-to-Point Protoc
3333
+=================+
3434
| ML302-DNLM/CNLM |
3535
+-----------------+
36+
| NT26 |
37+
+-----------------+
3638
| EC600NCNLC-N06 |
3739
+-----------------+
3840
| AIR780E |

examples/usb/host/usb_cdc_4g_module/README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
This example demonstrates the **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.It is also equipped with a router management interface, which allows you to configure the router online and view the information of connected devices.
66

7-
In addition, the **ESP32-P4** supports the 4G Cat.4 module (EC20) with faster speeds, but it currently only supports internet access for itself.
7+
In addition, the **ESP32-P4** supports the 4G Cat.4 module (EC20) with faster speeds. It can also enable hotspot sharing by connecting an external ESP32 chip with Wi-Fi capability.
88

99
**Features Supported:**
1010

@@ -236,7 +236,3 @@ Enable the `4G Modem Configuration -> Dump system task status` option in `menuco
236236
237237
> **4G Cat.1 theoretical peak download rate is 10 Mbps, peak upload rate is 5 Mbps**
238238
> The actual communication rate is affected by the operator's network, test software, Wi-Fi interference, and the number of terminal connections, etc.
239-
240-
## Known Issues
241-
242-
* ESP32-P4 currently does not support enabling the softAP function via `esp_wifi_remote`.

examples/usb/host/usb_cdc_4g_module/README_cn.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
该示例程序可实现 **ESP32-S2****ESP32-S3** 系列 SoC 作为 USB 主机驱动 4G Cat.1 模组 PPP 拨号上网,同时可开启 ESP32-SX Wi-Fi AP 功能,分享互联网给物联网设备或手持设备,实现低成本 “中高速” 互联网接入。同时配有路由器管理界面,可以在线进行路由器配置和查看已连接设备信息。
66

7-
此外对于 **ESP32-P4** 支持了 4G Cat.4 模组(EC20),速率更快,暂时仅支持自身上网功能
7+
此外对于 **ESP32-P4** 支持了 4G Cat.4 模组(EC20),速率更快。并可通过外挂 ESP32 带 Wi-Fi 版本芯片实现热点共享
88

99
**已实现功能:**
1010

@@ -231,14 +231,10 @@ I (13855) 4g_router_server: Starting webserver
231231
232232
**测试结果:**
233233
234-
| 测试项 | 峰值 | 平均 |
235-
| :----: | :------: | :------: |
236-
| 下载 | 6.4 Mbps | 4 Mbps |
237-
| 上传 | 5 Mbps | 2 Mbps |
234+
| 测试项 | 峰值 | 平均 |
235+
| :----: | :------: | :----: |
236+
| 下载 | 6.4 Mbps | 4 Mbps |
237+
| 上传 | 5 Mbps | 2 Mbps |
238238
239239
> **4G Cat.1 理论峰值下载速率 10 Mbps,峰值上传速率 5 Mbps**
240240
> 实际通信速率受运营商网络、测试软件、Wi-Fi 干扰情况、终端连接数影响,以实际使用为准
241-
242-
## 已知问题
243-
244-
* ESP32-P4 暂不支持通过 esp_wifi_remote 开启 softAP 功能。

examples/usb/host/usb_cdc_4g_module/main/Kconfig.projbuild

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,14 @@ menu "4G Modem Example Config"
8787

8888
config EXAMPLE_LED_RED_SYSTEM_GPIO
8989
int "System status led (red) gpio, set 0 if not use"
90+
default 21 if IDF_TARGET_ESP32P4
9091
default 15
9192
config EXAMPLE_LED_BLUE_WIFI_GPIO
9293
int "Wi-Fi status led (blue) gpio, set 0 if not use"
94+
default 22 if IDF_TARGET_ESP32P4
9395
default 17
9496
config EXAMPLE_LED_GREEN_4GMODEM_GPIO
9597
int "Modem status led (green) gpio, set 0 if not use"
98+
default 26 if IDF_TARGET_ESP32P4
9699
default 16
97100
endmenu

examples/usb/host/usb_cdc_4g_module/main/app_main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,9 @@ void app_main(void)
248248
modem_http_init(&s_modem_wifi_config);
249249
#endif
250250

251-
#if !CONFIG_IDF_TARGET_ESP32P4
252251
esp_netif_t *ap_netif = modem_wifi_ap_init();
253252
assert(ap_netif != NULL);
254253
ESP_ERROR_CHECK(modem_wifi_set(&s_modem_wifi_config));
255-
#endif
256254

257255
#ifdef CONFIG_EXAMPLE_PING_NETWORK
258256
ip_addr_t target_addr;

examples/usb/host/usb_cdc_4g_module/main/idf_component.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ dependencies:
88
iot_usbh_modem:
99
version: "^1.1.0"
1010
override_path: "../../../../../components/usb/iot_usbh_modem"
11+
espressif/esp_wifi_remote:
12+
version: "^0.9.0"
13+
rules:
14+
- if: "target in [esp32p4]"
1115
espressif/esp32_s3_usb_otg:
1216
version: "^1.5.1"
1317
rules:

0 commit comments

Comments
 (0)