Create the Baseline Network#

This section describes how to:

  1. Build and run the example coordinator/sink application.

  2. Build and run the sensor application.

  3. Create the network.

  4. Evaluate baseline energy consumption.

You will need at least two devices connected to a computer running Simplicity Studio.

Build and Run the Coordinator/Sink Application#

  1. In the Simplicity Studio Launcher perspective, select the device to be used as the coordinator/sink.

  2. Start a new project by clicking [Create New Project].

  3. Create the project by selecting the Connect: (SoC) Sink example and completing the steps in the New Project wizard.

  4. Compile (hammer icon) and debug (bug icon) the project. The coordinator application is now installed on the device.

To configure the coordinator, terminal software is necessary to set up the parameters. Use a separate application or the Simplicity Studio's built-in console tool. Issue help in the terminal to see some basic help from the firmware. When the firmware starts, issue form 0 (form a network on channel 0) and pjoin 255 (enable join of nodes for unlimited time) commands:

At this point, the coordinator is up and running, and ready to accept incoming joining requests, so sensor nodes can connect to the sink.

coordinatorcoordinator

Build and Run the Sensor Application#

  1. Return to the Simplicity Studio Launcher perspective and select the device to be used as the sensor.

  2. Start a new project by clicking [Create New Project].

  3. Create the project by selecting the Connect: SoC Sensor example, and completing the steps in the New Project wizard. All the settings can be kept as default. Be sure the settings of the radio configuration of the sink and the sensor match.

  4. Compile and debug/run the application.

Create the Network#

The two most important terminal commands for the sensor are join and join-sleepy. On issuing join, the device attempts to connect to the coordinator and, if the join process is successful, the node becomes part of the network. The device will not try to enter to sleep or idle mode at all, keeping the device awake with relatively high current consumption.

The join-sleepy command enables the device to enter the sleep state. After a successful join process, the device starts sending the sensor data to the sink periodically (with a 1s rate by default).

At this point, a network consisting of a coordinator/sink and one node/sensor should work, the sensor data should be sent by the sensor and received by the sink with 1 s periodicity. More nodes can be added to the network by downloading the sensor firmware into additional devices. The status code of a successful join is 0x90: Network up, and the firmware prints Network up on the console.

end device setupend device setup

The firmware prints numerical status codes on the console, instead of a textual description, if the sensor fails to join the network.

  • 0x40: No ACK received, the node to which a message was transmitted did not respond.

  • 0x41: Indirect MAC timeout, may occur if the sender did not get a poll request to send its pending message.

  • 0x70: Invalid call, usually when an unexpected operation is carried out (for example, joining when joined or sending when not joined, and so on).

  • 0xAB: No valid beacons, the other radio cannot be heard (for example, no antenna attached).

Before each step in the experiment with the sensor/sink examples it is a good practice to issue the leave command on both the coordinator/sink and sensors. For example, the coordinator maintains information about the previously connected nodes, based on their EUI64 ID. The nodes also store information and try to reconnect to the coordinator automatically at power-up based on this information. By issuing the leave command this information will be cleared.

Monitor Baseline Energy Use#

The Energy Profiler is a useful tool to inspect current consumption real-time. For details on using the Energy Profiler see UG343: Multi-Node Energy Profiler User’s Guide.

The following graph shows the consumption of a non-optimized sensor node.

sensor non optimizedsensor non optimized