diff --git a/tools/esp8266/README.md b/tools/esp8266/README.md index 66660bcd..cdb120cd 100644 --- a/tools/esp8266/README.md +++ b/tools/esp8266/README.md @@ -13,6 +13,13 @@ This code can be compiled using Arduino. The settings were: - Board: Generic ESP8266 Module - Flash-Size: 1MB (FS: none, OTA: 502kB) +### Optional Configuration before compilation + +- number of supported inverters (set to 3 by default) `defines.h` +- enable channel hopping `hmRadio.h` +- DTU radio id `hmRadio.h` +- unformated list in webbrowser `/livedata` `defines.h`, `LIVEDATA_VISUALIZED` + ## Flash ESP with firmware @@ -21,12 +28,12 @@ This code can be compiled using Arduino. The settings were: 3. the ESP will start as access point (AP) if there is no network config stored in its eeprom 4. connect to the AP, you will be forwarded to the setup page 5. configure your WiFi settings, save, repower -6. check your router for the IP address of the module +6. check your router or serial console for the IP address of the module. You can try ping the configured device name as well. ## Usage -Connect the ESP to power and to your serial console. The webinterface has the following abilities: +Connect the ESP to power and to your serial console (optional). The webinterface has the following abilities: - OTA Update (over the air update) - Configuration (Wifi, inverter(s), Pinout, MQTT) @@ -40,11 +47,14 @@ The serial console will print the converted values which were read out of the in For now the following inverters should work out of the box: +- HM400 - HM600 +- HM800 - HM1200 ## USED LIBRARIES - `Time` - `RF24` +- `PubSubClient` diff --git a/tools/esp8266/defines.h b/tools/esp8266/defines.h index 1aa22cee..f5c57530 100644 --- a/tools/esp8266/defines.h +++ b/tools/esp8266/defines.h @@ -25,7 +25,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 2 -#define VERSION_PATCH 11 +#define VERSION_PATCH 12 //------------------------------------- diff --git a/tools/esp8266/hmInverters.h b/tools/esp8266/hmInverters.h index 0b516410..aa64a64b 100644 --- a/tools/esp8266/hmInverters.h +++ b/tools/esp8266/hmInverters.h @@ -20,9 +20,9 @@ const char* const fields[] = {"U_DC", "I_DC", "P_DC", "YieldDay", "YieldWeek", " enum {CH0 = 0, CH1, CH2, CH3, CH4}; enum {CMD01 = 0x01, CMD02, CMD03, CMD82 = 0x82, CMD83, CMD84}; -enum {INV_TYPE_HM600 = 0, INV_TYPE_HM1200, INV_TYPE_HM400}; -const char* const invTypes[] = {"HM600", "HM1200 / HM1500", "HM400"}; -#define NUM_INVERTER_TYPES 3 +enum {INV_TYPE_HM600 = 0, INV_TYPE_HM1200, INV_TYPE_HM400, INV_TYPE_HM800}; +const char* const invTypes[] = {"HM600", "HM1200 / HM1500", "HM400", "HM800"}; +#define NUM_INVERTER_TYPES 4 typedef struct { uint8_t fieldId; // field id @@ -96,6 +96,30 @@ const byteAssign_t hm600assignment[] = { #define HM600_LIST_LEN (sizeof(hm600assignment) / sizeof(byteAssign_t)) +//------------------------------------- +// HM800 +//------------------------------------- +const byteAssign_t hm800assignment[] = { + + { FLD_UDC, UNIT_V, CH1, CMD01, 3, 2, 10 }, + { FLD_IDC, UNIT_A, CH1, CMD01, 5, 2, 100 }, + { FLD_PDC, UNIT_W, CH1, CMD01, 7, 2, 10 }, + { FLD_UDC, UNIT_V, CH2, CMD01, 9, 2, 10 }, + { FLD_IDC, UNIT_A, CH2, CMD01, 11, 2, 100 }, + { FLD_PDC, UNIT_W, CH2, CMD01, 13, 2, 10 }, + { FLD_YW, UNIT_WH, CH0, CMD02, 1, 2, 1 }, + { FLD_YT, UNIT_KWH, CH0, CMD02, 3, 4, 1000 }, + { FLD_YD, UNIT_WH, CH1, CMD02, 7, 2, 1 }, + { FLD_YD, UNIT_WH, CH2, CMD02, 9, 2, 1 }, + { FLD_UAC, UNIT_V, CH0, CMD02, 11, 2, 10 }, + { FLD_F, UNIT_HZ, CH0, CMD02, 13, 2, 100 }, + { FLD_PAC, UNIT_W, CH0, CMD02, 15, 2, 10 }, + { FLD_IAC, UNIT_A, CH0, CMD83, 3, 2, 100 }, + { FLD_T, UNIT_C, CH0, CMD83, 7, 2, 10 } +}; +#define HM800_LIST_LEN (sizeof(hm800assignment) / sizeof(byteAssign_t)) + + //------------------------------------- // HM1200, HM1500 //------------------------------------- diff --git a/tools/esp8266/hmSystem.h b/tools/esp8266/hmSystem.h index 70afe6b7..64af10b6 100644 --- a/tools/esp8266/hmSystem.h +++ b/tools/esp8266/hmSystem.h @@ -137,18 +137,22 @@ class HmSystem { } void getAssignment(inverter_t *p) { - if(INV_TYPE_HM600 == p->type) { + if(INV_TYPE_HM400 == p->type) { + p->listLen = (uint8_t)(HM400_LIST_LEN); + p->assign = (byteAssign_t*)hm400assignment; + } + else if(INV_TYPE_HM600 == p->type) { p->listLen = (uint8_t)(HM600_LIST_LEN); p->assign = (byteAssign_t*)hm600assignment; } + else if(INV_TYPE_HM800 == p->type) { + p->listLen = (uint8_t)(HM800_LIST_LEN); + p->assign = (byteAssign_t*)hm800assignment; + } else if(INV_TYPE_HM1200 == p->type) { p->listLen = (uint8_t)(HM1200_LIST_LEN); p->assign = (byteAssign_t*)hm1200assignment; } - else if(INV_TYPE_HM400 == p->type) { - p->listLen = (uint8_t)(HM400_LIST_LEN); - p->assign = (byteAssign_t*)hm400assignment; - } else { p->listLen = 0; p->assign = NULL;