Skip to content

Commit

Permalink
Merge remote-tracking branch 'tbnobody/OpenDTU/master' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
helgeerbe committed Oct 10, 2023
2 parents 116da05 + 2991af7 commit b461aff
Show file tree
Hide file tree
Showing 10 changed files with 189 additions and 147 deletions.
2 changes: 2 additions & 0 deletions lib/Hoymiles/src/HoymilesRadio_CMT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ void HoymilesRadio_CMT::loop()
f.len = _radio->getDynamicPayloadSize();
f.channel = _radio->getChannel();
f.rssi = _radio->getRssiDBm();
f.wasReceived = false;
f.mainCmd = 0x00;
if (f.len > MAX_RF_PAYLOAD_SIZE) {
f.len = MAX_RF_PAYLOAD_SIZE;
}
Expand Down
54 changes: 44 additions & 10 deletions lib/Hoymiles/src/parser/AlarmLogParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,31 @@
const std::array<const AlarmMessage_t, ALARM_MSG_COUNT> AlarmLogParser::_alarmMessages = { {
{ AlarmMessageType_t::ALL, 1, "Inverter start" },
{ AlarmMessageType_t::ALL, 2, "DTU command failed" },
{ AlarmMessageType_t::ALL, 73, "Temperature >80°C" }, // https://github.com/tbnobody/OpenDTU/discussions/590#discussioncomment-6049750
{ AlarmMessageType_t::ALL, 3, "EEPROM reading and writing error during operation" },
{ AlarmMessageType_t::ALL, 4, "Offline" },
{ AlarmMessageType_t::ALL, 11, "Grid voltage surge" },
{ AlarmMessageType_t::ALL, 12, "Grid voltage sharp drop" },
{ AlarmMessageType_t::ALL, 13, "Grid frequency mutation" },
{ AlarmMessageType_t::ALL, 14, "Grid phase mutation" },
{ AlarmMessageType_t::ALL, 15, "Grid transient fluctuation" },
{ AlarmMessageType_t::ALL, 36, "INV overvoltage or overcurrent" },
{ AlarmMessageType_t::ALL, 46, "FB overvoltage" },
{ AlarmMessageType_t::ALL, 47, "FB overcurrent" },
{ AlarmMessageType_t::ALL, 48, "FB clamp overvoltage" },
{ AlarmMessageType_t::ALL, 49, "FB clamp overvoltage" },
{ AlarmMessageType_t::ALL, 61, "Calibration parameter error" },
{ AlarmMessageType_t::ALL, 62, "System configuration parameter error" },
{ AlarmMessageType_t::ALL, 63, "Abnormal power generation data" },
{ AlarmMessageType_t::ALL, 71, "VW function enable" },
{ AlarmMessageType_t::ALL, 72, "FW function enable" },
{ AlarmMessageType_t::ALL, 73, "TW function enable" },
{ AlarmMessageType_t::ALL, 95, "PV module in suspected shadow" },
{ AlarmMessageType_t::ALL, 96, "PV module in suspected shadow" },
{ AlarmMessageType_t::ALL, 97, "PV module in suspected shadow" },
{ AlarmMessageType_t::ALL, 98, "PV module in suspected shadow" },
{ AlarmMessageType_t::ALL, 121, "Over temperature protection" },
{ AlarmMessageType_t::ALL, 122, "Microinverter is suspected of being stolen" },
{ AlarmMessageType_t::ALL, 123, "Locked by remote control" },
{ AlarmMessageType_t::ALL, 124, "Shut down by remote control" },
{ AlarmMessageType_t::ALL, 125, "Grid configuration parameter error" },
{ AlarmMessageType_t::ALL, 126, "Software error code 126" },
Expand All @@ -27,7 +50,10 @@ const std::array<const AlarmMessage_t, ALARM_MSG_COUNT> AlarmLogParser::_alarmMe
{ AlarmMessageType_t::ALL, 147, "Grid: Power grid outage" },
{ AlarmMessageType_t::ALL, 148, "Grid: Grid disconnection" },
{ AlarmMessageType_t::ALL, 149, "Grid: Island detected" },
{ AlarmMessageType_t::ALL, 150, "DCI exceeded" },
{ AlarmMessageType_t::HMT, 171, "Grid: Abnormal phase difference between phase to phase" },
{ AlarmMessageType_t::ALL, 181, "Abnormal insulation impedance" },
{ AlarmMessageType_t::ALL, 182, "Abnormal grounding" },
{ AlarmMessageType_t::ALL, 205, "MPPT-A: Input overvoltage" },
{ AlarmMessageType_t::ALL, 206, "MPPT-B: Input overvoltage" },
{ AlarmMessageType_t::ALL, 207, "MPPT-A: Input undervoltage" },
Expand All @@ -52,20 +78,21 @@ const std::array<const AlarmMessage_t, ALARM_MSG_COUNT> AlarmLogParser::_alarmMe
{ AlarmMessageType_t::ALL, 221, "PV-4: Input overvoltage" },
{ AlarmMessageType_t::HMT, 221, "Abnormal wiring of grid neutral line" },
{ AlarmMessageType_t::ALL, 222, "PV-4: Input undervoltage" },
{ AlarmMessageType_t::ALL, 301, "Hardware error code 301" },
{ AlarmMessageType_t::ALL, 302, "Hardware error code 302" },
{ AlarmMessageType_t::ALL, 303, "Hardware error code 303" },
{ AlarmMessageType_t::ALL, 304, "Hardware error code 304" },
{ AlarmMessageType_t::ALL, 305, "Hardware error code 305" },
{ AlarmMessageType_t::ALL, 306, "Hardware error code 306" },
{ AlarmMessageType_t::ALL, 307, "Hardware error code 307" },
{ AlarmMessageType_t::ALL, 308, "Hardware error code 308" },
{ AlarmMessageType_t::ALL, 301, "Hardware error code 301 - FB short circuit failure" },
{ AlarmMessageType_t::ALL, 302, "Hardware error code 302 - FB short circuit failure" },
{ AlarmMessageType_t::ALL, 303, "Hardware error code 303 - FB overcurrent protection failure" },
{ AlarmMessageType_t::ALL, 304, "Hardware error code 304 - FB overcurrent protection failure" },
{ AlarmMessageType_t::ALL, 305, "Hardware error code 305 - FB clamp circuit failure" },
{ AlarmMessageType_t::ALL, 306, "Hardware error code 306 - FB clamp circuit failure" },
{ AlarmMessageType_t::ALL, 307, "Hardware error code 307 - INV power device failure" },
{ AlarmMessageType_t::ALL, 308, "Hardware error code 308 - INV overcurrent or overvoltage protection failure" },
{ AlarmMessageType_t::ALL, 309, "Hardware error code 309" },
{ AlarmMessageType_t::ALL, 310, "Hardware error code 310" },
{ AlarmMessageType_t::ALL, 311, "Hardware error code 311" },
{ AlarmMessageType_t::ALL, 312, "Hardware error code 312" },
{ AlarmMessageType_t::ALL, 313, "Hardware error code 313" },
{ AlarmMessageType_t::ALL, 314, "Hardware error code 314" },
{ AlarmMessageType_t::ALL, 1111, "Repeater" },
{ AlarmMessageType_t::ALL, 5041, "Error code-04 Port 1" },
{ AlarmMessageType_t::ALL, 5042, "Error code-04 Port 2" },
{ AlarmMessageType_t::ALL, 5043, "Error code-04 Port 3" },
Expand All @@ -79,10 +106,17 @@ const std::array<const AlarmMessage_t, ALARM_MSG_COUNT> AlarmLogParser::_alarmMe
{ AlarmMessageType_t::ALL, 5080, "Grid Overvoltage/Undervoltage" },
{ AlarmMessageType_t::ALL, 5090, "Grid Overfrequency/Underfrequency" },
{ AlarmMessageType_t::ALL, 5100, "Island detected" },
{ AlarmMessageType_t::ALL, 5110, "GFDI" },
{ AlarmMessageType_t::ALL, 5120, "EEPROM reading and writing error" },
{ AlarmMessageType_t::ALL, 5141, "FB clamp overvoltage" },
{ AlarmMessageType_t::ALL, 5142, "FB clamp overvoltage" },
{ AlarmMessageType_t::ALL, 5143, "FB clamp overvoltage" },
{ AlarmMessageType_t::ALL, 5144, "FB clamp overvoltage" },
{ AlarmMessageType_t::ALL, 5150, "10 min value grid overvoltage" },
{ AlarmMessageType_t::ALL, 5160, "Grid transient fluctuation" },
{ AlarmMessageType_t::ALL, 5200, "Firmware error" },
{ AlarmMessageType_t::ALL, 8310, "Shut down" },
{ AlarmMessageType_t::ALL, 8310, "Shut down by remote control" },
{ AlarmMessageType_t::ALL, 8320, "Locked by remote control" },
{ AlarmMessageType_t::ALL, 9000, "Microinverter is suspected of being stolen" },
} };

