# cellular_modem 4G 模组 **UART PPP 拨号** 组件,面向 ML307C 等 Cat.1 模组,提供联网、事件回调与双 SIM 信息查询。 ## 功能 - PPP 拨号与 `esp_netif` 集成 - 断线重连、SIM 切换事件 - 信号强度、IMEI/ICCID 等模组信息查询 - Kconfig 可配置 UART 引脚与 APN ## 依赖 - ESP-IDF >= 5.0 - `espressif/esp_modem` ## 使用 ```yaml dependencies: kevincoooool/cellular_modem: "^1.0.0" ``` ```c #include "cellular_modem.h" ksdiy_modem_config_t cfg = KSDIY_MODEM_DEFAULT_CONFIG(); cfg.apn = "cmnet"; ksdiy_modem_start(&cfg, my_event_cb, NULL); ``` 在 `menuconfig` → **4G Modem (UART PPP)** 中修改默认 UART 与引脚。 ## 上传注册库 ```bash cd components/cellular_modem compote registry login compote component upload --namespace kevincoooool --name cellular_modem --version 1.0.0 ```
idf.py add-dependency "kevincoooool/ksdiy_cellular_modem^1.0.0"