Skip to content

Commit 2dfa885

Browse files
SeppoTakaloCopilot
andcommitted
doc: Document Zephyr user pipes for AT command access
Add comprehensive documentation for Zephyr cellular modem driver user pipes, which provide AT command access alongside PPP connections. Changes: - Document user pipe concept and availability in sm_cellular_modem.rst - Explain that user pipes (DLC channels 3 and 4) are only available when all CMUX channels are open and PPP is active - Add use cases: eDRX/PSM config, FOTA/DFU, diagnostics, SMS - Document AT+CFUN=4 for temporarily pausing PPP via user pipe - Update sm_ppp_shell sample docs to reference user pipes - Add note about user pipe availability in sample configuration User pipes are a key feature of the nordic,nrf91-sm-v2 driver that enables modem control and maintenance operations while maintaining an active PPP connection. Jira: SM-311 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
1 parent a72923d commit 2dfa885

2 files changed

Lines changed: 89 additions & 2 deletions

File tree

doc/app/sm_cellular_modem.rst

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,54 @@ The controlling chip runs a Zephyr application, which uses Zephyr's native IP st
203203
See :ref:`uart_configuration` for more information.
204204
* System mode is not configured. See the `%XSYSTEMMODE`_ command in the AT command Reference Guide for more details.
205205

206+
User pipes for AT commands
207+
==========================
208+
209+
Zephyr's cellular modem driver provides **user pipes** for sending AT commands to the modem while PPP is active.
210+
User pipes are additional CMUX channels (DLC channels 3 and 4) that the host application can use for modem configuration, DFU/FOTA, or other AT command operations.
211+
212+
User pipe availability
213+
----------------------
214+
215+
User pipes are available only when the modem driver has all CMUX channels open.
216+
This occurs after the following conditions are met:
217+
218+
* CMUX has been started with ``AT+CMUX=0``.
219+
* The network interface is activated with ``net_if_up()``, which opens the CMUX channels, connects to the network, and establishes the PPP connection.
220+
221+
When the network interface is deactivated with ``net_if_down()``, the PPP connection is closed and user pipes become unavailable.
222+
223+
.. important::
224+
225+
User pipes are not available when PPP is closed.
226+
The modem driver is designed so that ``net_if_up()`` opens all CMUX channels, including user pipes, and ``net_if_down()`` closes them.
227+
228+
The DLC channel callback notifies the host application when a user pipe opens or closes.
229+
230+
Use cases for user pipes
231+
------------------------
232+
233+
User pipes allow the host application to send AT commands while maintaining an active PPP connection.
234+
Common use cases include:
235+
236+
* Configuring eDRX and PSM settings (``AT+CEDRXS``, ``AT+CPSMS``).
237+
* Performing modem firmware updates using ``AT#XFOTA`` or DFU commands.
238+
* Querying modem status and diagnostics.
239+
* Managing SMS or other modem features not exposed through the PPP interface.
240+
* Temporarily pausing PPP for maintenance operations.
241+
242+
.. note::
243+
244+
When using the ``nordic,nrf91-sm-v2`` cellular driver, you can temporarily pause the PPP connection by issuing ``AT+CFUN=4`` on a user pipe.
245+
This command puts the modem into flight mode, which causes the cellular modem driver to wait for a network registration URC message.
246+
The PPP connection remains paused until you restore normal operation with ``AT+CFUN=1``, at which point the modem re-registers with the network and the PPP connection resumes.
247+
This is useful for performing maintenance operations that require the modem to be offline temporarily.
248+
206249
Example
207250
=======
208251

209252
The Zephyr modem driver sends ``AT+CMUX=0`` to start the CMUX, then uses DLC channel 1 for AT commands and DLC channel 2 for PPP.
253+
User pipes on DLC channels 3 and 4 become available for host application AT commands once the network interface is up.
210254
The dial script issues ``AT+CGDATA`` on DLC channel 2, which starts PPP on that channel and leaves DLC channel 1 free for AT commands and URCs.
211255

212256
.. figure:: ../images/ppp-zephyr-sequence.svg

