diff --git a/tools/esp8266/User_Manual.md b/tools/esp8266/User_Manual.md index 3bfb4f50..cf215e13 100644 --- a/tools/esp8266/User_Manual.md +++ b/tools/esp8266/User_Manual.md @@ -10,7 +10,7 @@ In the initial case or after click "erase settings" the fields for the inverter Set at least the serial number and a name for each inverter, check the "reboot after save" and click the "Save" button. ## Active Power Limit via Setup Page -If you leave the field "Active Power Limit" empty during the setup and reboot the ahoy-dtu a value of 65535 will be filled in. +If you leave the field "Active Power Limit" empty during the setup and reboot the ahoy-dtu will set a value of 65535 in the setup. That is the value you have to fill in case you want to operate the inverter without a active power limit. If the value is 65535 or -1 after another reboot the value will be set automatically to "100" and in the drop-down menu "relative in percent persistent" will be set. Of course you can do this also by your self. @@ -24,12 +24,12 @@ and if this settings shall be after a power cycle of the inverter (P_DC=0 and P_AC=0 for at least 10 seconds) The user has to ensure correct settings. Remember that for the inverters of 3rd generation the relative active power limit is in the range of 2% up to 100%. -Also an absolute active power limit below approx. 30Watt is not correct because of the control capabilities and reactive power load. +Also an absolute active power limit below approx. 30 Watt seems to be not meanful because of the control capabilities and reactive power load. ## Active Power Limit via MQTT -The ahoy-dtu subscribes on the topic /devcontrol/# if the mqtt broker is set-up correctly. The default topic is inverter/devcontrol/#. +The ahoy-dtu subscribes on the topic ``/devcontrol/#`` if the mqtt broker is set-up correctly. The default topic is ``inverter/devcontrol/#``. -To set the absolut active power limit you have four options. +To set the active power limit (controled value is the AC Power of the inverter) you have four options. (Only single phase inverters are actually in focus). | topic | payload | active power limit in | Condition | @@ -40,9 +40,9 @@ To set the absolut active power limit you have four options. | /devcontrol//11/257 | [2...100] | % | persistent ### Developer Information MQTT Interface -/devcontrol/// +``/devcontrol///`` -The implementation allows to set any of the available Commands: +The implementation allows to set any of the available ```` Commands: ```C typedef enum { TurnOn = 0, // 0x00 @@ -58,9 +58,34 @@ The implementation allows to set any of the available Commands: Init = 0xff } DevControlCmdType; ``` -The MQTT payload will be set on first to bytes and DATA2 will be set on the second two bytes if the corresponding DevControlCmdType supports 4 byte data. +The MQTT payload will be set on first to bytes and ````, which is taken from the topic path will be set on the second two bytes if the corresponding DevControlCmdType supports 4 byte data. +See here the actual implementation to set the send buffer bytes. +```C + void sendControlPacket(uint64_t invId, uint8_t cmd, uint16_t *data) { + sendCmdPacket(invId, TX_REQ_DEVCONTROL, ALL_FRAMES, false); + int cnt = 0; + // cmd --> 0x0b => Type_ActivePowerContr, 0 on, 1 off, 2 restart, 12 reactive power, 13 power factor + mTxBuf[10] = cmd; + mTxBuf[10 + (++cnt)] = 0x00; + if (cmd >= ActivePowerContr && cmd <= PFSet){ + mTxBuf[10 + (++cnt)] = ((data[0] * 10) >> 8) & 0xff; // power limit || high byte from MQTT payload + mTxBuf[10 + (++cnt)] = ((data[0] * 10) ) & 0xff; // power limit || low byte from MQTT payload + mTxBuf[10 + (++cnt)] = ((data[1] ) >> 8) & 0xff; // high byte from MQTT topic value + mTxBuf[10 + (++cnt)] = ((data[1] ) ) & 0xff; // low byte from MQTT topic value + } + // crc control data + uint16_t crc = Hoymiles::crc16(&mTxBuf[10], cnt+1); + mTxBuf[10 + (++cnt)] = (crc >> 8) & 0xff; + mTxBuf[10 + (++cnt)] = (crc ) & 0xff; + // crc over all + cnt +=1; + mTxBuf[10 + cnt] = Hoymiles::crc8(mTxBuf, 10 + cnt); + + sendPacket(invId, mTxBuf, 10 + (++cnt), true); + } +``` -So as example sending any payload on inverter/devcontrol/0/1 will switch off the inverter. +So as example sending any payload on ``inverter/devcontrol/0/1`` will switch off the inverter. ## Active Power Limit via REST API It is also implemented to set the power limit via REST API call. Therefore send a POST request to the endpoint /api. @@ -107,7 +132,16 @@ Example to set the active power limit persistent to 600Watt ``` ### Developer Information REST API -In the same approach as for MQTT any other SubCmd can be applied and the response payload can be observed in the serial logs. Eg. request the Alarm Data. +In the same approach as for MQTT any other SubCmd and also MainCmd can be applied and the response payload can be observed in the serial logs. Eg. request the Alarm-Data from the Alarm-Index 5 from inverter 0 will look like this: +```json +{ + "inverter":0, + "tx_request": 21, + "cmd": 17, + "payload": 5, + "payload2": 0 +} +``` ## Issues and Debuging for active power limit settings @@ -120,25 +154,25 @@ In case of issues please report: **Developer Information General for Active Power Limit** -⚡To be verified by field tests and feedback +⚡Was verified by field tests and feedback from three users Internally this values will be set for the second two bytes for MainCmd: 0x51 SubCmd: 0x0b --> DevControl set ActivePowerLimit ```C -typedef enum { // ToDo: to be verified by field tests - AbsolutNonPersistent = 0x0000, // 0 - RelativNonPersistent = 0x0001, // 1 - AbsolutPersistent = 0x0100, // 256 - RelativPersistent = 0x0101 // 257 +typedef enum { + AbsolutNonPersistent = 0x0000, // 0 + RelativNonPersistent = 0x0001, // 1 + AbsolutPersistent = 0x0100, // 256 + RelativPersistent = 0x0101 // 257 } PowerLimitControlType; ``` ## Firmware Version collection Gather user inverter information here to understand what differs between some inverters. -| Name | Inverter Typ | Bootloader V. | FWVersion | FWBuildYe | FWBuildMo | HWPartId | | | +| Name | Inverter Typ | Bootloader V. | FWVersion | FWBuild [YYYY] | FWBuild [MM-DD] | HWPartId | | | | ---------------- | ----------- | -------------- | ----------- | ----------- | ----------- | ----------- | -------- | -------- | -| DanielR92 | HM-1500 | | 10016.000 | 2021.000 | 1012.000 | 100.000 | | | -| isdor | HM-300 | | 10014.000 | 2021.000 | 1209.000 | 102.000 | | | -| aschiffler | HM-1500 | | 10012.000 | 2020.000 | 624.000 | 100.000 | | | -| klahus1 | HM-300 | | 10010.000 | 2020.000 | 707.000 | 102.000 | | | -| eeprom23 | HM-1200 | 0.1.0 | 1.0.18 | 2021(-12-24) | 12-24 | 269619201 | 18:21:00 | HWRev 256 | -| eeprom23 | HM-1200 2t | 0.1.0 | 1.0.16 | 2021(-10-12) | 10-12 | 269619207 | 17:06:00 | HWRev 256 | +| DanielR92 | HM-1500 | | 1.0.16 | 2021 | 10-12 | 100 | | | +| isdor | HM-300 | | 1.0.14 | 2021 | 12-09 | 102 | | | +| aschiffler | HM-1500 | | 1.0.12 | 2020 | 06-24 | 100 | | | +| klahus1 | HM-300 | | 1.0.10 | 2020 | 07-07 | 102 | | | +| eeprom23 | HM-1200 | 0.1.0 | 1.0.18 | 2021 | 12-24 | 269619201 | 18:21:00 | HWRev 256 | +| eeprom23 | HM-1200 2t | 0.1.0 | 1.0.16 | 2021 | 10-12 | 269619207 | 17:06:00 | HWRev 256 |