Professional Documents
Culture Documents
Esmart3 Serial Comm
Esmart3 Serial Comm
Communication protocol
MPPT Solar Controller communication protocol February 2018
Catalog
1 INTRODUCTION..........................................................................................................................2
2 ADDR...............................................................................................................................................3
3 COMMAND LIST..........................................................................................................................3
5 DATA region................................................................................................................................... 4
6 COMMAND ACKNOWLEDGE..................................................................................................4
1/16
MPPT Solar Controller communication protocol February 2018
1 Introduction
Communication protocol requirements
1. data arrangement: low in the left, high in the right
2. the entire packet length is not more than 120 bytes.
2/16
MPPT Solar Controller communication protocol February 2018
2 Addr
Device type Describe
0x00 all
Device Addr
0x00
0x01
3 Command list
Command ID Describe
0x00 CMD_ACK, acknowledge command
0x01 CMD_GET, Get some data item commands
0x02 CMD_SET, Set some data item commands and need to reply
0x03 CMD_SET_NO_RESP, Set some data item commands without a reply
0x04 CMD_NACK, No acknowledge command
0x05 CMD_EXEC, Carry out a particular action and need a reply
0x7F CMD_ERR,A command or parameter that can not be identified
3/16
MPPT Solar Controller communication protocol February 2018
5 Data region
For different commands, the format of the data region is different and is defined as follows:
Command ID value Describe
CMD_GET 0x01 The data region is necessary, and the first, second byte is the
high and low offset. The low third, fourth is the length of the
whole column of the data (the length of the word).
CMD_SET 0x02 The data region is necessary, and the first, second byte is the
high and low offset, and the following data is the data to be set,
the length of which can be obtained from the data length
domain.
CMD_SET_NO_RESP 0x03 Data format is the same as CMD_SET, but no reply is required.
CMD_ACK 0x00 Without a data domain, the command ID is replaced by a
CMD_ACK, a data packet that is replying at the same time,
and the data length region is 0.
CMD_NACK 0x04 Without a data domain, change the command ID into
CMD_NACK, the data field and its reply packet, the data
length region is 0.
CMD_EXEC 0x05 The data region is necessary, and its specific content depends on
the command ID and the specific command content.
6 Command acknowledge
If the packet is successfully parsed (it means that the packet format is correct and the address
matches), it will be returned as required; if the packet error is received (the packet format is
incorrect or the address is not consistent), the packet will be ignored. The acknowledge of the
command is defined as follows:
Command ID Acknowledge
CMD_GET CMD_SET_NO_RESP
CMD_SET CMD_ACK or CMD_NACK
CMD_SET_NO_RESP No reply
CMD_ACK No reply
CMD_NACK No reply
CMD_EXEC CMD_ACK or CMD_NACK
4/16
MPPT Solar Controller communication protocol February 2018
Battery system:
00 00:auto
01 00:1*12V
2 Uint16 wBatSysType; 02 00
02 00:2*12V
...
20 00:32*12V
2 Uint16 wBulkVolt; 03 00 0.1V Bulk voltage
5/16
MPPT Solar Controller communication protocol February 2018
2 Uint16 ChkSum;
7.1.3 Run log
Log information
Data item ID: 0x02
Attributes: Read and write
Bytes Content Offset Unit Remarks
2 Uint16 wFlag; 00 00 Flag
4 Uint32s dwRunTime; 01 00 1min -------
2 Uint16 wStartCnt; 03 00 -------
2 Uint16 wLastFaultInfo; 04 00 -------
2 Uint16 wFaultCnt; 05 00 -------
Daily power
4 Uint32s dwTodayEng; 06 00 1wh
generation
4 data_t wTodayEngDate 08 00
Monthly power
4 Uint32s dwMonthEng; 0A 00 1wh
generation
4 data_t wMothEngDate; 0C 00
Total power
4 Uint32s dwTotalEng; 0E 00 1wh
generation
Consume
4 Uint32s dwLoadTodayEng; 10 00 1wh
electricity daily
Consume
4 Uint32s dwLoadMonthEng; 12 00 1wh electricity
Monthly
Consume
4 Uint32s dwLoadTotalEng; 14 00 1wh
electricity Total
2 Uint16 wBacklightTime; 16 00 1S Backlight time
Key switch
2 Uint16 bSwitchEnable; 17 00 1或0 enabled (1
active)
2 Uint16 ChkSum;
6/16
MPPT Solar Controller communication protocol February 2018
7/16
MPPT Solar Controller communication protocol February 2018
8/16
MPPT Solar Controller communication protocol February 2018
2 Uint16 ChkSum;
7.1.8 Equipment information
Information information
Data item ID: 0x08
Attributes: Read and write
Bytes Content Offset Unit Remarks
2 Uint16 wFlag; 00 00 Flag
16 Uint16 wSerialID[8]; 01 00 Serial number
4 Uint16 wFirmWare[2]; 09 00 Version number
16 Uint16 wModel[8]; 0B 00 Model
2 Uint16 wChkSum;
7.1.9 Temporary data storage
TempParam information
Data item ID: 0x09
Attributes: Read and write
Bytes Content Offset Unit Remarks
2 Uint16 wFlag; 00 00 Flag
4 time_t PeriodLoadCtr2Time; 01 00 ------------------
2 Uint16 bPVEnergySel; 03 00 ------------------
Temperature display
unit selection:
2 Uint16 bBatTempSel; 04 00 1 or 0 1: degrees Fahrenheit.
0: centigrade degrees
centigrade
2 Uint16 bLoadUseSel; 05 00 ------------------
2 Uint16 bLoadLaststate; 06 00 ------------------
2 Uint16 wChkSum;
7.1.10Information on power generation and electricity consumption
EngSave information
Data item ID: 0x0A
Attributes: Read and write
Bytes Content Offset Unit Remarks
2 Uint16 wFlag; 00 00
[0] ~ [11] data
statistics for 1~12
48 Uint32s wMonthPower[12]; 01 00
month power
generation
48 Uint32s wMonthLoadPower[12]; 19 00 [0] ~ [11] data
9/16
MPPT Solar Controller communication protocol February 2018
位 Fault information
1 bit Battery voltage over
2 bit PV voltage over
3 bit Charge current over
4 bit Dis-charge over
5 bit Battery temperature alarm
6 bit Internal temperature alarm
7 bit PV voltage low
8 bit Battery voltage low
9bit Trip zero protection trigger
10bit In the control of manual switchgear
10/16
MPPT Solar Controller communication protocol February 2018
5.Load control mode specification: 4 modes (Note: when wLoadModuleSelect1 is set to 5100,
5116, 5117 or 5118, wLoadModuleSelect2 data cannot be set, and the default is 5200).
11/16
MPPT Solar Controller communication protocol February 2018
○1 Light-control delay mode (5100): starting voltage (can be set), closed voltage (can be set),
7.Data structure
typedef struct
{
Uint16 wHi16;
Uint16 wLow16;
}Uint32s;
typedef struct
{
int hour;
int minute;
}time_t;
typedef struct
{
12/16
MPPT Solar Controller communication protocol February 2018
int month;
int day;
}data_t;
8.typedef enum
{
remoteCmd_null, // /* 0 */ Meaningless
remoteCmd_start, //Start charging command
remoteCmd_shutdown, //Stop charging command
remoteCmd_update, //Update command
remoteCmd_modifyDateTime, //Synchro time command
remoteCmd_startSelfTest,
remoteCmd_resetAll, //Restore factory settings
remoteCmd_Set
}remoteCmdType_t;
case remoteCmd_modifyDateTime:
strCalendarTmp.IccYear = stRemoteControl.uwData[0];
strCalendarTmp.IccMon = stRemoteControl.uwData[1];
strCalendarTmp.IccDay = stRemoteControl.uwData[2];
strCalendarTmp.IccHours = stRemoteControl.uwData[3];
strCalendarTmp.IccMin = stRemoteControl.uwData[4];
strCalendarTmp.IccSec = stRemoteControl.uwData[5];
Remarks: by reading the length of the “offset address + data byte”, we can read a continuous
information in the real-time information table. We should pay attention to the "end address =
offset address + byte length /2 + 1", which should not be greater than the largest offset address in
the table.
13/16
MPPT Solar Controller communication protocol February 2018
Response(Received data):
Description:
AA Data packet header
01 Device Type: MPPT Controller
00 Address: 0 broadcast address
03 Commandc:CMD_SET_NO_RESP
00 Data item:Real-time information (Refer to Section 5 for a list of data items)
1C The total data byte length is 28 bytes (14 data)
00 00 Data offset (lower 8 bits left and 8 upper right)
00 00 wChgMode;
2F 00 wPvVolt; 0x002f :47 This means that the PV voltage is 4.7V
。。。。。。。
90 checksum
Write the data,For example, set the battery type
Command:AA 01 00 02 01 04 01 00 01 00 4C
Description:
AA Data packet header
01 Device Type: MPPT Controller
00 Address: 0 broadcast address
02 Command:CMD_SET
01 Data item:Battery parameters (refer to Section 5 Data List)
04 Data region length:4 Refers to the back of "01 00 01 00", a total of four bytes
01 00 Offset address: 0x0100, the low byte is on the left and the high byte is on the right
01 00 Battery type data 0x0001
4C checksum
14/16
MPPT Solar Controller communication protocol February 2018
Response(Received data):
AA 01 00 00 01 00 54
AA Data packet header
01 Device Type: MPPT Controller
00 Address: 0 broadcast address
00 Command:CMD_ACK
01 Data item:Battery parameters (refer to Section 5 Data List)
00 Data length: 0 Indicates there is no data
54 checksum
Time correction:
Write data:AA 01 00 02 06 10 01 00 04 00 01 00 01 00 01 00 02 00 02 00 01 00 30
Description:
AA Data packet header
01 Device Type: MPPT Controller
00 Address: 0 broadcast address
02 Command:CMD_SET
06 Data item:remoteControl
10 Data region length:
01 00 Offset address
04 00 Subcommand
01 00 Year
01 00 Month
01 00 Day
02 00 Hour
02 00 Minute
01 00 Second
30 checksum
说明:
AA Data packet header
01 Device Type: MPPT Controller
00 Address: 0 broadcast address
00 Command:CMD_ACK
06 Data item:remoteControl
00 Data region length:0
4F checksum
The data received indicates that the setting was successful
15/16