Trident IoT Zigbee SDK
Loading...
Searching...
No Matches
On/Off Bulb ZED

Theory of Operation

The On/Off Bulb ZED application is a single endpoint, non-sleepy end device light bulb that is capable of receiving on, off, and toggle commands via the On/Off cluster. When an on, off, or toggle command is received, all 3 RGB LEDs will be activated to accordingly. When the the On/Off state changes, an attribute report shall be sent for the On/Off attribute to indicate the new state.

When an identify start command is received, the blue LED will turn on for the duration specified in the command.

Upon first boot up, the device shall begin searching for a network if it is not already part of one. During the network search, 5 attempts will be made to find a network and the blue LED will blink 3 times at the start of each attempt. If a network is not found after 5 attempts, the red LED will turn on solid for 2 seconds. If the device boots up and is already part of a network then the green LED will turn on solid for 2 seconds.

If the device was previously part of a network, the Network Rejoin plugin will be used to attempt to rejoin the network.

This device shows an example of how to implement the tr_zcl_external_attribute_read_cb to use the Trident MFG Tokens for overriding the attribute values for the Basic Cluster MFG Name and Model ID attributes. Additionally, this application shows how to use the Trident APP Tokens to override the attribute value for the Basic Cluster Product Code attribute as well.

By default, builds will be created for the Trident DKNCM11 board and for a custom PCB target when doing a project build. Both configurations are identical to start but this provides a way for users to build their applications for both targets as custom device development begins. This allows easier transition between different PCB targets which can be useful if a user ever wants Trident to help debug issues. Being able to run on the DKNCM11 board will allow Trident support to more quickly reproduce issues and support customers without needing the custom hardware target. To remove either hardware target from the build, simply delete or rename the hal_config_<board>T32CM11C directory. The build system looks for the hal_config directory and builds all of them for the specified chip target (T32CM11C).

ZCL Configuration

Endpoint 1
RoleNon-Sleepy ZED
Profile ID0x0104
Device TypeHA On/Off Light (0x0100)
In Clusters (Client)Identify Cluster (0x0003)
OTA Upgrade Cluster (0x0019)
Remote CLI Cluster (0xFC54)
Out Clusters (Server)Basic Cluster (0x0000)
Identify Cluster (0x0003)
Groups Cluster (0x0004)
Scenes Cluster (0x0005)
On/Off Cluster (0x0006)
Diagnostics Cluster (0x0B05)
Remote CLI Cluster (0xFC54)

Trident Plugins

Enabled PluginsImplemented Callbacks
Bind
Command Line Interface (CLI)
Debug Print
Network Rejointr_network_rejoin_attempt_cb
Primary/Secondary Channel Masks
End Device Keepalive
Basic Server
Groups Server
Identify Client
Identify Servertr_identify_server_identify_start_cb
tr_identify_server_identify_stop_cb
On/Off Server
Over the Air Bootloading Client
Remote CLI Client
Remote CLI Server
Scenes Server
tr_app_init_cb
tr_connection_state_cb
tr_zcl_command_cb
tr_zcl_external_attribute_read_cb

User Interface on the DKNCM11C10

USB-C Interface

Plugging a USB-C cable from a computer into the DKNCM11C10 will enable a COM port to appear on the computer. This can be connected used to open a connection to the CLI that is running on the device.

COM Port Settings
Baud115200
Data Bits8
Stop Bits1
ParityNone
Flow ControlNone

Buttons

ButtonActionDescription
BTN0PressHardware reset
BTN1PressRestart network rejoin backoff algorithm if rejoin is active
BTN1 + BTN2Hold for 5 secondsReset to factory defaults
BTN2PressRestart network rejoin backoff algorithm if rejoin is active

LEDs

LEDBehaviorDescription
GreenOn for 2 secondsDevice reboot and previously joined to a network
GreenBlink 100msWhen network rejoin attempt is made
RedOn for 2 secondsNetwork search attempts exhausted
RedBlinkingFactory reset in progress (hold BTN1+BTN2 for 5 seconds)
BlueOn for identify durationIdentify command received
BlueBlink 3 times x 250msNetwork search attempt started
Red, Green, & BlueOn solidOn command received or toggle command received when LEDs were off

Custom APP Tokens

This project contains an example of how to create custom APP tokens that can be used from the application and can be interacted with externally via elcap. As long as the project_app_tokens.h exists in the project src directory, the application tokens will be added to the project and the APP token definition file needed for interacting with these tokens via elcap will be generated into the build directory. The APP token definition file looks like T32CM11C_app_token_def.json.