You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/common/customization.md
+63Lines changed: 63 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -424,3 +424,66 @@ The dummy module is now ready to use. It provides the following functionality:
424
424
To test the module, send a `DUMMY_SAMPLE_REQUEST` message to its zbus channel. The module will respond with a `DUMMY_SAMPLE_RESPONSE` containing the incremented counter value.
425
425
426
426
This dummy module serves as a template that you can extend to implement more complex functionality. You can add additional message types, state variables, and processing logic as needed for your specific use case.
427
+
428
+
## Using a different Cloud
429
+
430
+
To connect to a generic MQTT server using the Asset Tracker Template, you can use the example cloud module provided under `examples/modules/cloud`. This module replaces the default nRF Cloud CoAP-based cloud integration with a flexible MQTT client implementation.
431
+
432
+
### Overview
433
+
434
+
-**Location and FOTA**: These features are deactivated when using the example MQTT module because they depend on nRF Cloud CoAP.
435
+
-**FOTA and LOCATION channels**: The MQTT cloud module provides stub channel declarations for FOTA and LOCATION to avoid build errors. You can implement your own FOTA and LOCATION modules based on your chosen cloud service if needed.
436
+
-**MQTT Client default configurations:**
437
+
438
+
-**Broker hostname:** mqtt.nordicsemi.academy
439
+
-**Port:** 8883
440
+
-**TLS:** Yes
441
+
-**Authentication:** Server only
442
+
-**CA:** modules/examples/cloud/creds/ca-cert.pem
443
+
-**Device ID** IMEI
444
+
-**Subscribed topic** imei/att-pub-topic
445
+
-**Publishing toptic** imei/att-sub-topic
446
+
447
+
The default configuration does not require/enable mutual authentication meaning that the device does not authenticate itself to the server.
448
+
That would require a device certificate/private key pair. However, the server is authenticated using the server certificate `ca-cert.pem`located in the module example folder.
449
+
450
+
Configurations for the MQTT stack can be set in the `overlay-mqtt.conf` file and Kconfig options defined in `examples/modules/cloud/Kconfig.cloud_mqtt`.
451
+
452
+
### How to use the MQTT Cloud Example
453
+
454
+
1.**Build and flash with the MQTT overlay**
455
+
456
+
In the template's `app` folder, run:
457
+
458
+
```sh
459
+
west build -p -b thingy91x/nrf9151/ns -- -DEXTRA_CONF_FILE="$(PWD)/../examples/modules/cloud/overlay-mqtt.conf"&& west flash --erase --skip-rebuild
460
+
```
461
+
462
+
2. Observe that the device connects to the broker
463
+
464
+
3.**Test using shell commands**
465
+
466
+
4.**Shell module for testing**
467
+
468
+
The MQTT cloud module includes a shell module/commands for testing cloud publishing much like the default CoAP configuration.
469
+
To implement custom cloud shell commands this module can be used `examples/modules/cloud/cloud_mqtt_shell.c`
470
+
471
+
### **Module State Machine**
472
+
473
+
The cloud MQTT module uses a state machine to manage connection and reconnection logic. Below is a mermaid diagram representing the module's states:
0 commit comments