Trident IoT Z-Wave SDK
 
Loading...
Searching...
No Matches
Radio CLI

Radio CLI basics

The Radio CLI tool can be used to test the radio functionality of a Z-Wave board

UART configuration

Default UART configuration uses UART0 (pin 16,17) set to 230400,N,8,1 The UART configuration can be changed but requires a recompilation of the project.

Using the Radio CLI test tool

  1. Program the binary to a Z-Wave chip
  2. Connect to the chip with a terminal program set to the correct UART and configuration
  3. Type help for a list of commands

Examples of using the Radio CLI

Here are some examples of setting up Z-Wave in the radio CLI

Transmitting a frame on us region at 100kbps

Setting up the radio for the US region and transmit a default frame at the 100kbps channel with tx power 0dBm

> zw-region-set 1
> zw-homeid-set 0x11111111
Setting homeID to 11111111
> zw-init
Radio firmware version=0000036B
Z-Wave Radio initialized to Region 1, Tx channel 0
> zw-nodeid-set 2
Setting nodeID to 2
> zw-tx-channel-set 0
Using default payload
Tx channel 0
> zw-tx-power-set 0
> tx 1
Transmit region=1, ch=0 (0), cnt=1, delay=100ms
Transmit complete, 1 success, 0 failed, 0 lbt_failed

This should transmit one frame on the US region 100kbps frequency

Transmitting a constant carrier on us region at the 100kbps frequency

The Radio Test Tool can be setup to enable a continues unmodulated carrier signal on a specific channel in a specific Z-Wave region. This example makes a continues unmodulated carrier signal on Z-Wave region US_LR, channel 0 (100kbit GFSK channel).

> zw-region-set 9
Region 9, Tx channel 0
> zw-init
Radio firmware version=0000036B
Z-Wave Radio initialized to Region 9, Tx channel 0
> zw-tx-channel-set 0
Using default payload
Tx channel 0
> zw-tx-power-set 0
> tx 1
Transmit region=9, ch=0 (0), cnt=1, delay=100ms
Transmit complete, 1 success, 0 failed, 0 lbt_failed
> rx off
Rx off - Received 0 frames
> zw-radio-tx-continues-set on
Continues carrier transmit mode enabled

This should enable a measurable unmodulated carrier signal at 916 MHz

To stop carrier signal do a power off/reset of device

Using GPIO's to show radio state

Using Radio Test Tool for determining which state the RF radio is in by routing radio state to GPIO pins

> zw-radio-rf-debug-set on
Reset module to put the new rf state gpio settings into effect
> reset
Radio firmware version=0000036B
RF Rx and Tx state on GPIO 21 and 28 enabled - 1 = active
RF MCU state on GPIO 0 enabled - 1 = active, 0 = sleep
Trident Radio Test CLI version 0.5.2 git hash 57e6ae1a
Radio firmware version=0000036B
Current Z-Wave Region 9
Current Tx max power setting 14dBm

To turn the radio debug feature off again use the command

> zw-radio-rf-debug-set off
zw-radio-rf-debug-set off
Reset module to put the new rf state gpio settings into effect
> reset
Trident Radio Test CLI version 0.5.2 git hash 57e6ae1a
Current Z-Wave Region 9
Current Tx max power setting 14dBm

User Interface for the Radio CLI test tool

The following commands can be used in the Radio CLI tool

Supported commands

Command Parameters Description
zw-region-set Region (0-103) - Region number Set the desired Z-Wave region. Supported region numbers can be shown by running the zw-region-list command
zw-region-list n/a Lists current region and all supported regions
zw-init n/a Initialize the Z-Wave PHY layer to the region specified with the zw-region-set command
zw-homeid-set HomeID (hex) - HomeID for receive filtering Set the desired Z-Wave HomeID for use in receive filtering
zw-nodeid-set NodeID (dec) - NodeID for receive filtering Set the desired Z-Wave nodeID for receive filtering
zw-tx-payload-set payload (hex) Set the frame payload in hex bytes, if less than 9 bytes then the default payload will be used
zw-tx-channel-set Channel (0-3) - Channel number. Actual channel range follows region setup Set the transmit channel number
zw-tx-power-set Tx power (-20-+20) - Tx power in dBm
powerindex - optional, if specified then the powerindex will be used to setup radio for stated Tx power until next change or reset
Set the transmit power
zw-tx-power-index-list n/a List current active Tx power to radio powerindex conversion table - for current selected region and channel
zw-tx-lbt-set LBT threshold (-127-0) - Set lbt level in dBm, 0 equals lbt is turned off Set the transmit Listen Before Talk threshold
zw-stats-get n/a Get network statistics from the PHY layer
zw-stats-clear n/a Clear the network statistics and set all counters to 0
zw-tx-delay-set delay (2-65535) - Interframe delay in ms Set delay between transmitted frames when sending multiple frames
zw-rx-channel-set Single channel (on/off) - Single channel mode
Channel number (0-3) - Fixed channel
Switch between single channel and channel scanning mode.
Setting single channel on will disable channel scanning and fix the receiver to the specified channel
Setting single channel off will start channel scanning
zw-tx-beam repeats (1-255) - Number of beams to transmit
destid - destination node id
ack - optional wait for ack
Transmit repeats Beam+frame to destid and optionally wait for ack
zw-tx-max-power-set max Tx power (14/20) - The max Tx power in dBm supported by the radio board Set the max Tx power supported by the radio board. This command will only take affect after a reset command
zw-radio-tx-continues-set Continous transmit (on/off) - Set the transmit of carrier wave on or off Transmit an unmodulated carrier wave. It is recommended to reset the module with the reset command after having send a carrier wave
zw-radio-rf-debug-set Debug mode (on/off) - Turn radio debug mode on or off Set the radio debug mode on or off
Pins used:
RF Rx state on GPIO 21
RF Tx state on GPIO 28
RF MCU state on GPIO 0
zw-radio-calibration-set Set radio calibration setting (boardno) - Set 0 for default setting or 72/74-78 for predefined RF calibration setting Set radio calibration setting to predefined setting
zw-radio-rf-debug-reg-setting-list List radio register settings [0/1] - List selected radio register settings and optionaly an extended number of radio register settings List radio register settings, if parameter equals 1 list extended number of radio register settings
zw-radio-rssi-get n/a Get last measured RSSI
tx repeat - number ot times the frame should be transmitted
wait ack . optionally wait for an ack frame
Send repeat frames and optionally wait for an ack frame before sending the next frame
rx rx mode (on/off) - Receive mode Set the receiver on or off
reset n/a Perform a soft reset of the radio board
script cmd
- autoon [1-5] - enable active or specified script run on startup
- autooff [1-5] - disable active or specified script run on startup
- start [1-5] - start active or specified script entry
- stop - stop running script at next scriptline
- list [1-5] - list all or specified script
- clear [1-5] - clear active or specified script
Script handling makes it possible for running several commands autonomously
run Run active script
wait time - number of milliseconds before next scriptline should be executed Wait some time before executing the next scriptline - only useful in a script
status n/a Get current status
version n/a Get the version of the Radio CLI tool and the radio firmware