zephyr/samples/net/cellular_modem
Olivier Lalonde afc481ab31 modem_cellular: Add support for the simcom a76xx modem
Add support for the simcom a76xx modem which is similar to the simcom 7080
but has a few key differences. Tested with a simcom A7672SA module but as
there is a single simcom A76XX AT commands manual, the driver should work
with other modems of the series.

Signed-off-by: Olivier Lalonde <o@syskall.com>
2025-05-28 16:37:53 +02:00
..
boards modem: modem_cellular: Configurable MTU for CMUX 2025-03-24 19:33:07 +01:00
server
src modem_cellular: Add support for the simcom a76xx modem 2025-05-28 16:37:53 +02:00
CMakeLists.txt
Kconfig modem_cellular: Add support for the simcom a76xx modem 2025-05-28 16:37:53 +02:00
prj.conf modem_cellular: Add support for the simcom a76xx modem 2025-05-28 16:37:53 +02:00
README.rst modem_cellular: Add support for the simcom a76xx modem 2025-05-28 16:37:53 +02:00
sample.yaml samples: net: cellular_modem: add test for mikroe_lte_iot10_click shield 2025-05-16 17:31:58 +02: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=""``.

Server setup
************

Deploy the server on a publicly accessible host, then set the
:kconfig:option:`CONFIG_SAMPLE_CELLULAR_MODEM_ENDPOINT_HOSTNAME` variable in ``prj.conf`` to the
server's hostname.

.. code-block:: shell

   git clone --depth=1 https://github.com/zephyrproject-rtos/zephyr.git
   cd zephyr/samples/net/cellular_modem/server
   python te.py