Skip to content

Commit 292bb7c

Browse files
authored
Merge pull request #517 from IgorYbema/main
release v3.8
2 parents 48a411d + dbeb9d0 commit 292bb7c

16 files changed

+52
-52
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
arduino-cli core install esp32:esp32
2929

3030
- name: Install dependencies
31-
run: arduino-cli lib install ringbuffer pubsubclient arduinojson dallastemperature onewire WebSockets "Adafruit NeoPixel"
31+
run: arduino-cli lib install ringbuffer pubsubclient arduinojson dallastemperature onewire "Adafruit NeoPixel"
3232

3333
- name: Fix Onewire lib for ESP32-3.0.0
3434
run: |

HeatPumpType.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Assuming that bytes from #129 to #138 are unique for each model of Aquarea heat
5050
|43 | 32 D4 0B 89 84 73 90 0C 86 84 | Monoblock | WH-MXC16J9E8 | Monoblock | 16 | 3ph | T-CAP |
5151
|44 | 32 D4 0B 00 78 62 90 0B 02 78 | Monoblock | WH-MXC12J6E5 | Monoblock | 12 | 1ph | T-CAP |
5252
|45 | E2 CF 0B 82 05 12 D0 0D 91 05 | WH-SQC09H3E8 | WH-UQ09HE8 | KIT-WQC09H3E8 | 9 | 3ph | T-CAP - Super Quiet revised model |
53-
53+
|46 | E2 D5 0D 99 94 02 D6 0D 68 95 | WH-ADC0309K3E5 | WH-UDZ09KE5 | KIT-ADC09K3E5 | 9 | 1ph | HP - K-series All-in-One R32 |
5454

5555
All bytes are used for Heat Pump model identification in the code.
5656

HeishaMon/HeishaMon.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,13 @@ void check_wifi() {
231231
}
232232
} else {
233233
log_message(_F("Reconnecting to WiFi failed. Waiting a few seconds before trying again."));
234+
#ifdef ESP8266
234235
WiFi.disconnect(true);
236+
#else
237+
WiFi.mode(WIFI_MODE_APSTA);
238+
WiFi.disconnect(true);
239+
WiFi.mode(WIFI_MODE_AP);
240+
#endif
235241
}
236242
}
237243
}

HeishaMon/decode.h

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ String getUintt16(char * data, byte input);
3838
static const char _unknown[] PROGMEM = "unknown";
3939

