From b3b9164352b1fc276f0c1388be5e6c44f16906f2 Mon Sep 17 00:00:00 2001 From: Michal Hanus Date: Mon, 2 Jun 2025 09:46:16 +0200 Subject: final1 --- prilohy/nrfdemo_source/README.rst | 68 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 prilohy/nrfdemo_source/README.rst (limited to 'prilohy/nrfdemo_source/README.rst') diff --git a/prilohy/nrfdemo_source/README.rst b/prilohy/nrfdemo_source/README.rst new file mode 100644 index 0000000..a76ecd4 --- /dev/null +++ b/prilohy/nrfdemo_source/README.rst @@ -0,0 +1,68 @@ + +MQTT: Read and control device over MQTT Protocol +#################################################################################### + +Description +*********** + +This sample application shows how to use the MQTT protocol and library to connect to an MQTT +broker and send data back and forth to another MQTT client to remotely control +the LEDs and monitor the status of buttons on your Stratus board. + +When button 1/ Mode button is pressed on the board, the message “Hello from Conexio Stratus DK” is +published to `CONFIG_MQTT_PUB_TOPIC`, and any client subscribed to this topic will receive this message. + +On the other hand, when the `LEDON` message is sent from another client to the `CONFIG_MQTT_SUB_TOPIC` +topic, the Blue LED on the board is turned ON. When the `LEDOFF` message is sent from another client to the +`CONFIG_MQTT_SUB_TOPIC`` topic, the LED is turned OFF. + + +Building and Running +******************** + +For the Stratus Pro nrf9151/nRF9161 device, the west build command is: + + west build -b conexio_stratus_pro/nrf9161/ns -- -DBOARD_ROOT=/opt/nordic/ncs/v2.7.0/conexio-firmware-sdk + +For the Stratus nRF9160 device, the build command is: + + west build -b conexio_stratus/nrf9160/ns -- -DBOARD_ROOT=/opt/nordic/ncs/v2.7.0/conexio-firmware-sdk + +Flash the compiled firmware using `newtmgr` to the Stratus DK + + newtmgr -c serial image upload build/zephyr/app_update.bin + + +Sample Output +============= + +.. code-block:: console + + *** Booting nRF Connect SDK v3.5.99-ncs1 *** + [00:00:00.250,854] MQTT: Starting MQTT sample on conexio_stratus_pro + [00:00:00.250,885] MQTT: Initializing modem library + [00:00:00.488,494] MQTT: Connecting to LTE network + [00:01:09.398,864] MQTT: RRC mode: Connected + [00:01:11.441,558] MQTT: Network registration status: Connected - roaming + [00:01:11.441,711] MQTT: Connected to LTE network + [00:01:11.696,868] MQTT: IPv4 Address found 91.121.93.94 + [00:01:12.195,983] MQTT: MQTT client connected + [00:01:12.196,014] MQTT: Subscribing to: stratus/sub/topic len 17 + [00:01:12.509,826] MQTT: SUBACK packet id: 1234 + [00:01:16.851,287] MQTT: RRC mode: Idle + [00:01:52.350,280] MQTT: RRC mode: Connected + [00:01:52.467,407] MQTT: MQTT PUBLISH result=0 len=6 + [00:01:52.467,895] MQTT: Received: LEDOFF + [00:01:56.277,648] MQTT: RRC mode: Idle + [00:02:01.310,577] MQTT: RRC mode: Connected + [00:02:01.426,727] MQTT: MQTT PUBLISH result=0 len=5 + [00:02:01.427,185] MQTT: Received: LEDON + [00:02:05.244,934] MQTT: RRC mode: Idle + [00:02:12.820,953] MQTT: RRC mode: Connected + [00:02:12.947,113] MQTT: MQTT PUBLISH result=0 len=6 + [00:02:12.947,570] MQTT: Received: LEDOFF + [00:02:16.627,197] MQTT: RRC mode: Idle + +Credit +=============== +Nordic Semiconductor \ No newline at end of file -- cgit v1.2.3