Table of Contents
- How does the demo application work
- Customizing and extending the demo application
- Limitations of embeNET demo application
This document describes the internals of the embeNET demo application running on RC-CC1312R-868 modules and provides information on how to modify and extend the demo.
The demo application uses the embeNET Node C API library to join the network and run two network services:
- ENMS: embeNET Network Management service that allows to gather information about the network operation from the nodes
- custom exemplary service, that sends out a simple message every 5 seconds and also reacts to some simple messages
For simplicity, the demo is prepared without using any operating system. It uses TI's NoRTOS framework module.
You will find several places in the code using printf that print out diagnostic messages. The SmartRF06 has one UARTs routed to COM port when the board gets connected to a PC. In root node this port is used for communication with the border router application running on PC. This means that for root node there is no easy way of printing the log output and so this output is not enabled. By default the log through this UART is only configured in nodes (when IS_ROOT=0).
First we initialize the board and its basic peripherals:
Next we configure UART2 for logging (but only for nodes, as the root uses it to communicate with host). Then we start the NoRTOS framework:
Next the embeNET stack is initialized:
After that the ENMS service is initialized:
In case of root we just start it:
In case of nodes we start the custom demo service and MQTT-SN service:
In order to join the network the node has to setup the required network configuration:
The application's main loop consists of a call to:
- embeNET Node processing function
- MQTT-SN service process (only needed for polling button status)
Once the node joins the network an event callback will be called. In our demo application this callback simply starts the network services:
In case when node gets disconnected from the network, another callback is called. In our demo application this callback stops the network services:
In cases when the embeNET stack detects a critical condition, the following handler is called by the stack, giving a chance to react:
The structure of the firmware project is mostly generated by Code Composer IDE. This allows you to easily customize the peripherals for your demo project as needed.
>The only requirement is NOT to change configuration of peripherals used by the port implementation, i.e. RADIO, CRYP, TIM2.
The best starting point is to look at implementation of the existing custom_service.
In order to disable the "zero rule", delete the rule with
"uid": 0, from your config.json file, and add appropriate rules for your nodes, for example:
This will allow only nodes with uid = 2 and 3, to join the network, provided that their PSKs match those from config.json file.
You may specify the name of desired network interface in .json file, by adding on root level:
The demo version of the embeNET stack allows to connect up to 10 nodes only, with network depth of max. 3 hops.
Generated on Mon Dec 4 2023 14:00:20 for Getting started with embeNET demo for RC-CC1312R-868 module from RadioControlli using SmartRF06 board by 1.9.8