diff --git a/mos.yml b/mos.yml index f15832c..dedefce 100644 --- a/mos.yml +++ b/mos.yml @@ -39,6 +39,7 @@ config_schema: - ["pppos.hexdump_enable", "b", false, {title: "Dump all the data sent over UART to stderr"}] - ["pppos.last_oper", "s", "", {title: "This field is used to store last successfully connected operator"}] - ["pppos.reg_cmd", "s", "CREG", {title: "AT command used for setting and checking network registration. CREG(default), CGREG, CEREG"}] + - ["pppos.cfun_cycle", "b", true, {title: "Set CFUN to 0, then to 1"}] conds: # ESP32 sets LwIP options via sdkconfig, for other platforms use cdefs directly. diff --git a/src/mgos_pppos.c b/src/mgos_pppos.c index 4a53aea..fda1abc 100644 --- a/src/mgos_pppos.c +++ b/src/mgos_pppos.c @@ -673,7 +673,9 @@ static void mgos_pppos_dispatch_once(struct mgos_pppos_data *pd) { add_cmd(pd, mgos_pppos_at_cb, 0, "AT"); add_cmd(pd, NULL, 0, "ATH"); add_cmd(pd, NULL, 0, "ATE0"); - add_cmd(pd, NULL, 0, "AT+CFUN=0"); /* Offline */ + if (mgos_sys_config_get_pppos_cfun_cycle()) { + add_cmd(pd, NULL, 0, "AT+CFUN=0"); /* Offline */ + } if (!pd->baud_ok) { struct mgos_uart_config ucfg; bool need_ifr = true, need_ifc = true;