The UART is by default set up to 230400,8,N,1
The supported commands can be seen by writing help on the terminal
The Radio CLI tool can be used to test the radio functionality of a Z-Wave board
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.
Here are some examples of setting up Z-Wave in the radio CLI
Setting up the radio for the US region and transmit a default frame at the 100kbps channel with Tx power 0dBm
This should transmit one frame on the US region 100kbps frequency
The Radio Test Tool can be setup to enable a continuous unmodulated carrier signal on a specific channel in a specific Z-Wave region. This example makes a continuous unmodulated carrier signal on Z-Wave region US_LR, channel 0 (100kbit GFSK channel).
This should enable a measurable unmodulated carrier signal at 916 MHz
To stop carrier signal do a power off/reset of device
Using Radio Test Tool for determining which state the RF radio is in by routing radio state to GPIO pins
To turn the radio debug feature off again use the command
When the CLI tool is flashed into the CZ20, it allows the CZ20 to be controlled from a serial connection to a terminal program such as PuTTY. The serial settings are 230400 baud, 8 data bits, no parity, 1 stop bit, and implicit CR after a LF should be enabled.
The help command will list all of the available commands in the CLI tool. In addition to using commands to control the CZ20 in real time, up to five scrips can be stored in the CZ20 (script 1 thru script 5). Any of these scripts can be executed from the command line interface without the need to retype each command in the script. In addition to executing a script from the command line, the CZ20 can also be configured to execute one of the scripts following a reset or at power up. This is very helpful if you need to have the device go into a specific mode of operation for testing when a battery is installed, without the need for a physical connection to a terminal.
This feature can especially be usefull when doing RF regulatory compliance testing (like FCC) where a console connection to the device under test is not possible during testing.
As an example, suppose you wanted the device to go into receive mode on the 916 MHz classic Z-Wave channel on power up by storing a configuration in Script 3.
First enter following line followed by a 'return'
The CLI tool will return
Next enter the commands/lines followed by a 'return' needed for the script
Entering a 'enter' on an empty line ends the entry of commands in Script 3. The CLI will on the terminal return
To check the contents of Script 3, enter following on the terminal
This will print out Script 3 contents on the terminal.
To execute Script 3 while the terminal is connected enter
If you wish to have Script 3 execute on powerup, type
The CLI tool will return on the terminal
At this point, the device can be disconnected from the terminal and Script 3 will be executed whenever the device powers up or resets.
Script commands including start, stop, autoon, autooff, list and clear can be found by using the 'help' commmand when the device is connected.
Below are scripts that may be helpful for making the device transmit or receive on various North American channels on power up.
The following commands can be used in the Radio CLI tool
| 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 (hexadecimal) - HomeID for receive filtering | Set the desired Z-Wave HomeID for use in receive filtering |
| zw-nodeid-set | NodeID (decimal) - NodeID for receive filtering | Set the desired Z-Wave nodeID for receive filtering |
| zw-tx-payload-set | payload (hexadecimal) | Set the frame payload in hexadecimal bytes, If fewer than 9 bytes are provided, the default payload will be used |
| zw-tx-channel-set | channel (0-3), actual channel range follows region setup - channel number | Set the transmit channel number |
| zw-tx-power-set | Tx power (-20 to +20 dBm). Optional: powerindex to map Tx power to radio power index until next 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-classic-tx-power-enable | Classic Z-Wave Tx power control on none lr channels (on/off) - if on then Tx power on none lr channels are set through classic Tx power settings | Enable/disable usage of classic Z-Wave Tx power settings on none lr channels |
| zw-classic-tx-power-set | Classic Z-Wave Tx power in dBm (-20-+20) - used on none lr channels if classic Z-Wave Tx power feature is enabled | Set classic Z-Wave Tx power 'normal' setting |
| zw-classic-tx-power-adjust-set | Classic Z-Wave Tx power adjust in dBm (-5-+5) - used on none lr channels if classic Z-Wave Tx power feature is enabled | Set classic Z-Wave channel power measured at a PA setting of 0dBm |
| zw-classic-tx-power-attenuation-set | Classic Z-Wave Tx power attenuation in dBm (0-20) - used on none lr channels if classic Z-Wave Tx power feature is enabled | Set classic Z-Wave Tx power setting attenuation |
| zw-tx-lbt-set | channel (0-3), actual channel range follows region setup - channel number. LBT threshold (-127-0) - Set LBT threshold in dBm, 0 equals LBT is turned off | Set transmit Listen Before Talk threshold on specified channel |
| 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. Single channel on → disables scanning, fixes receiver to specified channel Single channel off → enables channel scanning |
| zw-tx-max-power-set | max Tx power (14/20) - 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 effect after a reset command |
| zw-radio-tx-continues-set | state (on/off) - Set the transmit of continuous signal wave on/off Signal wave type (0/1/2) - 0 = unmodulated - 1 = modulated - 2 = modulated with whitening | Transmit an unmodulated, modulated or modulated with whitening signal wave. It is recommended to reset the module with the reset command after having sent a continuous signal 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-rf-debug-reg-setting-list | List radio register settings [0/1] - List selected radio register settings and optionally 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 | channel (0-3), actual channel range follows region setup - Get measured RSSI on channel count - optional count times delay ms - optional delay ms inbetween | Get last measured RSSI on channel, optional count times with optional delay ms inbetween (default 1000ms) |
| zw-radio-rssi-get-all | count - optional count times delay ms - optional delay ms inbetween | Get last RSSI measurement on all region channels, optional count times with optional delay ms inbetween (default 1000ms) |
| zw-radio-rssi-config-set | sample_freq - sample frequency in ms average_count - number of samples for doing RSSI average | Setup RSSI noise level to be sampled every sample_freq ms and generate an average out of average_count samples. Disable with 'zw-radio-rssi-config-set 0 0' |
| tx | repeat - number of times the frame should be transmitted | Send repeat frames |
| rx | Rx mode (on/off) - Receive mode | Set the receiver on or off |
| timestamp | enable <on/off> - enable/disable timestamp in ms | Enable/Disable timestamp in ms on line output |
| 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 | number [1-5] - optional script number to run | Run active script or specified script number |
| 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 |
| gpio-pulse | Pin number (required) Pulse width in ms (required) | Create a pulse of the given milliseconds on the given pin. Example for 150 ms on pin 4: gpio-pulse 4 150 |
| gpio-output | Pin number (required) Output level high/low (optional) | Set to output the pin at the given level, default level value is low. Example to set pin 4 to high: gpio-output 4 high |
| gpio-input | Pin number (required) Pull-up option <pull-up=on/off> (optional) | Set pin as input with the given pull-up option, default is pull-up on (10K). Example to set pin 5 as input with pull-up on: gpio-input 5 pull-up=on |
| gpio-set | Pin number (required) Output level high/low (required) | Set an output pin at the given level. Example to set pin 1 to low: gpio-set 1 low |
| gpio-get | Pin number (required) | Get the current level of the given pin. Example to get level of pin 1: gpio-get 1 |
| version | n/a | Get the version of the Radio CLI tool and the radio firmware |