Z3GW The Smart Gateway Software Manual - 2-32
Z3GW The Smart Gateway Software Manual - 2-32
1. introduction
Before software debugging, please confirm that the installation and wiring of the gateway circuit breaker are correct.
The wiring diagram is as follows:
2. Function Introduction
—1—
Z3GW 智能网关软件手册 V1.0
Downlink
Gateway Communication Uplink transmission
transmission Remarks
Type method protocol
protocol
Does not support 5G network
connection, default baud rate for
W WIFI MQTT (default)/Modbus TCP Modbus RTU
downlink is 9600, no verification,
stop bit 1, data bit 8
The default baud rate for the
Wired
E MQTT (default)/Modbus TCP Modbus RTU downlink is 9600, with no checksum,
Ethernet
stop bit 1, and data bit 8
There are no restrictions on
operators, including the Internet
of Things, phone cards, traffic
G 4G MQTT Modbus RTU cards, etc; The default baud rate
for the downlink is 9600, with no
checksum, stop bit 1, and data bit
8
The default baud rate for uplink and
downlink is 9600, without
R RS485 Modbus RTU Modbus RTU
verification, with stop bit 1 and
data bit 8
The default baud rate for uplink and
The data format is Modbus downlink is 9600, without
U RS232 Modbus RTU
RTU verification, with stop bit 1 and
data bit 8
—2—
Z3GW 智能网关软件手册 V1.0
Press and hold for 3 seconds, the green light will slowly
Activate AP hotspot mode
flash
Turn off AP hotspot mode Long press for 3 seconds, green light flashes quickly
Enter the circuit breaker address configuration Press three times within 6 seconds and the red light will
state flash quickly
Exit the circuit breaker address configuration Press three times within 6 seconds (the gateway automatically
state refreshes the online device after each exit)
Enter the state of clearing the configured Long press for 8 seconds, the red light flashes quickly;
circuit breaker address and reconfiguring the Assign circuit breaker addresses starting from address 1;
address Press three times to exit the state within 6 seconds
Press and hold for 3 seconds before releasing, and the green
Entering UDP distribution network state light will slowly flash; Press again three times and the red
light will flash slowly
1) The gateway is connected to a circuit breaker, and the power supply is 12Vd. c, which is normal;
2) Press the gateway button 3 times within 6 seconds for a new gateway (without configuring a circuit breaker
address), and the gateway red light will flash quickly to enter the address configuration state;
3) Set the blue dial code on the front of the first circuit breaker from automatic to manual position. The circuit
breaker's green light flashes, and the gateway's red light remains on for about 2 seconds. Continue flashing
quickly and successfully configure the address of this circuit breaker to 1;
4) Set the blue dial code on the front of the second circuit breaker from automatic to manual position. The circuit
breaker's green light flashes, and the gateway's red light remains on for about 2 seconds. Continue flashing
quickly and successfully configure the address of this circuit breaker to 2;
5) Repeat the above operation and configure the address of the newly added circuit breaker in sequence, with a
maximum configuration of 16 units;
6) After the configuration is completed, press the gateway button 3 times within 6 seconds, and the gateway red
light will turn on, indicating that the communication with the added circuit breaker is normal, and the circuit
breaker dial will be set back to the automatic position;
7) If you need to add another circuit breaker, you can press the button 3 times again to enter the configuration
status dial, and assign the address from the last ending address to continue. If you have already configured
address 1-5 circuit breakers for the first time, and configure them again for the second time, start from address
6;
8) To clear the configured address and reconfigure it, press and hold the button for 8 seconds. After the red light
changes to a fast flashing light, repeat steps 3-6 above and start configuring from address 1;
9) If the gateway red light does not stay on for 2 seconds during dialing configuration, and it keeps flashing fast, it
indicates that the address configuration has failed and the circuit breaker is abnormal. Please replace this
circuit breaker!
—3—
Z3GW 智能网关软件手册 V1.0
You can use our company's configuration tool to set the MQTT server domain name, username, password,
and port that you need to connect to. For detailed operations, please refer to 【 3.2 Configuration
Tool Instructions 】.
Define two themes, one for reporting online device information, published by the lower computer
(gateway) and subscribed by the upper computer (cloud); A theme for writing devices, published by the
upper computer (cloud) and subscribed by the lower computer (gateway).
—4—
Z3GW 智能网关软件手册 V1.0
The interaction diagram between the cloud and gateway for the content in each topic is shown below:
—5—
Z3GW 智能网关软件手册 V1.0
It is recommended that the upper computer (cloud) parse the data of the gateway and slave devices as follows:
1) Obtain device information, wait for reporting or actively obtaining, obtain and store the number of gateway
slave devices, the number of gateway online slave devices, the ID numbers and device types of each device.
2) Analyze the actively reported data or issue relevant requests based on the ID number and device type.
3) The real-time performance of data transmission is not very strong, and in practical applications, the real-time
requirements for electrical parameter updates are also not high. The regular reporting period is 15 minutes. If
you expect faster or slower reporting, you can set the reporting period for the gateway. If you need to actively
obtain all electrical parameters, you can use the publication topic {"ReportAll": "*"}. For the opening and
closing functions of multiple circuit breakers with high real-time performance, the 0x015D-0x0160 register of
the gateway point table can be directly written and operated to achieve fast control. Please refer to the
intelligent gateway communication protocol in the appendix. If necessary, "GW_Request" and
"MRaw_Request" can be used to read and write all relevant parameters of the gateway and circuit breaker.
—6—
Z3GW 智能网关软件手册 V1.0
TM "is the gateway time: year, year, day, hour, minute, second;
—7—
Z3GW 智能网关软件手册 V1.0
{"SSN": "*", "DataUp04": "* *", "TM": "* * *", "Type": "alarm"}
TM "is the gateway time: year, year, day, hour, minute, second;
{"SSN": "*", "DataUp04": "* *", "TM": "* * *", "Type": "trip"}
Actively report the fault
frame when a fault occurs,
'SSN' is the circuit breaker ID number;
including information such
as voltage, current,
TM "is the gateway time: year, year, day, hour, minute, second; temperature, and time
fault during the fault; For
'DataUp04' refers to the reported content: specific data analysis,
please refer to [2.5.5 MQTT
Message Data Analysis]
type Reporting scope Number of
reported
—8—
Z3GW 智能网关软件手册 V1.0
frames
—9—
Z3GW 智能网关软件手册 V1.0
The data content of MQTT is a character based hexadecimal number, which is similar to the data
format of ModbusTCP and includes three parts: MBAP message header, function code, and data:
MBAP message
Function code data
header
—10—
Z3GW 智能网关软件手册 V1.0
CRC
2 Calculate from the third byte to
inspection hold hold
bytes the last byte
code
Initiated by
2 Initialized by server
length The number of bytes client
bytes (response)
(request)
The function code supports the function of 0x03/0x04/0x06/0x10, and the data format is consistent
with modbusTCP, as shown in the example below.
The data parsing for 'DataUp04' is as follows (the parsing methods for 'GWD_RAW_04'
and 'SD_RAW_04' are similar, first converting character hexadecimal to hexadecimal):
—11—
Z3GW 智能网关软件手册 V1.0
A1. Use the 03/04 function code to read gateway or circuit breaker information (request:
"MRaw_Request" or "GW_Request" content)
A2. Normal response reply (reply with the content of "MRaw_Respond" or "GW_Respond")
—12—
Z3GW 智能网关软件手册 V1.0
A3. Abnormal response response response (reply with the content of "MRaw_Respond" or "GW_Respond")
B1. Use the 06 function code to modify the individual settings of the gateway or circuit breaker
(request: "MRaw_Request" or "GW_Request" content)
B2. Normal response response (reply with the content of "MRaw_Respond" or "GW_Respond")
B3. Abnormal response reply (reply with the content of "MRaw_Respond" or "GW_Respond")
—13—
Z3GW 智能网关软件手册 V1.0
byte
Register Address 2 bytes 01 D0
Bytes 2 bytes 00 03
Mailing Address 1 byte 01
Abnormal function code 1 byte eighty-six 06 Function Exception Code
01: Illegal function
Exception code 1 byte 01 02: Illegal data address
03: Illegal data value
C1. Use the 10 function code to modify the settings of multiple consecutive parameters for the
gateway or circuit breaker (request: "MRaw_Request" or "GW_Request" content)
—14—
Z3GW 智能网关软件手册 V1.0
Note: Our company provides parsing APIs for the Java language. If necessary, please consult
technical personnel.
Example:
—15—
Z3GW 智能网关软件手册 V1.0
2.7 Modbus RTU data transmission (only supported with R/U gateway)
The gateway with uplink RS485/232 interface supports Modbus RTU serial port data type communication,
and can communicate with the gateway and connected circuit breakers through the serial port. And it
is compatible with WIFI/wired Ethernet/4G communication and can be used together (regardless of whether
it is connected to the network or not, serial communication can be normal). Please refer to the
communication protocol in the appendix for the data point table, and refer to the RTU mode in [3.2
Configuration Tool Instructions] for communication using our company's configuration tool software.
Example: Set Timer 1 (register address 0x0176-0x017B) every Monday to Friday at 16:30. The switches
with addresses 1, 3, 5, and 7 will automatically open, and the switches with addresses 2, 4, 6,
and 8 will automatically close.
—16—
Z3GW 智能网关软件手册 V1.0
Example: One click control circuit breaker addresses 1, 2, 3, and 4 for device opening, and addresses
5, 6, 7, and 8 for device closing. Use the 10 function code to simultaneously write data to the
four registers of 0x015D-0x0160.
—17—
Z3GW 智能网关软件手册 V1.0
functional
Include features Remarks
module
Display the number of circuit
[Slave Device Information]: Number of Slave Devices, breakers configured and connected to
Monitoring Number of Slave Devices Online, Number of the current gateway, and the online
Successfully Configured Devices number refers to the number of circuit
breakers reported by MQTT normally
[Factory Parameters]: Gateway Type, Gateway ID,
Monitoring
Gateway Time, Gateway Version, Factory Time
[4G parameters]: 4G module self check, 4G signal The relevant parameters can only be
Monitoring strength, operator, 4G network type, SIM card status, read after the 4G gateway card is
IM card ICCID number, IMEI number, 4G network status inserted and connected to the network
The WIFI username and password only
need to be configured for the WIFI
gateway type; MQTT related settings
Cloud mode parameter settings: WIFI username, WIFI only need to be set in cloud mode;
Setting password, MQTT domain name, username, password, MQTT Enter data in the input box, click
port number, data format, login method [Write], wait for the prompt to
succeed, and then write the next
parameter. Only one parameter can be
modified at a time.
Set the gateway reporting conditions.
If the current reporting switch is
turned on, messages will be reported
based on the set rate of change. If it
【 Reporting parameters 】: Voltage and current
is turned off, changes in current and
Setting change rate, current reporting switch, electrical
voltage data will not be reported;
energy reporting change, data cycle reporting
Position the mouse in the display box
that needs to be modified, click
[Single item write], and wait for the
prompt to be successful.
Enter the 2-digit year, month, day,
hour, minute, and second in the input
box, click on [Set Device Time] to
【 Time Setting 】: Set device time and
Setting modify the gateway system time, or
synchronization device time
directly click on [Synchronize Device
Time] to write the computer system
time into the gateway
[485 communication mode] must be
[Communication parameters]: communication address, selected as normal, [TCP
baud rate, stop bit, verification, IP allocation communication mode] cloud mode is
method (manual/automatic), 485 communication mode MQTT, and ordinary Ethernet mode is
(normal/configured), MAC address, IP address, subnet MODBUS TCP mode; The gray box can only
Setting
mask, gateway address, DNS address, gateway type, be read and cannot be modified;
communication port, TCP communication mode (cloud Position the mouse in the display box
mode/regular Ethernet), uplink (baud rate, stop bit, that needs to be modified, click
verification), software version [Single item write], and wait for the
prompt to be successful.
Check the address of the device that
needs to be controlled in the box,
click the corresponding button to
select the opening and closing action
(on represents closing, OFF
represents opening), and after
【 Group control function 】: Group control settings,
Setting setting it, click 【 One click
group control intervals
control 】 to corresponding control
the device action; The group control
interval is the action interval of
each device, which is 500ms by
default. It is recommended to set it
no less than 300ms.
—18—
Z3GW 智能网关软件手册 V1.0
5) If you need to control the circuit breaker through hotspot mode, uncheck the gateway version and click
Connect; After successful connection, select the corresponding device from the dropdown device type, enter
the device address, and the interface will automatically switch to the circuit breaker function for operation
—19—
Z3GW 智能网关软件手册 V1.0
3) After configuring all parameters, press and hold the button for 3 seconds, and the green light will flash quickly.
Waiting for the green light to remain on indicates successful network connection.
—20—
Z3GW 智能网关软件手册 V1.0
A. Follow steps 1-3 above to configure the gateway parameters and connect to the network normally;
B. Use the IP address, port number, and other information obtained from the gateway to connect
to the upper TCP debugging tool for communication (or use our company's configuration tool).
C. The TCP instruction is in the standard Modbus TCP format, which can be referred to in [2.6.1
Modbus TCP Instruction Message (Standard Format)]. Please refer to the communication protocol
for the data point table according to the device type.
3.3.3 4G communication
Insert a valid 4G card correctly according to the printing direction on the side of the gateway,
and follow steps 1-4 of [3.3.1] above. (In step 2, there is no need for network distribution, select
4G for [Gateway Type], other operations are the same).
1) WIFI cannot connect to the network and keeps flashing green: confirm that the written WIFI username and
password are correct. If it is in MQTT mode, it is also necessary to confirm whether the relevant settings of the
MQTT server are correct; And does not support 5G network connection.
2) The gateway is connected to the network. How to obtain the gateway IP address: After connecting to the
network, long press the button for 3 seconds and the green light slowly flashes to enter the AP hotspot mode.
—21—
Z3GW 智能网关软件手册 V1.0
Use our company's configuration tool to read the gateway IP information, confirm, and then long press the
button to exit the hotspot mode and automatically connect to the network.
3) The 4G card has been inserted but the green light is not always on: if the gateway green light is always on for 2
seconds and then flashes quickly, it indicates that the card is not recognized. Confirm whether the direction of
the 4G card insertion is consistent with the side label; If the green light keeps flashing rapidly, confirm whether
the MQTT server that needs to be connected is running normally and whether the 4G card is down and in
arrears.
4) The green light of the gateway is always on, but there is no reporting information on MQTT: confirm whether
the gateway has configured a circuit breaker address, and there is no reporting if the address has not been
configured;
5) Gateway red light flashing slowly: The gateway has not been configured with a circuit breaker address, or the
configured circuit breaker is disconnected and has abnormal communication. Please check the wiring.
6) How to obtain the ID number of the circuit breaker connected under the gateway through MQTT: MQTT cloud
mode, based on the reported information, the content of the "SSN" can be obtained as the ID number.
7) MQTT sends control messages without reply: confirm whether the SN number and communication address in
the instruction correspond correctly; If there is no response, confirm whether the circuit breaker dial switch is
in the "automatic" position. The instruction format is standard JSON format, and the symbols must be in
English!
8) MQTT continuous message loss: Each message should be distributed at least 1 second apart, and multiple
messages cannot be distributed at the same time.
—22—
Z3GW 智能网关软件手册 V1.0
5. appendix
Equipment type
—23—
Z3GW 智能网关软件手册 V1.0
0 GSM
2 UTRAN
3 GSM W/EGPRS
Network type (supported Character
0x00D4 0x04 4 UTRAN W/HSDPA /
only for 4G gateways) type
5 UTRAN W/HSUPA
6 UTRAN W/HSDPA
and HSUPA
7 E-UTRAN
0 Not
registered ME
is not
currently
searching a
new operator
to register to
Network status (supported Character 1 Registered,
0x00D5 0x04 /
only for 4G gateways) type home network
2 Not
registered,
but MT is
currently
trying to
attach or
search an
—24—
Z3GW 智能网关软件手册 V1.0
operator to
register to
3 Registration
denied
4 Unknown
5 Registered,
Roaming
Maximum character length 20
0x00D6-0x00 SIM card status (supported Character
0x04 The meaning can be found in /
DF only for 4G gateways) type
Note 1
SIM card ICCID number
0x00E0-0x00 Character
(supported only for 4G 0x04 Maximum character length 50 /
F8 type
gateways)
IMEI number (mobile device
0x00F9-0x01 number) Character
0x04 Maximum character length 30 /
07 (Supported only for 4G type
gateways)
—25—
Z3GW 智能网关软件手册 V1.0
—26—
Z3GW 智能网关软件手册 V1.0
Ethernet subnet mask Unsigned 0x03/0x06/0 Byte 1 (high byte), Byte 2 (low
0x0237 /
address setting byte 1 (high shaping x10 byte)
—27—
Z3GW 智能网关软件手册 V1.0
—28—
Z3GW 智能网关软件手册 V1.0
0x028E-0x2A Character
user name 0x03/0x10 Maximum character length 60 /
B type
0x02AC-0x02 Character
password 0x03/0x10 Maximum character length 60 /
C9 type
Unsigned
0x02CA MQTT port number 0x03/0x10 /
shaping
Version 3 (for 3.1.0)
Or 4 (default to 4 for 3.1.0),
Unsigned Gateway settings for 4G mode
0x02D1 MQTT protocol version 0x03/0x10 /
shaping and wired Ethernet
If the MQTT server version is
5, it must be 4 here
—29—