Info |
---|
This section refers to the following sample application(s):
|
Info |
---|
This application is new to OCSDK 1.2.0 |
A mote needs to send a keep-alive packet to each of its parents every 15s in the absence of a data packet being sent. This places a lower bound on the energy a mote consumes while in the network. Blink replaces the contents of a normal join packet with user data, allowing the mote to stay in low power mode out of the network for long periods (typically hours), and only synchronizing to the network briefly when data is sent.
Because the mote never joins the network, it cannot receive data from the manager while blinking, but the user can switch between blink and proper joining at any time. The mote does synchronize to the network in order to blink, so precise network time is available to the user application after a blink packet is sent, however this synchronization drifts as time passes.
A more detailed explanation of Blink is found in the SmartMesh IP User's Guide.
Note |
---|
To see blink data notifications on the embedded manager (>= 1.4.1) or VManager (>= 1.0.1), a mote must be on the manager's ACL. |
The 01-blink Sample Application
The application requires an active network with the same network ID as the mote. The application will blink a packet every 30s, alternating between packets with and without discovered neighbors.
No Format |
---|
Blink app, ver 1.2.0.1
SmartMeshIP stack, ver 1.4.1.6
Blink packet queued...packet send with status 0
Blink packet queued...packet send with status 0
...
|
If no advertisement is heard within the application's timeout, the application will reset the mote. If the mote hears an advertisement, but cannot get an acknowledgement for the blink packet, then the packet will timeout and a txDone
notification will be generated with an error:
No Format |
---|
Blink packet queued...Blink timed out - resetting
Blink app, ver 1.2.0.1
SmartMeshIP stack, ver 1.4.1.6
...
Blink packet queued...847139 : MAC pdu tout d=1 grId=1 pr=1 jnLk=0 txInfo=0 (0.0
.0) forw=0 asn=8362 tout=2826327 mic=8cfe007e
packet timed out at link layer
...
|
Implementation Details
The 01-blink
sample application uses the Helper Modules to initialize the CLI Module and for interaction with the local interface. It passes JOIN_NO
in the fJoin
flag when initializing the local module in the loc_task_init()
to prevent the local module from attempting to join, since the application will use the blink API instead. It also installs a callback function txDoneNotifCb()
to handle txDone (i.e. the indicated packet has been sent) notifications.
It uses a single task (blinkTask
) which:
- Generates a dummy packet. The same packet data is used for every blink.
- In a while(1) loop, the application pends on the
blinkSem
semaphore with timeout ofBLINK_PERIOD ms.
- If the previous packet failed due to no advertisements being heard in
BLINK_TIMEOUT
ms, the application resets the mote. If the blink operation succeeded (or this is the first attempt), the application queues a blink packet using thednm_loc_blinkPayload()
command. - Loops indefinitely, alternating between packets containing neighbors, and packets without neighbors.