Jump to content

Component: Zigbee (ESP32-C6/H2) (ESP32-C6-H2) (Wireless)

From Flowcode Help
Revision as of 14:37, 13 July 2026 by SteveT (talk | contribs) (Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder"")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Author Matrix TSL
Version 1.0
Category Wireless


Zigbee (ESP32-C6/H2) component

Zigbee component project for ESP32-C6 and ESP32-H2 devices.

Detailed description

No detailed description exists yet for this component

Examples

No additional examples


Macro reference

BytesAvailable

BytesAvailable
Returns number of bytes waiting in RX buffer. Applicable to: Coordinator, Router, End Device. 
- UINT Return


GetChannel

GetChannel
Returns currently active Zigbee channel. Applicable to: Coordinator, Router, End Device. 
- BYTE Return


GetPANID

GetPANID
Returns current PAN ID. Applicable to: Coordinator, Router, End Device. 
- UINT Return


GetShortAddress

GetShortAddress
Returns this node short network address. Applicable to: Coordinator, Router, End Device. 
- UINT Return


InitNetwork

InitNetwork
Initialises Zigbee stack, applies default routing from properties, and optionally starts commissioning. Applicable to: Coordinator, Router, End Device. Call once at startup before send/receive macros. 
- VOID Return


IsJoined

IsJoined
Returns 1 when node is joined/formed onto a Zigbee network, else 0. Applicable to: Coordinator, Router, End Device. 
- BYTE Return


IsNetworkReady

IsNetworkReady
Returns 1 when Zigbee stack/network is ready for data transfer, else 0. Applicable to: Coordinator, Router, End Device. 
- BYTE Return


ReceiveArray

ReceiveArray
Reads available data into an array buffer. Applicable to: Coordinator, Router, End Device. Returns number of bytes copied. 
- STRING Buffer
Output byte array. 
- UINT MaxLen
Maximum bytes to copy into Buffer. 
- UINT Return


ReceiveByte

ReceiveByte
Reads one byte from RX buffer. Applicable to: Coordinator, Router, End Device. Returns 0-255 for data, or 256 when no data is available. 
- UINT Return


ReceiveString

ReceiveString
Reads available data and returns a null-terminated string. Applicable to: Coordinator, Router, End Device. Returns number of data bytes copied (excluding terminator). 
- STRING Buffer
Output string buffer. 
- UINT MaxLen
Buffer length including null terminator. 
- UINT Return


SendArray

SendArray
Sends an array of bytes through Zigbee transport. Applicable to: Coordinator, Router, End Device. Uses current TX mode/address/endpoint/cluster settings. 
- STRING Data
Array containing bytes to send. 
- UINT Length
Number of bytes to send from Data. 
- UINT Return


SendByte

SendByte
Sends one byte using current TX routing settings. Applicable to: Coordinator, Router, End Device. 
- BYTE Data
Byte to send. 
- BYTE Return


SetPermitJoin

SetPermitJoin
Opens join window for a number of seconds. Primary use: Coordinator (and Router if your network design allows it). Not usually meaningful for End Device. 
- BYTE Seconds
Permit join timeout in seconds. 0 closes joining. 
- VOID Return


SetRXRouting

SetRXRouting
Dynamically updates RX endpoint/cluster filters at runtime. Applicable to: Coordinator, Router, End Device. 
- BYTE Endpoint
Accepted receive endpoint. 
- UINT Cluster
Accepted receive cluster. 
- VOID Return


SetTXRouting

SetTXRouting
Dynamically updates TX mode/address/endpoint/cluster at runtime. Applicable to: Coordinator, Router, End Device. 
- BYTE Mode
0 unicast, 1 groupcast, 2 broadcast. 
- UINT ShortAddress
Destination short/group address. 
- BYTE Endpoint
Destination endpoint. 
- UINT Cluster
Destination cluster. 
- VOID Return


SetZigbeeRole

SetZigbeeRole
Dynamically changes runtime Zigbee role. Use for fallback logic (for example Router then Coordinator). If ApplyNow=1, role config is applied immediately and commissioning is started. 
- BYTE Role
0 coordinator, 1 router, 2 end device. 
- BOOL ApplyNow
If true, immediately applies config and starts commissioning. 
- VOID Return


StartCommissioning

StartCommissioning
Starts commissioning based on current runtime role. Coordinator: starts network formation. Router/End Device: starts network steering (join). Call after InitNetwork if Auto Start is disabled. 
- VOID Return


TaskPoll

