Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions app/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions app/overlay-ppp-without-cmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment thread
MarkusLassila marked this conversation as resolved.
1 change: 1 addition & 0 deletions app/scripts/sm_start_ppp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 3 additions & 1 deletion app/src/sm_ppp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
}
Expand Down
32 changes: 10 additions & 22 deletions doc/app/PPP_AT_commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
~~~~~~
Expand Down Expand Up @@ -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

Expand All @@ -113,7 +102,7 @@ PPP with default PDN connection:

OK

#XPPP: 0,0
#XPPP: 0,0,0

PPP with non-default PDN connection:
Comment thread
MarkusLassila marked this conversation as resolved.

Expand All @@ -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
Expand Down Expand Up @@ -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:

Expand All @@ -184,7 +172,7 @@ For the process described here, |SM|'s UARTs must be connected to the Linux host
Replace ``<PPP_UART_dev>`` by the device file assigned to the PPP UART and ``<baud_rate>`` 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::
Expand Down
6 changes: 6 additions & 0 deletions doc/migration_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
------------------------------------------------

Expand Down