4040
static const char *Model[] PROGMEM = {
41-
"46", //string representation of number of known models (last model number + 1)
41+
"47", //string representation of number of known models (last model number + 1)
4242
"WH-MDC05H3E5", //0
4343
"WH-MDC07H3E5", //1
4444
"IDU:WH-SXC09H3E5, ODU:WH-UX09HE5", //2
@@ -56,35 +56,36 @@ static const char *Model[] PROGMEM = {
5656
"IDU:WH-SQC09H3E8, ODU:WH-UQ09HE8", //14
5757
"IDU:WH-SDC09H3E5, ODU:WH-UD09HE5", //15
5858
"IDU:WH-ADC0309H3E5, ODU:WH-UD09HE5", //16
59-
"IDU:WH-ADC0309J3E5, ODU: WH-UD05JE5", //17
60-
"IDU: WH-SDC0709J3E5, ODU: WH-UD07JE5", //18
61-
"IDU: WH-SDC07H3E5-1, ODU: WH-UD07HE5-1", //19
59+
"IDU:WH-ADC0309J3E5, ODU:WH-UD05JE5", //17
60+
"IDU:WH-SDC0709J3E5, ODU:WH-UD07JE5", //18
61+
"IDU:WH-SDC07H3E5-1, ODU:WH-UD07HE5-1", //19
6262
"WH-MDC07J3E5", //20
6363
"WH-MDC09J3E5", //21
64-
"IDU: WH-SDC0305J3E5, ODU: WH-UD05JE5", //22
64+
"IDU:WH-SDC0305J3E5, ODU:WH-UD05JE5", //22
6565
"WH-MXC09J3E8", //23
6666
"WH-MXC12J9E8", //24
67-
"IDU: WH-ADC1216H6E5, ODU: WH-UD12HE5", //25
68-
"IDU: WH-ADC0309J3E5C, ODU: WH-UD07JE5", //26
67+
"IDU:WH-ADC1216H6E5, ODU:WH-UD12HE5", //25
68+
"IDU:WH-ADC0309J3E5C, ODU:WH-UD07JE5", //26
6969
"WH-MDC07J3E5", //27
7070
"WH-MDC05J3E5", //28
71-
"IDU: WH-UQ12HE8, ODU: WH-SQC12H9E8", //29
72-
"IDU: WH-SXC12H6E5, ODU: WH-UX12HE5", //30
71+
"IDU:WH-UQ12HE8, ODU:WH-SQC12H9E8", //29
72+
"IDU:WH-SXC12H6E5, ODU:WH-UX12HE5", //30
7373
"WH-MDC09J3E5", //31
7474
"WH-MXC09J3E5", //32
75-
"IDU: WH-ADC1216H6E5C ODU: WH-UD12HE5", //33
76-
"IDU: WH-ADC0509L3E5 ODU: WH-WDG07LE5", //34
77-
"IDU: WH-SXC09H3E8 ODU: WH-UX09HE8", //35
78-
"IDU: WH-ADC0309K3E5AN ODU: WH-UDZ07KE5", //36
79-
"IDU: WH-SDC0309K3E5 ODU: WH-UDZ05KE5", //37
80-
"IDU: WH-SDC0509L3E5 ODU: WH-WDG09LE5", //38
81-
"IDU: WH-SDC12H9E8 ODU: WH-UD12HE8", //39
82-
"IDU: WH-SDC0309K3E5, ODU: WH-UDZ07KE5", //40
83-
"IDU: WH-ADC0916H9E8, ODU: WH-UX16HE8", //41
84-
"IDU: WH-ADC0912H9E8, ODU: WH-UX12HE8", //42
75+
"IDU:WH-ADC1216H6E5C ODU:WH-UD12HE5", //33
76+
"IDU:WH-ADC0509L3E5 ODU:WH-WDG07LE5", //34
77+
"IDU:WH-SXC09H3E8 ODU:WH-UX09HE8", //35
78+
"IDU:WH-ADC0309K3E5AN ODU:WH-UDZ07KE5", //36
79+
"IDU:WH-SDC0309K3E5 ODU:WH-UDZ05KE5", //37
80+
"IDU:WH-SDC0509L3E5 ODU:WH-WDG09LE5", //38
81+
"IDU:WH-SDC12H9E8 ODU:WH-UD12HE8", //39
82+
"IDU:WH-SDC0309K3E5, ODU:WH-UDZ07KE5", //40
83+
"IDU:WH-ADC0916H9E8, ODU:WH-UX16HE8", //41
84+
"IDU:WH-ADC0912H9E8, ODU:WH-UX12HE8", //42
8585
"WH-MXC16J9E8", //43
8686
"WH-MXC12J6E5", //44
87-
"IDU:WH-SQC09H3E8, ODU:WH-UQ09HE8", //45
87+
"IDU:WH-SQC09H3E8, ODU:WH-UQ09HE8", //45
88+
"IDU:WH-ADC0309K3E5 ODU:WH-UDZ09KE5", //46
8889
};
8990

9091
static const byte knownModels[sizeof(Model) / sizeof(Model[0])][10] PROGMEM = { //stores the bytes #129 to #138 of known models in the same order as the const above
@@ -134,6 +135,7 @@ static const byte knownModels[sizeof(Model) / sizeof(Model[0])][10] PROGMEM = {
134135
0x32, 0xD4, 0x0B, 0x89, 0x84, 0x73, 0x90, 0x0C, 0x86, 0x84, //43
135136
0x32, 0xD4, 0x0B, 0x00, 0x78, 0x62, 0x90, 0x0B, 0x02, 0x78, //44
136137
0xE2, 0xCF, 0x0B, 0x82, 0x05, 0x12, 0xD0, 0x0D, 0x91, 0x05, //45
138+
0xE2, 0xD5, 0x0D, 0x99, 0x94, 0x02, 0xD6, 0x0D, 0x68, 0x95, //46
137139
};
138140

139141
#define NUMBER_OF_TOPICS 119 //last topic number + 1

HeishaMon/htmlcode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ static const char populatescanwifiJS[] PROGMEM =
690690
" };"
691691
" request.open('GET', '/wifiscan', true);"
692692
" request.send();"
693-
" setTimeout(refreshWifiScan,10000);"
693+
" setTimeout(refreshWifiScan,30000);"
694694
"};"
695695
"setTimeout(refreshWifiScan,500);"
696696
"</script>";

HeishaMon/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
static const char* heishamon_version = "3.7";
1+
static const char* heishamon_version = "3.8";

HeishaMon/webfunctions.cpp

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void getWifiScanResults(int numSsid) {
6767
String quality = String(dBmToQuality(WiFi.RSSI(indexes[i]))) + "%";
6868
wifiJsonObject["rssi"] = quality;
6969
}
70-
saveJsonToFile(wifiJsonDoc,"wifiscan.json");
70+
saveJsonToFile(wifiJsonDoc,"/wifiscan.json");
7171
WiFi.scanDelete();
7272
}
7373
}
@@ -613,7 +613,7 @@ int saveSettings(struct webserver_t *client, settingsStruct *heishamonSettings)
613613
jsonDoc["wifi_password"] = String(wifi_password);
614614
}
615615

