Doc: Added byte specification to each command
This commit is contained in:
parent
b937532505
commit
c9508d2660
@ -1,7 +1,25 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* Copyright (C) 2022 Thomas Basler and others
|
||||
* Copyright (C) 2022-2023 Thomas Basler and others
|
||||
*/
|
||||
|
||||
/*
|
||||
This command is used to send a limit to the inverter.
|
||||
|
||||
Derives from DevControlCommand.
|
||||
|
||||
Command structure:
|
||||
SCmd: Sub-Command ID. Is always 0x0b
|
||||
Limit: limit to be set in the inverter
|
||||
Type: absolute / relative and persistant/non-persistant
|
||||
|
||||
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
||||
-------------------------------------------------------------------------------------------------------------------
|
||||
|<------ CRC16 ------>|
|
||||
51 71 60 35 46 80 12 23 04 81 0b 00 00 00 00 00 00 00 00 -- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^^^^ ^^^^^ ^^
|
||||
ID Target Addr Source Addr Cmd SCmd ? Limit Type CRC16 CRC8
|
||||
*/
|
||||
#include "ActivePowerControlCommand.h"
|
||||
#include "inverters/InverterAbstract.h"
|
||||
|
||||
@ -17,7 +35,7 @@ ActivePowerControlCommand::ActivePowerControlCommand(uint64_t target_address, ui
|
||||
_payload[14] = 0x00;
|
||||
_payload[15] = 0x00;
|
||||
|
||||
udpateCRC(CRC_SIZE); // 2 byte crc
|
||||
udpateCRC(CRC_SIZE); // 6 byte crc
|
||||
|
||||
_payload_size = 18;
|
||||
|
||||
|
||||
@ -1,7 +1,25 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* Copyright (C) 2022 Thomas Basler and others
|
||||
* Copyright (C) 2022-2023 Thomas Basler and others
|
||||
*/
|
||||
|
||||
/*
|
||||
This command is used to fetch the eventlog from the inverter.
|
||||
|
||||
Derives from MultiDataCommand
|
||||
|
||||
Command structure:
|
||||
* DT: this specific command uses 0x11
|
||||
* AlarmId: The last event id received from the inverter or zero in case that no events
|
||||
has been received yet. --> Not Implemented yet
|
||||
|
||||
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
||||
-----------------------------------------------------------------------------------------------------------------------
|
||||
|<------------------- CRC16 --------------------->|
|
||||
15 71 60 35 46 80 12 23 04 80 11 00 65 72 06 B8 00 00 00 00 00 00 00 00 00 00 00 -- -- -- -- --
|
||||
^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^^^^^^^ ^^^^^ ^^^^^ ^^^^^^^^^^^ ^^^^^ ^^
|
||||
ID Target Addr Source Addr Idx DT ? Time Gap AlarmId Password CRC16 CRC8
|
||||
*/
|
||||
#include "AlarmDataCommand.h"
|
||||
#include "inverters/InverterAbstract.h"
|
||||
|
||||
|
||||
@ -2,6 +2,20 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Thomas Basler and others
|
||||
*/
|
||||
|
||||
/*
|
||||
Derives from CommandAbstract. Special command to set frequency channel on HMS/HMT inverters.
|
||||
|
||||
Command structure:
|
||||
* ID: fixed identifier and everytime 0x56
|
||||
* CH: Channel to which the inverter will be switched to
|
||||
|
||||
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
56 71 60 35 46 80 12 23 04 02 15 21 00 14 00 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^
|
||||
ID Target Addr Source Addr ? ? ? CH ? CRC8
|
||||
*/
|
||||
#include "ChannelChangeCommand.h"
|
||||
|
||||
ChannelChangeCommand::ChannelChangeCommand(uint64_t target_address, uint64_t router_address, uint8_t channel)
|
||||
|
||||
@ -1,7 +1,31 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* Copyright (C) 2022 Thomas Basler and others
|
||||
* Copyright (C) 2022-2023 Thomas Basler and others
|
||||
*/
|
||||
|
||||
/*
|
||||
Command structure:
|
||||
* Each package has a maximum of 32 bytes
|
||||
* Target Address: the address of the inverter. Has to be read as hex value
|
||||
* Source Address the address of the dtu itself. Has to be read as hex value
|
||||
* CRC8: a crc8 checksum added to the end of the payload containing all valid data.
|
||||
Each sub-commmand has to set it's own payload size.
|
||||
|
||||
Conversion of Target Addr:
|
||||
Inverter Serial Number: (0x)116171603546
|
||||
Target Address: 71 60 35 46
|
||||
|
||||
Conversion of Source Addr:
|
||||
DTU Serial Number: (0x)199980122304
|
||||
Source Address: 80 12 23 04
|
||||
|
||||
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
||||
-----------------------------------------------------------------------------------------------------
|
||||
|<------------- CRC8 ------------>|
|
||||
00 71 60 35 46 80 12 23 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
^^^^^^^^^^^ ^^^^^^^^^^^ ^^
|
||||
Target Addr Source Addr CRC8
|
||||
*/
|
||||
#include "CommandAbstract.h"
|
||||
#include "crc.h"
|
||||
#include <string.h>
|
||||
|
||||
@ -1,8 +1,25 @@
|
||||
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* Copyright (C) 2022 Thomas Basler and others
|
||||
* Copyright (C) 2022-2023 Thomas Basler and others
|
||||
*/
|
||||
|
||||
/*
|
||||
Derives from CommandAbstract. Has a variable length.
|
||||
|
||||
Command structure:
|
||||
* ID: fixed identifier and everytime 0x51
|
||||
* Cmd: Fixed at 0x81 for these types of commands
|
||||
* Payload: dynamic amount of bytes
|
||||
* CRC16: calcuclated over the highlighted amount of bytes
|
||||
|
||||
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|<->| CRC16
|
||||
51 71 60 35 46 80 12 23 04 81 00 00 00 00 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^^^^ ^^ ^^
|
||||
ID Target Addr Source Addr Cmd Payload CRC16 CRC8
|
||||
*/
|
||||
#include "DevControlCommand.h"
|
||||
#include "crc.h"
|
||||
|
||||
|
||||
@ -1,7 +1,23 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* Copyright (C) 2022 Thomas Basler and others
|
||||
* Copyright (C) 2022-2023 Thomas Basler and others
|
||||
*/
|
||||
|
||||
/*
|
||||
This command is used to fetch firmware information from the inverter.
|
||||
|
||||
Derives from MultiDataCommand
|
||||
|
||||
Command structure:
|
||||
* DT: this specific command uses 0x01
|
||||
|
||||
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
||||
-----------------------------------------------------------------------------------------------------------------------
|
||||
|<------------------- CRC16 --------------------->|
|
||||
15 71 60 35 46 80 12 23 04 80 01 00 65 72 06 B8 00 00 00 00 00 00 00 00 00 00 00 -- -- -- -- --
|
||||
^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^ ^^^^^ ^^
|
||||
ID Target Addr Source Addr Idx DT ? Time Gap Password CRC16 CRC8
|
||||
*/
|
||||
#include "DevInfoAllCommand.h"
|
||||
#include "inverters/InverterAbstract.h"
|
||||
|
||||
|
||||
@ -1,7 +1,23 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* Copyright (C) 2022 Thomas Basler and others
|
||||
* Copyright (C) 2022-2023 Thomas Basler and others
|
||||
*/
|
||||
|
||||
/*
|
||||
This command is used to fetch hardware information from the inverter.
|
||||
|
||||
Derives from MultiDataCommand
|
||||
|
||||
Command structure:
|
||||
* DT: this specific command uses 0x00
|
||||
|
||||
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
||||
-----------------------------------------------------------------------------------------------------------------------
|
||||
|<------------------- CRC16 --------------------->|
|
||||
15 71 60 35 46 80 12 23 04 80 00 00 65 72 06 B8 00 00 00 00 00 00 00 00 00 00 00 -- -- -- -- --
|
||||
^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^ ^^^^^ ^^
|
||||
ID Target Addr Source Addr Idx DT ? Time Gap Password CRC16 CRC8
|
||||
*/
|
||||
#include "DevInfoSimpleCommand.h"
|
||||
#include "inverters/InverterAbstract.h"
|
||||
|
||||
|
||||
@ -1,7 +1,23 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* Copyright (C) 2022 Thomas Basler and others
|
||||
* Copyright (C) 2022-2023 Thomas Basler and others
|
||||
*/
|
||||
|
||||
/*
|
||||
This command is used to fetch the grid profile from the inverter.
|
||||
|
||||
Derives from MultiDataCommand
|
||||
|
||||
Command structure:
|
||||
* DT: this specific command uses 0x02
|
||||
|
||||
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
||||
-----------------------------------------------------------------------------------------------------------------------
|
||||
|<------------------- CRC16 --------------------->|
|
||||
15 71 60 35 46 80 12 23 04 80 02 00 65 72 06 B8 00 00 00 00 00 00 00 00 00 00 00 -- -- -- -- --
|
||||
^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^ ^^^^^ ^^
|
||||
ID Target Addr Source Addr Idx DT ? Time Gap Password CRC16 CRC8
|
||||
*/
|
||||
#include "GridOnProFilePara.h"
|
||||
#include "Hoymiles.h"
|
||||
#include "inverters/InverterAbstract.h"
|
||||
|
||||
@ -2,6 +2,29 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2023 Thomas Basler and others
|
||||
*/
|
||||
|
||||
/*
|
||||
Derives from CommandAbstract. Has a fixed length of 26 bytes.
|
||||
|
||||
Command structure:
|
||||
* ID: fixed identifier and everytime 0x15
|
||||
* Idx: the counter of sequencial packages to send. Currently it's only 0x80
|
||||
because all request requests only consist of one package.
|
||||
* DT: repressents the data type and specifies which sub-command to be fetched
|
||||
* Time: represents the current unix timestamp as hex format. The time on the inverter is synced to the sent time.
|
||||
Can be calculated e.g. using the following command
|
||||
echo "obase=16; $(date --date='2023-12-07 18:54:00' +%s)" | bc
|
||||
* Gap: always 0x0
|
||||
* Password: currently always 0x0
|
||||
* CRC16: calcuclated over the highlighted amount of bytes
|
||||
|
||||
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
||||
-----------------------------------------------------------------------------------------------------------------------
|
||||
|<------------------- CRC16 --------------------->|
|
||||
15 71 60 35 46 80 12 23 04 80 00 00 65 72 06 B8 00 00 00 00 00 00 00 00 00 00 00 -- -- -- -- --
|
||||
^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^ ^^^^^ ^^
|
||||
ID Target Addr Source Addr Idx DT ? Time Gap Password CRC16 CRC8
|
||||
*/
|
||||
#include "MultiDataCommand.h"
|
||||
#include "crc.h"
|
||||
|
||||
|
||||
@ -1,7 +1,26 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* Copyright (C) 2022 Thomas Basler and others
|
||||
* Copyright (C) 2022-2023 Thomas Basler and others
|
||||
*/
|
||||
|
||||
/*
|
||||
This command is used to power cycle the inverter.
|
||||
|
||||
Derives from DevControlCommand.
|
||||
|
||||
Command structure:
|
||||
SCmd: Sub-Command ID
|
||||
00 --> Turn On
|
||||
01 --> Turn Off
|
||||
02 --> Restart
|
||||
|
||||
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
||||
---------------------------------------------------------------------------------------------------------------
|
||||
|<--->| CRC16
|
||||
51 71 60 35 46 80 12 23 04 81 00 00 00 00 00 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^
|
||||
ID Target Addr Source Addr Cmd SCmd ? CRC16 CRC8
|
||||
*/
|
||||
#include "PowerControlCommand.h"
|
||||
#include "inverters/InverterAbstract.h"
|
||||
|
||||
|
||||
@ -2,6 +2,22 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2023 Thomas Basler and others
|
||||
*/
|
||||
|
||||
/*
|
||||
This command is used to fetch live run time data from the inverter.
|
||||
|
||||
Derives from MultiDataCommand
|
||||
|
||||
Command structure:
|
||||
* DT: this specific command uses 0x0b
|
||||
|
||||
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
||||
-----------------------------------------------------------------------------------------------------------------------
|
||||
|<------------------- CRC16 --------------------->|
|
||||
15 71 60 35 46 80 12 23 04 80 0b 00 65 72 06 B8 00 00 00 00 00 00 00 00 00 00 00 -- -- -- -- --
|
||||
^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^ ^^^^^ ^^
|
||||
ID Target Addr Source Addr Idx DT ? Time Gap Password CRC16 CRC8
|
||||
*/
|
||||
#include "RealTimeRunDataCommand.h"
|
||||
#include "Hoymiles.h"
|
||||
#include "inverters/InverterAbstract.h"
|
||||
|
||||
@ -1,7 +1,25 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* Copyright (C) 2022 Thomas Basler and others
|
||||
* Copyright (C) 2022-2023 Thomas Basler and others
|
||||
*/
|
||||
|
||||
/*
|
||||
This command is used to re-request a specific fragment returned by a MultiDataCommand from the inverter.
|
||||
|
||||
Derives from SingleDataCommand. Has a fixed length of 10 bytes.
|
||||
|
||||
Command structure:
|
||||
* ID: fixed identifier and everytime 0x15
|
||||
* Idx: the counter of sequencial packages to send. Currently it's only 0x80
|
||||
because all request requests only consist of one package.
|
||||
* Frm: is set to the fragment id to re-request. "Or" operation with 0x80 is applied to the frame.
|
||||
|
||||
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
15 71 60 35 46 80 12 23 04 85 00 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^
|
||||
ID Target Addr Source Addr Frm CRC8
|
||||
*/
|
||||
#include "RequestFrameCommand.h"
|
||||
|
||||
RequestFrameCommand::RequestFrameCommand(uint64_t target_address, uint64_t router_address, uint8_t frame_no)
|
||||
|
||||
@ -1,7 +1,22 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* Copyright (C) 2022 Thomas Basler and others
|
||||
* Copyright (C) 2022-2023 Thomas Basler and others
|
||||
*/
|
||||
|
||||
/*
|
||||
This command is used to send simple commands, containing only one payload, to the inverter.
|
||||
|
||||
Derives from CommandAbstract.
|
||||
|
||||
Command structure:
|
||||
* ID: fixed identifier and everytime 0x15
|
||||
|
||||
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
15 71 60 35 46 80 12 23 04 00 00 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^
|
||||
ID Target Addr Source Addr CRC8
|
||||
*/
|
||||
#include "SingleDataCommand.h"
|
||||
|
||||
SingleDataCommand::SingleDataCommand(uint64_t target_address, uint64_t router_address)
|
||||
|
||||
@ -2,6 +2,22 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2023 Thomas Basler and others
|
||||
*/
|
||||
|
||||
/*
|
||||
This command is used to fetch current set limits from the inverter.
|
||||
|
||||
Derives from MultiDataCommand
|
||||
|
||||
Command structure:
|
||||
* DT: this specific command uses 0x05
|
||||
|
||||
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
||||
-----------------------------------------------------------------------------------------------------------------------
|
||||
|<------------------- CRC16 --------------------->|
|
||||
15 71 60 35 46 80 12 23 04 80 05 00 65 72 06 B8 00 00 00 00 00 00 00 00 00 00 00 -- -- -- -- --
|
||||
^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^ ^^^^^ ^^
|
||||
ID Target Addr Source Addr Idx DT ? Time Gap Password CRC16 CRC8
|
||||
*/
|
||||
#include "SystemConfigParaCommand.h"
|
||||
#include "Hoymiles.h"
|
||||
#include "inverters/InverterAbstract.h"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user