Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info

This section refers to the following sample application(s):

  • 01-join

Table of Contents


Joining a network consists of the following steps:

  • The mote listens for advertisement messages sent by the 
    Include Page
    _def_mgr
    _def_mgr
     or 
    Include Page
    _def_mote
    _def_mote
    s already in the network.
  • Once it hears such an advertisement, in synchronizes to the network, and starts the joining process with the 
    Include Page
    _def_mgr
    _def_mgr
    . Note that this can be done even when the 
    Include Page
    _def_mgr
    _def_mgr
     is multiple hops away from the joining 
    Include Page
    _def_mote
    _def_mote
    .
  • Once the joining process is finished, the 
    Include Page
    _def_mote
    _def_mote
     is Operational. It has been assigned some "base bandwidth" from the 
    Include Page
    _def_mgr
    _def_mgr
    , allowing it to send infrequent traffic to the 
    Include Page
    _def_mgr
    _def_mgr
    .
Tip

Refer to the SmartMesh IP User's Guide for a detailed description of the joining process.

 


The 

Include Page
_def_ocsdk_stack
_def_ocsdk_stack
 sends events to the application to indicate the step of the joining process it is at. The DN_API_LOC_EV_OPERATIONAL event indicates that the 
Include Page
_def_mote
_def_mote
 has successfully joined the network.

...

  • Configure the network identifier of the mote. This parameter is stored in non-volatile memory, so your application does not need to do this step every time this the device boots. In particular, during development, you can set the network identifier through the mset netid CLI command, and reboot the part.
  • Optionally, configure the join duty cycle of the mote to the appropriate trade-off point between joining speed and average power consumption during the searching process.
  • Ask the 
    Include Page
    _def_smip
    _def_smip
     stack to search for a network and join, by calling the dnm_loc_joinCmd() function.
  • Monitor the events received from the the 
    Include Page
    _def_smip
    _def_smip
     stack. The mote is joined when your application receives the DN_API_LOC_EV_OPERATIONAL event.

...

Once the device is joined, the 01-join sample application starts a task which sends a packet to the manager over the wireless network every 10s. You can connect the ApiExplorer application from the 

Include Page
_def_smsdk
_def_smsdk
 to your 
Include Page
_def_mgr
_def_mgr
 and subscribe to data notifications to see the packets being received at the 
Include Page
_def_mgr
_def_mgr
:

Image Modified

Tip

Refer to the following documentation for the

Include Page
_def_smsdk
_def_smsdk
:

You can also use the ApiExplorer application to send arbitrary data to the mote, using the sendData command:

Image Modified

The 01-join sample application prints details about the received data over CLI:

No Format
acketpacket received:
 - sourceAddr: ff020000000000000000000000000002
 - sourcePort: 60000
 - data:       (4 bytes) aabbccdd

Implementation Details

The 01-join sample application uses the Helper Modules to initialize the CLI Module and interaction with the local interface. In particular, it configures the loc_task helper module to join the network and open a socket bound to UDP port 60000.

It uses a single task (sendTask) which:

  • waits for the loc_task helper module to have joined the network (by pending on the joinedSem semaphore);
  • every 10s, send a UDP packet to the IPv6 address of the manager.