mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 08:49:52 +03:00
minor updates
This commit is contained in:
@@ -36,9 +36,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- `status` payload on start-up shows the IP and Version of EMS-ESP
|
||||
- `thermostat mode` takes a string like manual,auto,heat,day,night,eco,comfort,holiday,nofrost
|
||||
- `thermostat temp` also takes a mode string, e.g. `thermostat temp 20 heat`
|
||||
- `queue` renamed to `txqueue`
|
||||
|
||||
### Removed
|
||||
- `autodetect scan`
|
||||
- `autodetect scan`. Replaced with `devices scan` and `devices scan+` for deep scanning
|
||||
- `mqttlog all` and showing MQTT log in the web interface - no point showing history of previous mqtt publishes in ESP's precious memory. For debugging I recommend using MQTT Explorer or another external tool.
|
||||
|
||||
## [1.9.4] 15-12-2019
|
||||
|
||||
@@ -40,10 +40,7 @@ build_flags = ${common.general_flags} -std=c++11 -fno-exceptions
|
||||
|
||||
[env]
|
||||
framework = arduino
|
||||
;platform = espressif8266@2.2.2 ; arduino core 2.5.2
|
||||
platform = espressif8266
|
||||
;platform = https://github.com/platformio/platform-espressif8266#develop
|
||||
;platform = https://github.com/platformio/platform-espressif8266#feature/stage
|
||||
lib_compat_mode = strict
|
||||
lib_deps =
|
||||
https://github.com/rlogiacco/CircularBuffer
|
||||
@@ -56,7 +53,7 @@ lib_deps =
|
||||
JustWifi@2.0.2 ; https://github.com/xoseperez/justwifi
|
||||
AsyncMqttClient@0.8.2 ; https://github.com/marvinroger/async-mqtt-client
|
||||
EEPROM_Rotate@0.9.2 ; https://github.com/xoseperez/eeprom_rotate
|
||||
ArduinoJson@6.14.1 ; https://github.com/bblanchon/ArduinoJson
|
||||
https://github.com/bblanchon/ArduinoJson
|
||||
ESPAsyncTCP@1.2.2 ; https://github.com/me-no-dev/ESPAsyncTCP
|
||||
upload_speed = 921600
|
||||
monitor_speed = 115200
|
||||
|
||||
@@ -435,7 +435,7 @@ void MyESP::_printMQTTQueue() {
|
||||
bool MyESP::mqttPublish(const char * topic, const char * payload) {
|
||||
return (_mqttQueue(topic, payload, _mqtt_retain));
|
||||
}
|
||||
bool MyESP::mqttPublish(const char * topic, JsonDocument payload) {
|
||||
bool MyESP::mqttPublish(const char * topic, JsonDocument & payload) {
|
||||
return (_mqttQueue(topic, payload, _mqtt_retain));
|
||||
}
|
||||
|
||||
@@ -443,7 +443,7 @@ bool MyESP::mqttPublish(const char * topic, JsonDocument payload) {
|
||||
bool MyESP::mqttPublish(const char * topic, const char * payload, bool retain) {
|
||||
return (_mqttQueue(topic, payload, retain));
|
||||
}
|
||||
bool MyESP::mqttPublish(const char * topic, JsonDocument payload, bool retain) {
|
||||
bool MyESP::mqttPublish(const char * topic, JsonDocument & payload, bool retain) {
|
||||
return (_mqttQueue(topic, payload, retain));
|
||||
}
|
||||
|
||||
@@ -475,7 +475,7 @@ bool MyESP::_mqttQueue(const char * topic, const char * payload, bool retain) {
|
||||
// convert json doc to a string buffer and place on queue
|
||||
// can't have empty payload or topic
|
||||
// returns false if can't add to queue
|
||||
bool MyESP::_mqttQueue(const char * topic, JsonDocument payload, bool retain) {
|
||||
bool MyESP::_mqttQueue(const char * topic, JsonDocument & payload, bool retain) {
|
||||
if (!mqttClient.connected() || _mqtt_queue.size() >= MQTT_QUEUE_MAX_SIZE || !_hasValue(topic)) {
|
||||
return false;
|
||||
}
|
||||
@@ -2753,7 +2753,8 @@ void MyESP::_webserver_setup() {
|
||||
request->send(response);
|
||||
});
|
||||
|
||||
_webServer->on("/update",
|
||||
_webServer->on(
|
||||
"/update",
|
||||
HTTP_POST,
|
||||
[](AsyncWebServerRequest * request) {
|
||||
AsyncWebServerResponse * response = request->beginResponse(200, "text/plain", _shouldRestart ? "OK" : "FAIL");
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#ifndef MyESP_h
|
||||
#define MyESP_h
|
||||
|
||||
#define MYESP_VERSION "1.2.36"
|
||||
#define MYESP_VERSION "1.2.37"
|
||||
|
||||
#include <ArduinoJson.h>
|
||||
#include <ArduinoOTA.h>
|
||||
@@ -281,8 +281,8 @@ class MyESP {
|
||||
void mqttUnsubscribe(const char * topic);
|
||||
bool mqttPublish(const char * topic, const char * payload);
|
||||
bool mqttPublish(const char * topic, const char * payload, bool retain);
|
||||
bool mqttPublish(const char * topic, JsonDocument payload);
|
||||
bool mqttPublish(const char * topic, JsonDocument payload, bool retain);
|
||||
bool mqttPublish(const char * topic, JsonDocument & payload);
|
||||
bool mqttPublish(const char * topic, JsonDocument & payload, bool retain);
|
||||
void setMQTT(mqtt_callback_f callback);
|
||||
bool mqttUseNestedJson();
|
||||
|
||||
@@ -343,7 +343,7 @@ class MyESP {
|
||||
void _sendStart();
|
||||
char * _mqttTopic(const char * topic);
|
||||
bool _mqttQueue(const char * topic, const char * payload, bool retain);
|
||||
bool _mqttQueue(const char * topic, JsonDocument payload, bool retain);
|
||||
bool _mqttQueue(const char * topic, JsonDocument & payload, bool retain);
|
||||
void _printMQTTQueue();
|
||||
void _mqttPublishQueue();
|
||||
void _mqttRemoveLastPublish();
|
||||
|
||||
@@ -109,8 +109,8 @@ static const command_t project_cmds[] PROGMEM = {
|
||||
{false, "log <n | b | t | s | m | r | j | v | w [ID] | d [ID]>", "logging: none, basic, thermo, solar, mixing, raw, jabber, verbose, watch a type or device"},
|
||||
{false, "publish", "publish all values to MQTT"},
|
||||
{false, "refresh", "fetch values from the EMS devices"},
|
||||
{false, "devices [scan] | [scan deep] | [save]", "list detected devices, quick scan or deep scan and save as known devices"},
|
||||
{false, "queue", "show current Tx queue"},
|
||||
{false, "devices [scan] | [scan+] | [clear] | [save] ", "list detected devices, quick scan, deep scan, clear and and save"},
|
||||
{false, "txqueue", "show current Tx queue"},
|
||||
{false, "send XX ...", "send raw telegram data to EMS bus (XX are hex values)"},
|
||||
{false, "thermostat read <type ID>", "send read request to the thermostat for heating circuit hc 1-4"},
|
||||
{false, "thermostat temp <degrees> [mode] [hc]", "set thermostat temperature. mode is manual,auto,heat,day,night,eco,comfort,holiday,nofrost"},
|
||||
@@ -254,14 +254,17 @@ void showInfo() {
|
||||
((EMSESP_Settings.shower_timer) ? "enabled" : "disabled"),
|
||||
((EMSESP_Settings.shower_alert) ? "enabled" : "disabled"));
|
||||
|
||||
if (strlen(EMSESP_Settings.known_devices) > 0) {
|
||||
myDebug_P(PSTR(" Saved known device IDs: %s"), EMSESP_Settings.known_devices);
|
||||
} else {
|
||||
myDebug_P(PSTR(" Saved known device IDs: none"));
|
||||
}
|
||||
|
||||
myDebug_P(PSTR("\n%sEMS Bus status:%s"), COLOR_BOLD_ON, COLOR_BOLD_OFF);
|
||||
|
||||
if (ems_getBusConnected()) {
|
||||
myDebug_P(PSTR(" Bus is connected, protocol: %s"), (ems_isHT3() ? "HT3" : "Buderus"));
|
||||
myDebug_P(PSTR(" Rx: # successful read requests=%d, # CRC errors=%d"), EMS_Sys_Status.emsRxPgks, EMS_Sys_Status.emxCrcErr);
|
||||
if (strlen(EMSESP_Settings.known_devices) > 0) {
|
||||
myDebug_P(PSTR(" Saved known device IDs: %s"), EMSESP_Settings.known_devices);
|
||||
}
|
||||
|
||||
if (ems_getTxCapable()) {
|
||||
char valuestr[8] = {0}; // for formatting floats
|
||||
@@ -1487,6 +1490,11 @@ void TelnetCallback(uint8_t event) {
|
||||
}
|
||||
}
|
||||
|
||||
void clearEMSDevices() {
|
||||
EMSESP_Settings.known_devices = strdup("");
|
||||
myESP.saveSettings();
|
||||
}
|
||||
|
||||
// get the list of know devices, as a string, and save them to the config file
|
||||
void saveEMSDevices() {
|
||||
if (Devices.empty()) {
|
||||
@@ -1539,33 +1547,28 @@ void TelnetCommandCallback(uint8_t wc, const char * commandLine) {
|
||||
// wc = 2 or more. check for "scan"
|
||||
char * second_cmd = _readWord();
|
||||
if (strcmp(second_cmd, "scan") == 0) {
|
||||
if (wc == 2) {
|
||||
// just scan use UBA 0x07 telegram
|
||||
myDebug_P(PSTR("Requesting EMS bus master for its device list and scanning for external sensors..."));
|
||||
scanDallas();
|
||||
Devices.clear(); // init the device map
|
||||
ems_doReadCommand(EMS_TYPE_UBADevices, EMS_Boiler.device_id);
|
||||
return;
|
||||
}
|
||||
|
||||
// wc is 3 or more. check for additional "force" argument
|
||||
char * third_cmd = _readWord();
|
||||
if (strcmp(third_cmd, "deep") == 0) {
|
||||
} else if (strcmp(second_cmd, "scan+") == 0) {
|
||||
myDebug_P(PSTR("Started deep scan of EMS bus for our known devices. This can take up to 10 seconds..."));
|
||||
Devices.clear(); // init the device map
|
||||
ems_scanDevices();
|
||||
return;
|
||||
}
|
||||
} else if (strcmp(second_cmd, "save") == 0) {
|
||||
saveEMSDevices();
|
||||
return;
|
||||
} else if (strcmp(second_cmd, "clear") == 0) {
|
||||
clearEMSDevices();
|
||||
return;
|
||||
}
|
||||
|
||||
ok = false; // unknown command
|
||||
}
|
||||
|
||||
|
||||
if (strcmp(first_cmd, "queue") == 0) {
|
||||
if (strcmp(first_cmd, "txqueue") == 0) {
|
||||
ems_printTxQueue();
|
||||
ok = true;
|
||||
}
|
||||
@@ -2278,7 +2281,7 @@ void initEMSESP() {
|
||||
EMSESP_Settings.tx_mode = EMS_TXMODE_DEFAULT; // default tx mode
|
||||
EMSESP_Settings.bus_id = EMS_BUSID_DEFAULT; // Service Key is default
|
||||
EMSESP_Settings.master_thermostat = 0;
|
||||
EMSESP_Settings.known_devices = nullptr;
|
||||
EMSESP_Settings.known_devices = strdup("");
|
||||
|
||||
// shower settings
|
||||
EMSESP_Shower.timerStart = 0;
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define APP_VERSION "1.9.5b55"
|
||||
#define APP_VERSION "1.9.5b57"
|
||||
|
||||
Reference in New Issue
Block a user