zephyr/samples/net/cellular_modem
Krzysztof Chruściński 384e940c66 drivers: serial: nrfx_uarte: Deprecate CONFIG_UART_x_NRF_HW_ASYNC
Deprecate mode which is using TIMER+(D)PPI for reliable byte counting.
Recently a new approach is added (CONFIG_UART_NRFX_UARTE_ENHANCED_RX)
which supports reliable byte counting without additional HW resource.
This mode is planned to be the only supported RX path mode.

Enhanced RX has slightly different behavior. There are no partial RX
packets (events with non-zero offset). There is UART_RX_BUF_RELEASED
after each UART_RX_RDY event.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-12-06 12:14:02 +01:00
..
boards drivers: serial: nrfx_uarte: Deprecate CONFIG_UART_x_NRF_HW_ASYNC 2024-12-06 12:14:02 +01:00
server python: Format and sort imports 2024-11-25 10:07:13 +01:00
src samples: net: cellular_modem: fix division by zero in sample_echo_packet 2024-07-10 11:37:44 +02:00
CMakeLists.txt
prj.conf samples: net: cellular_modem: include at shell 2024-06-10 15:12:34 -05:00
README.rst samples: net: cellular_modem: small fixes/improvements 2024-03-04 22:13:14 +01:00
sample.yaml samples, tests: remove usage of space-separated lists 2024-12-04 14:14:53 -05:00

.. zephyr:code-sample:: cellular-modem
   :name: Cellular modem

   Use a cellular modem to communicate with a UDP server.

Overview
********

This sample consists of a simple application which powers on
the modem, brings up the net interface, then sends a packet
with pseudo random data to the endpoint test-endpoint.com,
which is a publicly hosted server which runs the Python
script found in the server folder. DNS is used to look
up the IP of test-endpoint.com.

Notes
*****

This sample uses the devicetree alias ``modem`` to identify
the modem instance to use. The sample also presumes that
the modem driver creates the only PPP network interface.

Setup
*****

Start by setting up the devicetree with the required
devicetree node:

.. code-block:: devicetree

   /dts-v1/;

   / {
           aliases {
                   modem = &modem;
           };
   };

   &usart2 {
           pinctrl-0 = <&usart2_tx_pa2 &usart2_rx_pa3 &usart2_rts_pa1 &usart2_cts_pa0>;
           pinctrl-names = "default";
           current-speed = <115200>;
           hw-flow-control;
           status = "okay";

           modem: modem {
                   compatible = "quectel,bg9x";
                   mdm-power-gpios = <&gpioe 2 GPIO_ACTIVE_HIGH>;
                   mdm-reset-gpios = <&gpioe 3 GPIO_ACTIVE_HIGH>;
                   status = "okay";
           };
   };

Next, the UART API must be specified using ``CONFIG_UART_INTERRUPT_DRIVEN=y`` or
``CONFIG_UART_ASYNC_API=y``. The driver doesn't support UART polling.

Lastly, the APN must be configured using ``CONFIG_MODEM_CELLULAR_APN=""``.