TaskPoll
Runs Zigbee stack polling. Applicable to: Coordinator, Router, End Device. Call regularly in your main loop (or timer) so Zigbee events are processed. 
- ULONG TimerID
System timer identifier 
- ULONG Return


zigbee_config

zigbee_config
Low-level runtime Zigbee role/endpoint/channel config. Applicable to: all roles. Usually called by InitNetwork and SetZigbeeRole. 
- BYTE role
 
- BYTE endpoint
 
- ULONG channel_mask
 
- VOID Return


zigbee_init

zigbee_init
Low-level Zigbee stack initialise call. Applicable to: all roles. Usually called by InitNetwork. 
- VOID Return


zigbee_transfer_config_rx

zigbee_transfer_config_rx
Low-level internal config for TX destination and RX filters. Applicable to: Coordinator, Router, End Device. Usually called by InitNetwork / SetTXRouting / SetRXRouting. 
- BYTE rx_endpoint
Accepted incoming endpoint. 
- UINT rx_cluster
Accepted incoming cluster id. 
- VOID Return


zigbee_transfer_config_tx

zigbee_transfer_config_tx
Low-level internal config for TX destination. Applicable to: Coordinator, Router, End Device. Usually called by InitNetwork / SetTXRouting / SetRXRouting. 
- BYTE tx_mode
0 unicast, 1 groupcast, 2 broadcast. 
- UINT tx_short_addr
Destination short address (or group id for groupcast). 
- BYTE tx_endpoint
Destination endpoint. 
- UINT tx_cluster
Destination cluster id. 
- VOID Return


Property reference

Properties
Zigbee Role
Select how this node behaves on the network. Coordinator: creates and manages the network. Router: joins a network and can forward traffic. End Device: joins a network as a leaf node. Suggested start: Router for joining existing networks, Coordinator if creating a new network. 
Endpoint
Local application endpoint for this component. Think of this as the local app port number. Suggested value: 10 (keep all nodes consistent unless you need multiple logical apps). 
Auto Start Commissioning
If enabled, InitNetwork will immediately start commissioning. Enable for simple projects. Disable if you want manual control via StartCommissioning macro. 
Default Routing
TX Address Mode
How outgoing data is addressed. Unicast: send to one node. Groupcast: send to nodes in a group. Broadcast: send widely. Suggested start: Unicast. 
TX Short Address
Destination short address (or group id if using Groupcast), in decimal. For Coordinator, this is often 0. Suggested start for unicast testing: 0 (coordinator) or the target node short address. 
TX Endpoint
Destination endpoint on the remote node. Must match the receiver app endpoint. Suggested value: 10. 
TX Cluster
Destination cluster id in decimal. Both sender and receiver should use the same cluster. Suggested custom cluster: 64512 (0xFC00). 
RX Endpoint
Only payloads for this endpoint are accepted into the RX buffer. Suggested value: 10 (match your local endpoint). 
RX Cluster
Only payloads for this cluster are accepted into the RX buffer. Suggested value: 64512 (0xFC00), matching TX cluster. 
Channels
Channel Mask (Auto)
Read-only channel mask calculated from the channel checkboxes. You do not need to edit this directly. Common full-range value (11-26 enabled): 134215680. 
Channel 11
Enable channel 11. Suggested: leave enabled unless avoiding local interference. 
Channel 12
Enable channel 12. Suggested: leave enabled for general discovery. 
Channel 13
Enable channel 13. Suggested: leave enabled for general discovery. 
Channel 14
Enable channel 14. Suggested: leave enabled for general discovery. 
Channel 15
Enable channel 15. Suggested: leave enabled for general discovery. 
Channel 16
Enable channel 16. Suggested: leave enabled for general discovery. 
Channel 17
Enable channel 17. Suggested: leave enabled for general discovery. 
Channel 18
Enable channel 18. Suggested: leave enabled for general discovery. 
Channel 19
Enable channel 19. Suggested: leave enabled for general discovery. 
Channel 20
Enable channel 20. Suggested: leave enabled for general discovery. 
Channel 21
Enable channel 21. Suggested: leave enabled for general discovery. 
Channel 22
Enable channel 22. Suggested: leave enabled for general discovery. 
Channel 23
Enable channel 23. Suggested: leave enabled for general discovery. 
Channel 24
Enable channel 24. Suggested: leave enabled for general discovery. 
Channel 25
Enable channel 25. Suggested: leave enabled for general discovery. 
Channel 26
Enable channel 26. Suggested: leave enabled for general discovery. 

Component Source Code

Please click here to download the component source project: FC_Comp_Source_Zigbee_ESP32.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_Zigbee_ESP32.fcfx