Expand Down
2 changes: 1 addition & 1 deletion lib/Hoymiles/src/parser/AlarmLogParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define ALARM_LOG_ENTRY_SIZE 12
#define ALARM_LOG_PAYLOAD_SIZE (ALARM_LOG_ENTRY_COUNT * ALARM_LOG_ENTRY_SIZE + 4)

#define ALARM_MSG_COUNT 77
#define ALARM_MSG_COUNT 111

struct AlarmLogEntry_t {
uint16_t MessageId;
Expand Down
2 changes: 2 additions & 0 deletions lib/Hoymiles/src/parser/DevInfoParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ const devInfo_t devInfo[] = {
{ { 0x10, 0x21, 0x11, ALL }, 600, "HMS-600" }, // 01
{ { 0x10, 0x21, 0x41, ALL }, 800, "HMS-800" }, // 00
{ { 0x10, 0x11, 0x51, ALL }, 900, "HMS-900" }, // 01
{ { 0x10, 0x21, 0x51, ALL }, 900, "HMS-900" }, // 03
{ { 0x10, 0x21, 0x71, ALL }, 1000, "HMS-1000" }, // 05
{ { 0x10, 0x11, 0x71, ALL }, 1000, "HMS-1000" }, // 01
{ { 0x10, 0x22, 0x41, ALL }, 1600, "HMS-1600" }, // 4
{ { 0x10, 0x12, 0x51, ALL }, 1800, "HMS-1800" }, // 01
{ { 0x10, 0x22, 0x51, ALL }, 1800, "HMS-1800" }, // 16
Expand Down
4 changes: 2 additions & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ lib_deps =
https://github.com/yubox-node-org/ESPAsyncWebServer
bblanchon/ArduinoJson @ ^6.21.3
https://github.com/bertmelis/espMqttClient.git#v1.4.5
nrf24/RF24 @ ^1.4.7
olikraus/U8g2 @ ^2.35.4
nrf24/RF24 @ ^1.4.8
olikraus/U8g2 @ ^2.35.7
buelowp/sunset @ ^1.1.7
https://github.com/coryjfowler/MCP_CAN_lib
plerup/EspSoftwareSerial@^8.0.1
Expand Down
4 changes: 4 additions & 0 deletions src/WebApi_prometheus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ void WebApiPrometheusClass::loop()

void WebApiPrometheusClass::onPrometheusMetricsGet(AsyncWebServerRequest* request)
{
if (!WebApi.checkCredentialsReadonly(request)) {
return;
}

try {
auto stream = request->beginResponseStream("text/plain; charset=utf-8", 4096 * INV_MAX_COUNT); // TODO(helge) check if this calculation is correct

Expand Down
26 changes: 13 additions & 13 deletions webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,34 @@
"dependencies": {
"@popperjs/core": "^2.11.8",
"bootstrap": "^5.3.2",
"bootstrap-icons-vue": "^1.10.3",
"bootstrap-icons-vue": "^1.11.1",
"mitt": "^3.0.1",
"sortablejs": "^1.15.0",
"spark-md5": "^3.0.2",
"vue": "^3.3.4",
"vue-i18n": "^9.4.1",
"vue-router": "^4.2.4"
"vue-i18n": "^9.5.0",
"vue-router": "^4.2.5"
},
"devDependencies": {
"@intlify/unplugin-vue-i18n": "^1.2.0",
"@rushstack/eslint-patch": "^1.4.0",
"@intlify/unplugin-vue-i18n": "^1.4.0",
"@rushstack/eslint-patch": "^1.5.1",
"@tsconfig/node18": "^18.2.2",
"@types/bootstrap": "^5.2.7",
"@types/node": "^20.6.2",
"@types/sortablejs": "^1.15.2",
"@types/node": "^20.8.3",
"@types/sortablejs": "^1.15.3",
"@types/spark-md5": "^3.0.2",
"@vitejs/plugin-vue": "^4.3.4",
"@vitejs/plugin-vue": "^4.4.0",
"@vue/eslint-config-typescript": "^12.0.0",
"@vue/tsconfig": "^0.4.0",
"eslint": "^8.49.0",
"eslint": "^8.51.0",
"eslint-plugin-vue": "^9.17.0",
"npm-run-all": "^4.1.5",
"sass": "^1.67.0",
"terser": "^5.19.4",
"sass": "^1.69.0",
"terser": "^5.21.0",
"typescript": "^5.2.2",
"vite": "^4.4.9",
"vite": "^4.4.11",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-css-injected-by-js": "^3.3.0",
"vue-tsc": "^1.8.11"
"vue-tsc": "^1.8.18"
}
}
9 changes: 8 additions & 1 deletion webapp/src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -757,4 +757,11 @@ export default defineComponent({
}
},
});
</script>
</script>
<style>
.btn-group {
border-radius: var(--bs-border-radius);
margin-top: 0.25rem;
}
</style>
Loading

0 comments on commit b461aff

Please sign in to comment.