Command Line Interface

The Gateway is very customizable with a command line interface. This requires that you connect to the Gateway using USB and a terminal emulator like TeraTerm. Connection settings are 115,200 baud, 8 data bits, no parity, 1 stop bit.

Current Version (September, 2013) is as shown below: Gateway Firmware Version $Rev: 1880 $ Commands Press at any time to cancel and return to main menu ?          Display This Menu A          Display Associated Devices B          Test DNS C          Display Gateway Configuration stored in flash D          Ping the Server E          Display Ethernet Interface Information I          Send Info Message on Ethernet Interface to Server P          Ping an IP Address V          Toggle Message Display on/off S          Display Server Interface Information T          Display Gateway Statistics Z          Display Zigbee Network Information CONTROL-A  Change Zigbee Application Configuration CONTROL-B  Clear Address Cache CONTROL-E  Change IP Addressing Configuration, triggers network restart CONTROL-F  Restore all settings to Factory Defaults CONTROL-J  Set Zigbee Security Mode CONTROL-K  Set Zigbee Security Key CONTROL-L  Toggle Whether Info Message includes Security Key CONTROL-R  Reset Radio CONTROL-S  Configure Server Interface CONTROL-U  Change Zigbee Module Operating Region CONTROL-Y  Set Zigbee PanId CONTROL-Z  Set Zigbee Channel CONTROL-_  Exit to Bootloader for firmware update

Display Commands
These commands just display things or run tests; they don't actually change any settings or have side effects.

Display Associated Devices
Whenever a message arrives from the Zigbee interface, it contains both the Short Address and Long Address of the originating node. The Gateway stores this information. When the server sends a message to the Gateway with the Long Address of the destination, the Gateway looks it up in this cache. This command will display the contents of this cache, including when a message was last received from a given short address. For example, if there is one device with a short address of 0xF014 and long address of 0x00124B000245EB88: Displaying Valid Address Cache Entries at time = 1225 f014 => 88eb4502|004b1200 at time = 1224 (1 Seconds ago) valid=1

Test DNS
The Gateway uses the Domain Name Service to resolve a hostname (e.g. www.teslacontrols.com) to an IP Address (e.g. 72.167.232.196). The DNS Servers get configured automatically if using DHCP. If instead you are using Static IP addressing then you will also need to enter the IP Address of the DNS server. If DNS is configured correctly then this command will return an IP address. DNS test: resolving teslacontrols.com: Contacting Server Found from DNS at 72.167.232.196

Display Gateway Configuration from Flash
The Gateway's Configuration controls how the Gateway operates such as whether to use DHCP, which server to send data to, how the Zigbee interface is configured, etc. There are three sets of configuration information: This command will display the current settings stored in Flash. These are loaded into RAM on startup and used to control the Gateway. Configuration data: Configuration Block #0, CRC=0, Version/Flags=0x00/0x02 Info Message Interval (secs) = 300 Server Port = 42000, Receive Port = 42000 DNS Refresh Time = 600 Secs Server Name 1 = in-demo.teslacontrols.com Server Name 2 = www.teslacontrols.com IP Addressing Mode = DHCP Note: Settings below are not used for DHCP StaticIP:00.00.00.00, Default Gateway:00.00.00.00, Subnet Mask:00.00.00.00 DNS1:00.00.00.00, DNS2:00.00.00.00 Zigbee Default Settings: Channel = DEFAULT SET, PANID = 0x0000 (Any PAN) Security Mode = OFF, Send Security Key = ON, Region=US Endpoint = 0xd7, Dev Version = 0x89, Profile Id = 0xd7d7, Dev Id = 0x4567 Key = 2a 54 65 73 6c 61 20 43 6f 6e 74 72 6f 6c 73 2a
 * Factory Default Settings
 * Current Settings Used from RAM
 * Current Settings Stored in Flash
 * Note: Not all of these are used, some are future*

