diff --git a/app/Kconfig b/app/Kconfig index 4d12f5d0..180279f1 100644 --- a/app/Kconfig +++ b/app/Kconfig @@ -143,10 +143,6 @@ config SM_FULL_FOTA config SM_PPP bool "PPP support" - help - When enabled, Serial Modem automatically brings up/down the PPP link - when the LTE link (default PDN) is connected/disconnected, - regardless of what is done with AT#XPPP. if SM_PPP diff --git a/app/overlay-ppp-without-cmux.conf b/app/overlay-ppp-without-cmux.conf index b5bcec14..118e01c9 100644 --- a/app/overlay-ppp-without-cmux.conf +++ b/app/overlay-ppp-without-cmux.conf @@ -6,3 +6,4 @@ # Enable modem UART backend CONFIG_MODEM_BACKEND_UART=y CONFIG_MODEM_BACKEND_UART_ASYNC=y +CONFIG_MODEM_BACKEND_UART_ASYNC_HWFC=y diff --git a/app/scripts/sm_start_ppp.sh b/app/scripts/sm_start_ppp.sh index 52a02d11..b5408984 100755 --- a/app/scripts/sm_start_ppp.sh +++ b/app/scripts/sm_start_ppp.sh @@ -54,6 +54,7 @@ stty -F $AT_CMUX clocal echo "Connect and wait for PPP link..." test -c $AT_CMUX +chat $CHATOPT -t$TIMEOUT "" "AT#XPPP=1" "OK" >$AT_CMUX <$AT_CMUX chat $CHATOPT -t$TIMEOUT "" "AT+CFUN=1" "OK" "\c" "#XPPP: 1,0" >$AT_CMUX <$AT_CMUX pppd $PPP_CMUX noauth novj nodeflate nobsdcomp debug noipdefault passive +ipv6 noremoteip \ diff --git a/app/src/sm_ppp.c b/app/src/sm_ppp.c index 6d6abdf2..52790965 100644 --- a/app/src/sm_ppp.c +++ b/app/src/sm_ppp.c @@ -476,7 +476,7 @@ static void subscribe_cgev_notifications(void) } } -AT_MONITOR(sm_ppp_on_cgev, "CGEV", at_notif_on_cgev); +AT_MONITOR(sm_ppp_on_cgev, "CGEV", at_notif_on_cgev, PAUSED); static void at_notif_on_cgev(const char *notify) { @@ -694,8 +694,10 @@ static int handle_at_ppp(enum at_parser_cmd_type cmd_type, struct at_parser *par /* Store PPP PDN if given */ at_parser_num_get(parser, 2, &ppp_pdn_cid); delegate_ppp_event(PPP_START, PPP_REASON_DEFAULT); + at_monitor_resume(&sm_ppp_on_cgev); } else { delegate_ppp_event(PPP_STOP, PPP_REASON_DEFAULT); + at_monitor_pause(&sm_ppp_on_cgev); } return -SILENT_AT_COMMAND_RET; } diff --git a/doc/app/PPP_AT_commands.rst b/doc/app/PPP_AT_commands.rst index 1e259ed5..e65a781d 100644 --- a/doc/app/PPP_AT_commands.rst +++ b/doc/app/PPP_AT_commands.rst @@ -31,9 +31,8 @@ The set command allows you to start and stop PPP, and optionally define the PDN .. note:: - PPP is automatically started and stopped by |SM| when the PDN connection requested for PPP - is established and lost, respectively. - This happens even if PPP has previously been stopped or started with this command. + When a PPP start has been issued, the PPP connection is automatically activated and deactivated when the PDN connection requested for PPP is established and lost, respectively. + This will continue until a PPP stop is issued. Syntax ~~~~~~ @@ -77,22 +76,12 @@ PPP with default PDN connection: :: - AT+CFUN=1 - - OK - - // PPP is automatically started when the default PDN is activated. - #XPPP: 1,0,0 - - // Stop PPP. - AT#XPPP=0 + // Start PPP. + AT#XPPP=1 OK - #XPPP: 0,0 - - // Start PPP. - AT#XPPP=1 + AT+CFUN=1 OK @@ -113,7 +102,7 @@ PPP with default PDN connection: OK - #XPPP: 0,0 + #XPPP: 0,0,0 PPP with non-default PDN connection: @@ -125,8 +114,7 @@ PPP with non-default PDN connection: OK - // Start PPP with the created PDN connection. This must be before AT+CFUN=1 command or - // otherwise PPP will be started for the default PDN connection. + // Start PPP with the created PDN connection. AT#XPPP=1,1 OK @@ -172,8 +160,8 @@ If you are using CMUX, see :ref:`sm_as_linux_modem` for more information on sett For the process described here, |SM|'s UARTs must be connected to the Linux host. -1. Get PPP running on |SM|. - To do this, start |SM| and issue an ``AT+CFUN=1`` command. +1. Start PPP with the ``AT#XPPP=1`` command. +#. Set modem to online mode with the ``AT+CFUN=1`` command. #. Wait for ``#XPPP: 1,0,0``, which is sent when the network registration succeeds and PPP has started successfully with the default PDN connection. #. Run the following command on the Linux host: @@ -184,7 +172,7 @@ For the process described here, |SM|'s UARTs must be connected to the Linux host Replace ```` by the device file assigned to the PPP UART and ```` by the baud rate of the UART that PPP is using (which is set in the :file:`overlay-ppp-without-cmux.overlay` file). Typically, when ``uart1`` is assigned to be the PPP UART (in the devicetree overlay), the device file assigned to it is :file:`/dev/ttyACM2` for an nRF9160 DK, and :file:`/dev/ttyACM1` for the other nRF91 Series DKs. -#. After the PPP link negotiation has completed successfully, a new network interface will be available, typically ``ppp0``. +#. After the PPP link negotiation has completed successfully, |SM| will send ``#XPPP: 1,1,0`` notification over UART, and a new network interface will be available, typically ``ppp0``. This network interface will allow sending and receiving IP traffic through the modem of the nRF91 Series SiP running |SM|. .. note:: diff --git a/doc/migration_notes.rst b/doc/migration_notes.rst index 5134b273..c0f97df7 100644 --- a/doc/migration_notes.rst +++ b/doc/migration_notes.rst @@ -57,6 +57,12 @@ The following changes are mandatory to make your application work in the same wa * Removed the ``AT#XPOLL`` command. Use ``AT#XAPOLL`` instead. + * PPP connection must be requested using the ``AT#XPPP=1`` command to get it started when the modem is put into online mode using the ``AT+CFUN=1`` command. + The ``AT#XPPP=1`` command can be run before or after the ``AT+CFUN=1`` command. + So PPP connection is not started automatically anymore when the ``AT+CFUN=1`` command is run. + After the ``AT#XPPP=1`` command is run, the PPP connection is started when the ``AT+CFUN=1`` command is run and stopped when network is lost (for example, with ``AT+CFUN=4`` or ``AT+CFUN=0``). + When the ``AT#XPPP=0`` command is run, the PPP connection is stopped permanently. + DTR and RI GPIOs replace Power and Indicate pins ------------------------------------------------