616-
saveJsonToFile(jsonDoc, "config.json"); //save to config file
616+
saveJsonToFile(jsonDoc, "/config.json"); //save to config file
617617
loadSettings(heishamonSettings); //load config file to current settings
618618

619619
while (client->userdata) {
@@ -971,15 +971,23 @@ int handleWifiScan(struct webserver_t *client) {
971971
if (client->content == 0) {
972972
webserver_send(client, 200, (char *)"application/json", 0);
973973
if (LittleFS.begin()) {
974-
File scanfile = LittleFS.open("wifiscan.json", "r");
974+
File scanfile = LittleFS.open("/wifiscan.json", "r");
975975
if (scanfile) {
976976
size_t size = scanfile.size();
977-
// Allocate a buffer to store contents of the file.
978-
std::unique_ptr<char[]> buf(new char[size]);
979-
scanfile.readBytes(buf.get(), size);
980-
webserver_send_content(client, buf.get(), size);
981-
scanfile.close();
977+
if (size > 0 ) {
978+
// Allocate a buffer to store contents of the file.
979+
std::unique_ptr<char[]> buf(new char[size]);
980+
scanfile.readBytes(buf.get(), size);
981+
webserver_send_content(client, buf.get(), size);
982+
scanfile.close();
983+
} else {
984+
webserver_send_content_P(client, PSTR("[]"), 2);
985+
}
986+
} else {
987+
webserver_send_content_P(client, PSTR("[]"), 2);
982988
}
989+
} else {
990+
webserver_send_content_P(client, PSTR("[]"), 2);
983991
}
984992

985993
}
@@ -1009,22 +1017,6 @@ int handleDebug(struct webserver_t *client, char *hex, byte hex_len) {
10091017
return 0;
10101018
}
10111019

1012-
void webSocketEvent(uint8_t num, WStype_t type, uint8_t *payload, size_t length) {
1013-
switch (type) {
1014-
case WStype_DISCONNECTED:
1015-
break;
1016-
case WStype_CONNECTED: {
1017-
} break;
1018-
case WStype_TEXT:
1019-
break;
1020-
case WStype_BIN:
1021-
break;
1022-
case WStype_PONG: {
1023-
} break;
1024-
default:
1025-
break;
1026-
}
1027-
}
10281020

10291021
int handleRoot(struct webserver_t *client, float readpercentage, int mqttReconnects, settingsStruct *heishamonSettings) {
10301022
switch (client->content) {

HeishaMon/webfunctions.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <Update.h>
1111
#endif
1212
#include <PubSubClient.h>
13-
#include <WebSocketsServer.h>
1413
#include <ArduinoJson.h>
1514
#include <LittleFS.h>
1615
#include "src/common/webserver.h"
@@ -97,7 +96,6 @@ int settingsReconnectWifi(struct webserver_t *client, settingsStruct *heishamonS
9796
int settingsNewPassword(struct webserver_t *client, settingsStruct *heishamonSettings);
9897
int cacheSettings(struct webserver_t *client, struct arguments_t * args);
9998
int handleWifiScan(struct webserver_t *client);
100-
void webSocketEvent(uint8_t num, WStype_t type, uint8_t *payload, size_t length);
10199
int showRules(struct webserver_t *client);
102100
int showFirmware(struct webserver_t *client);
103101
int showFirmwareSuccess(struct webserver_t *client);
-32 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
09c3cea4dbaa8d0c5c2f93e9f6301770
1+
137a1e727440b914eea308f11155e8d5

0 commit comments

Comments
 (0)