Ping the Server
This feature will [https://en.wikipedia.org/wiki/Ping_(networking_utility) ping the server. This is a very handy tool to verify whether your Ethernet settings are correct. You should see something similar to below: Ping Server: Pinging 75.101.166.152 - Reply From 75.101.166.152 in 80 mSec If you do not receive a reply then this means that your facility network is blocking access. Also try to ping the server from a computer and see if it works.

Display Ethernet Information
This displays IP addressing mode (DHCP vs. Static), current IP Address, etc. If using Static IP addressing then the DHCP information is omitted. The Gateway is configured to communicate with a particular server. This is set to be either an IP address (e.g. 10.240.72.3) or a hostname (e.g. demo.teslacontrols.com). The server interface controls sending data to/from the server. This command will display information about the server interface. Ethernet Interface: Ethernet MAC, MSB first: 00-1b-c5-0a-50-02 Addressing Mode: DHCP IP Address:     192.168.91.26 Default Gateway: 192.168.91.01 Subnet Mask:    255.255.255.224 DNS Server 1:   192.168.91.01 DNS Server 2:   00.00.00.00 DHCP: DHCP Server: 192.168.91.01, DHCP State = *DHCP_BOUND* (10) Lease: duration = 120 min, 47 min to renew, 107 min to rebind Number of DNS servers = 1 (MAX 2): 192.168.91.01 Server Interface: Server Name = in-demo.teslacontrols.com, resolved to IP Address 75.101.166.152 Server Tick Counter = 1571.050 Sec DNS Refresh in 229 Seconds Next Info Message in 234 Seconds Last ACK not received

Send Info Message to Server
The Gateway periodically sends an Info Message to the server. This contains information about the Gateway such as current IP Address, Zigbee network information, etc. This command will cause one of these messages to be sent immediately. This can be convenient when troubleshooting connectivity issues.

Ping the Server
This feature will [https://en.wikipedia.org/wiki/Ping_(networking_utility) ping the IP Address you enter. It can be any arbitrary IP address. Enter the IP address that you would like to ping, with periods inbetween each byte. For example, to ping Google's DNS Server (IP address of 8.8.8.8) we would simply enter 8.8.8.8. This tool can help you verify whether the Gateway can see the DNS server or your own server. If you do not receive a reply then this means that your facility network is blocking access or the other IP address is not available.

Toggle Verbosity
Normally messages sent through the Gateway are not displayed. If you would like them displayed then this command will toggle verbosity on/off. With Verbosity enabled, each message through the Gateway will be displayed. For example, a message that was received on the Zigbee Interface and sent out on the Ethernet Interface will be displayed as: To ENET(SI): C0007 Payload Len 35, Device MAC: 88eb4502004b1200 Ok This message means: If verbosity is turned off then nothing will be displayed.
 * To ENET(SI): To Ethernet via SI (Server Interface) internal software module
 * C0007: Cluster 0x0007
 * Payload Len 35: Payload length of 35 bytes from the Zigbee node
 * Device MAC: 88eb4502004b1200: This message from a device with MAC Address 0x00124B000245EB88
 * Ok: The message was sent successfully without any errors

Display Gateway Statistics
The Gateway monitors several statistics, including: The message counts are averaged over the past five minutes. This command will display the statistics. Message Counts: Current Minute / Past Minute / Trailing 5 min Average Radio Transmitted:    0 / 0 / 0 Ethernet Transmitted: 1 / 16 / 17 Uptime = 0d, 0h 43m 4s
 * Number of messages sent on Zigbee Interface
 * Number of messages sent on Ethernet Interface
 * Uptime

Display Zigbee Network Information
This command will display information about the Zigbee network and how the module is configured. Module State = 01; State Machine Flags = 0000 Module Configuration Parameters ZCD_NV_PANID               ffff ZCD_NV_CHANLIST            00 48 92 00 ZCD_NV_SECURITY_MODE       01 ZCD_NV_PRECFGKEYS_ENABLE   00 ZCD_NV_PRECFGKEY           01 03 05 07 09 0b 0d 0f 00 02 04 06 08 0a 0c 0d Module Information: MAC Address: 00 12 4b 00 01 1a 12 a5   TransportRev=0x02, ProductId=0x23, FW Rev=2.5.1 Channel=11, PANID=b2cb
 * Module State = 01; State Machine Flags = 0000: These are for internal troubleshooting.
 * Module Configuration Parameters: This displays the values used to configure the Zigbee module
 * MAC Address: 00 12 4b 00 01 1a 12 a5: This is the Zigbee module's MAC Address.
 * TransportRev=0x02, ProductId=0x23, FW Rev=2.5.1: These are the values returned by the module, similar to what is reported in the Get_Version example.
 * Channel=11, PANID=b2cb: This indicates that the module is using Channel 11 and PANID 0xB2CB.

Change Configuration Commands
These commands affect how the Gateway operates, and therefore require two or more buttons to be pressed in order to activate the command. Most of these will ask the user to confirm whether they really want to change the setting or not before proceeding.

Change Zigbee Application Configuration
This command allows you to configure the Zigbee Application Framework:
 * Endpoint
 * Profile
 * Device ID: These are only used in the Zigbee Stack
 * Device Version: 89

Clear Address Cache
The command clears the Gateway's Address Cache.

Change IP Addressing Configuration
This command allows you to configure the local area network interface, including:
 * Whether to use DHCP or Static IP Addressing
 * If Static IP Addressing is selected then the following additional settings need to be configured:
 * IP Address
 * Subnet Mask
 * Default Router
 * DNS Server

Restore all settings to Factory Defaults
The Gateway stores its user settings in flash memory. This command overwrites any user settings with the default settings. This command can be useful if you have mis-configured the device.

Set Zigbee Security Mode
This command allows you to configure the Zigbee Security mode.

Set Zigbee Security Key
This command will configure the 16 byte Zigbee Security key. You will need to enter the key in hexadecimal format.

Toggle Whether to Send Security Key in Info Message
For security reasons you may not want to send the Zigbee Security key back to the server as part of the Info Message. This command configures whether the security key is included in the Info Message.

Reset Radio
This command will restart the Zigbee network interface. Warning: This will kick all devices off the network and they will need to rejoin.

Configure Server Interface
The Gateway sends its data to a server. This command will let you change the server. You can either enter the server as a hostname (e.g. incoming.teslacontrols.com) or an IP address (e.g. 192.168.1.1).

Change Zigbee Module Operating Region
This command allows you to set the RF operating region; currently US or Europe. This is used to set RF output levels for FCC/ETSI compliance. Be sure to set the correct operating region for compliance.

Set Zigbee PanId
When the Zigbee network starts, it usually starts by randomly selecting a PANID. For testing you can also set the PANID manually. This command allows you to enter a two byte PANID, e.g. 9E3F.

Set Zigbee Channel
By default the Zigbee module will select a channel based on its pre-configured group. The default channel group matches those used in the Simple Applications. This command will let you restrict the radio to only one RF channel.

Exit to Bootloader
The Gateway supports updating of flash by USB. To do so the Gateway needs to switch to the Bootloader. Warning: This will halt normal operation of the Gateway and should only be used when loading new firmware. Otherwise the Gateway will not do anything.