General operation of the gateway
1. Log in the gateway with terminal tool
- For example, I used the Putty to log in the gateway, which can be realized within three steps,
1.1 Fill in the Host Name(or IP address) with the gateway’s IP address, which in my case is 192.168.0.96, port 22, connection type SSH, and press open, shown in figure 1.
1)The IP address of the gateway can be obtained via gateway’s superior router’s dhcp list or network scanning tools like Advanced IP scanner.

1.2 The type in the default user name root and password root, log into the gateway, shown in figure

Open a web browser on PC, Input Gateway IP Address, in my case is 192.168.0.105; Enter the username and Password(default Username: root, Password: root),login to the gateway, the process is shown in figure 3.
2. WinScp file transfer tool
2. For example, I used the WinSCP program to interchange with the gateway.
2.1 Create a new session. Then fill in the Host name with the IP address 192.168.0.96, User name root and Password root of the gateway then click login, shown in figure 3.

3. Luci Embedded Web


4. Simple Linux Commands in Gateway
4.1 Is Command to view directory files, shown in figure 6.

4.2 cd Command to enter a directory, shown in figure 7.

4.3 ps Command to view system process, shown in figure 8.

4.4 logread –f Commands can viewa background program execution logs, useful when debugging, shown in figure 9.

4.5 cp Command for copying files, shown in figure 10.

4.5 mv Command to move files, shown in figure 11.

4.6 sysupgrade Command for upgrading gateway firmware, shown in figure 12.

4.7 /etc/init.d/*** stop|start|restart Command. Start, stop or restart a program ***, which stands for the specific startup file name. For example, start stop or restart the Zigbee demo program amber, shown in figure 13

4.8 Top Command to view the memory usage of the system, shown in figure 14.

4.9 df -h Command to view the system’s flash space, shown in figure 15.

4.10 free Command, similar to top command to view the memory usage, shown in figure 16.

Gateway Docking-Gateway Internal Application Development
1. Gateway Docking-Platform Service Development
1. MQTT communication
- The gateway and the platform use mqtt protocol to communicate. Our gateway is connected to our own cloud platform by default, and customers can modify it according to their own environment.
- The uplink message of the gateway will be sent to the topic: ‘t’
- The gateway will subscribe to the topic: ‘t / mac’ to accept messages, where the mac address is the mac address of the gateway
- Configure the mqtt address and port of the gateway on the luci embedded web, or use our gateway management tool
2. JSON format
The communication between the gateway and the platform uses the JSON. The following are some JSON protocol communication processes and formats.
- After the gateway is powered on for the first time, register itself with the platform registerReq, shown in figure 17

The platform should response with registerResp command after receiving registerReq, otherwise the gateway would keep registering. Therefore, the platform is recommended to response the gateway’s registration command at any time. This is because the gateway may delete the registration record in some cases like restore command.
- After the gateway successfully registers itself, it will actively report the basic information of the gateway reportAttribute(gateway.status) , shown in figure 18

The gateway will report basic information including wireless_ip, ethernet_ip, uplinkType, versioin, model, factory and so on.
Platform issued device list command getAttribute(mod.device_list) , shown in figure 19

- The platform issues a request to add a device, shown in figure 20

After the Platform sends the request for additional devices,
- If the Gateway receives it, verify the parameters first, and if there are no errors, it will return the code 99, indicating that the Gateway has received the command and is executing.
- If the parameter is wrong, the gateway will return the parameter error, code is 101.
- After that, the operator can watch the indicator light of the Gateway flashing, indicating that the Gateway is open for pairing. At this time, the operator needs to operate the device end to open for network access.
- Wait 10 seconds to 1 minute or so. If you add it successfully, the Gateway will return the message with code 0, which will be a mod.new_device_added message
- Failure usually returns a timeout message with code 104.
Remove devices from Platform:
- The platform issues a delete device, shown in figure 21.

Delete device command would delete the device data directly and return code 0.
- Gateway soft start, shown in figure 22.

- Remote firmware update on gateway, shown in figure 23.