doc/samples/sm_ppp_shell.rst

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ The sample provides:
9696
* Network performance testing using zperf.
9797
* DNS resolution support.
9898
* Automatic modem connection management.
99-
* CMUX (GSM 07.10) multiplexing support.
99+
* CMUX (GSM 07.10) multiplexing support with user pipes for AT command access.
100100
* Power management with runtime power saving.
101101

102-
For more information about using the nRF91 Series SiP as a Zephyr-compatible modem, see :ref:`sm_cellular_modem`.
102+
For more information about using the nRF91 Series SiP as a Zephyr-compatible modem, including how to use user pipes for AT commands alongside PPP, see :ref:`sm_cellular_modem`.
103103

104104
Configuration
105105
*************
@@ -121,6 +121,7 @@ The CMUX configuration enables:
121121
* Power save mode that closes CMUX pipes when idle
122122
* 5 second idle timeout before entering power save
123123
* MTU size of 127 bytes for optimal performance
124+
* User pipes on DLC channels 3 and 4 for AT command access (available when the network interface is up)
124125

125126
Building and running
126127
********************
@@ -221,6 +222,47 @@ To run a UDP upload test:
221222
222223
See the `zperf: Network Traffic Generator`_ for more details on using zperf.
223224

225+
Send AT commands through user pipes
226+
===================================
227+
228+
When the network interface is up, you can access the modem's AT command interface through the user pipes on CMUX DLC channels 3 and 4.
229+
By default, the shell sample is configured to use the user pipe on DLC channel 3.
230+
231+
To send an AT command:
232+
233+
.. code-block:: console
234+
235+
uart:~$ modem at AT+CFUN=4
236+
EVENT: L3 [1] IPv4 address del 100.92.136.41
237+
EVENT: L4 [1] disconnected
238+
EVENT: L4 [1] IPv4 connectivity lost
239+
EVENT: L2 [1] interface down
240+
OK
241+
[00:14:52.706,554] <dbg> modem_cellular: modem_cellular_log_state_changed: switch from registered to await PPP dead
242+
[00:14:52.706,738] <dbg> modem_cellular: modem_cellular_log_event: event ppp dead
243+
[00:14:53.095,303] <dbg> modem_cellular: modem_cellular_log_event: event deregistered
244+
[00:14:54.706,661] <dbg> modem_cellular: modem_cellular_log_event: event timeout
245+
[00:14:54.706,720] <dbg> modem_cellular: modem_cellular_log_state_changed: switch from await PPP dead to await registered
246+
[00:14:56.706,792] <dbg> modem_cellular: modem_cellular_log_event: event timeout
247+
uart:~$ modem at AT+CFUN?
248+
+CFUN: 4
249+
OK
250+
uart:~$ modem at AT+CFUN=1
251+
OK
252+
[00:15:16.308,209] <dbg> modem_cellular: modem_cellular_log_event: event deregistered
253+
EVENT: L2 [1] interface up
254+
[00:15:18.072,762] <dbg> modem_cellular: modem_cellular_log_event: event registered
255+
[00:15:18.072,803] <dbg> modem_cellular: modem_cellular_log_state_changed: switch from await registered to run dial script
256+
[00:15:18.072,861] <dbg> modem_cellular: modem_cellular_log_event: event timeout
257+
[00:15:18.100,659] <dbg> modem_cellular: modem_cellular_log_event: event script success
258+
[00:15:18.100,740] <dbg> modem_cellular: modem_cellular_log_state_changed: switch from run dial script to registered
259+
EVENT: L3 [1] IPv6 address add fe80::3330:3539:3831:3936
260+
EVENT: L3 [1] IPv6 neighbor add fe80::5eff:fe00:533a
261+
EVENT: L3 [1] IPv4 address add 100.92.136.41
262+
EVENT: L4 [1] connected
263+
EVENT: L4 [1] IPv4 connectivity available
264+
uart:~$
265+
224266
Shutting down the network interface
225267
===================================
226268

@@ -241,6 +283,7 @@ The sample enables the following key features:
241283
* Network shell (``CONFIG_NET_SHELL``)
242284
* Zperf (``CONFIG_NET_ZPERF``)
243285
* Power management (``CONFIG_PM_DEVICE``)
286+
* AT command shell (``CONFIG_MODEM_AT_SHELL``)
244287

245288
References
246289
**********

0 commit comments

Comments
 (0)