Skip to content

Commit 03228c2

Browse files
committed
app: Don't start PPP without a request
PPP connection has been opened automatically when AT+CFUN=1 is done and PDN has been activated even without PPP request using AT#XPPP=1. This is now changed so you need to issue AT#XPPP=1 in order to start PPP. This can be done before or after AT+CFUN=1. Jira: SLM-85 Signed-off-by: Tommi Rantanen <tommi.rantanen@nordicsemi.no>
1 parent 3ea1a3c commit 03228c2

5 files changed

Lines changed: 17 additions & 25 deletions

File tree

app/Kconfig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,6 @@ config SM_FULL_FOTA
143143

144144
config SM_PPP
145145
bool "PPP support"
146-
help
147-
When enabled, Serial Modem automatically brings up/down the PPP link
148-
when the LTE link (default PDN) is connected/disconnected,
149-
regardless of what is done with AT#XPPP.
150146

151147
if SM_PPP
152148

app/scripts/sm_start_ppp.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ stty -F $AT_CMUX clocal
5454

5555
echo "Connect and wait for PPP link..."
5656
test -c $AT_CMUX
57+
chat $CHATOPT -t$TIMEOUT "" "AT#XPPP=1" "OK" >$AT_CMUX <$AT_CMUX
5758
chat $CHATOPT -t$TIMEOUT "" "AT+CFUN=1" "OK" "\c" "#XPPP: 1,0" >$AT_CMUX <$AT_CMUX
5859

5960
pppd $PPP_CMUX noauth novj nodeflate nobsdcomp debug noipdefault passive +ipv6 noremoteip \

app/src/sm_ppp.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ static void subscribe_cgev_notifications(void)
476476
}
477477
}
478478

479-
AT_MONITOR(sm_ppp_on_cgev, "CGEV", at_notif_on_cgev);
479+
AT_MONITOR(sm_ppp_on_cgev, "CGEV", at_notif_on_cgev, PAUSED);
480480

481481
static void at_notif_on_cgev(const char *notify)
482482
{
@@ -694,8 +694,10 @@ static int handle_at_ppp(enum at_parser_cmd_type cmd_type, struct at_parser *par
694694
/* Store PPP PDN if given */
695695
at_parser_num_get(parser, 2, &ppp_pdn_cid);
696696
delegate_ppp_event(PPP_START, PPP_REASON_DEFAULT);
697+
at_monitor_resume(&sm_ppp_on_cgev);
697698
} else {
698699
delegate_ppp_event(PPP_STOP, PPP_REASON_DEFAULT);
700+
at_monitor_pause(&sm_ppp_on_cgev);
699701
}
700702
return -SILENT_AT_COMMAND_RET;
701703
}

doc/app/PPP_AT_commands.rst

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ The set command allows you to start and stop PPP, and optionally define the PDN
3131

3232
.. note::
3333

34-
PPP is automatically started and stopped by |SM| when the PDN connection requested for PPP
35-
is established and lost, respectively.
36-
This happens even if PPP has previously been stopped or started with this command.
34+
PPP connection only needs to be started once, and then it is automatically started and stopped by |SM| when the PDN connection requested for PPP is established and lost, respectively.
3735

3836
Syntax
3937
~~~~~~
@@ -77,22 +75,12 @@ PPP with default PDN connection:
7775

7876
::
7977

80-
AT+CFUN=1
81-
82-
OK
83-
84-
// PPP is automatically started when the default PDN is activated.
85-
#XPPP: 1,0,0
86-
87-
// Stop PPP.
88-
AT#XPPP=0
78+
// Start PPP.
79+
AT#XPPP=1
8980

9081
OK
9182

92-
#XPPP: 0,0
93-
94-
// Start PPP.
95-
AT#XPPP=1
83+
AT+CFUN=1
9684

9785
OK
9886

@@ -113,7 +101,7 @@ PPP with default PDN connection:
113101

114102
OK
115103

116-
#XPPP: 0,0
104+
#XPPP: 0,0,0
117105

118106
PPP with non-default PDN connection:
119107

@@ -172,8 +160,8 @@ If you are using CMUX, see :ref:`sm_as_linux_modem` for more information on sett
172160

173161
For the process described here, |SM|'s UARTs must be connected to the Linux host.
174162

175-
1. Get PPP running on |SM|.
176-
To do this, start |SM| and issue an ``AT+CFUN=1`` command.
163+
1. Start PPP with ``AT#XPPP=1`` command.
164+
#. Set modem to online mode with ``AT+CFUN=1`` command.
177165
#. Wait for ``#XPPP: 1,0,0``, which is sent when the network registration succeeds and PPP has started successfully with the default PDN connection.
178166
#. Run the following command on the Linux host:
179167

@@ -184,7 +172,7 @@ For the process described here, |SM|'s UARTs must be connected to the Linux host
184172
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).
185173
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.
186174

187-
#. After the PPP link negotiation has completed successfully, a new network interface will be available, typically ``ppp0``.
175+
#. 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``.
188176
This network interface will allow sending and receiving IP traffic through the modem of the nRF91 Series SiP running |SM|.
189177

190178
.. note::

doc/migration_notes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ The following changes are mandatory to make your application work in the same wa
5555
* Removed the ``AT#XPOLL`` command.
5656
Use ``AT#XAPOLL`` instead.
5757

58+
* PPP connection must be requested with ``AT#XPPP=1`` in order to get it started when modem is put to online mode with ``AT+CFUN=1``.
59+
``AT#XPPP=1`` can be done before or after ``AT+CFUN=1``.
60+
So PPP connection is not started automatically anymore when ``AT+CFUN=1`` is done.
61+
However, ``AT#XPPP=1`` needs to be done only once and after that PPP is started when ``AT+CFUN=1`` is done and stopped when ``AT+CFUN=4`` or ``AT+CFUN=0`` is done.
62+
5863
DTR and RI GPIOs replace Power and Indicate pins
5964
------------------------------------------------
6065

0 commit comments

Comments
 (0)