From b2b138e7b93201d51ad7c67792932963403845f5 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Tue, 8 Jun 2021 21:05:52 +0200 Subject: [PATCH] oops 80M not 800M * oops 80M not 800M --- CHANGELOG.md | 1 + RELEASENOTES.md | 3 ++- boards/esp32_16M.json | 2 +- boards/esp32_4M.json | 2 +- boards/esp32_8M.json | 2 +- tasmota/support_command.ino | 26 ++++++++++++++++++++++++++ tasmota/xdrv_10_scripter.ino | 4 ++-- tasmota/xdrv_16_tuyamcu.ino | 2 +- 8 files changed, 35 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c30fde0c9..c79f47664 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. ### Changed - Allow longer MQTT response messages by removing fixed memory buffer with size 1040 to heap allocated buffer - Command ``Timers`` layout of JSON message changed to single line +- Command ``Gpio`` layout of JSON message changed to single line ## [9.4.0.4] ### Added diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 405a9a707..ca5b3449d 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -78,7 +78,7 @@ The binaries can be downloaded from either https://github.com/arendst/Tasmota/tr ## Changelog v9.4.0.5 ### Added -- Command ``Status0`` providing all status in one line +- Command ``Status0`` providing all status information on a single line - Initial support for optional ``Template`` JSON fieldpair ``"CMND":"||..."`` [#11788](https://github.com/arendst/Tasmota/issues/11788) - ESP32 pulldown buttons ``Button_d`` and ``Button_id`` and switches ``Switch_d`` [#10814](https://github.com/arendst/Tasmota/issues/10814) - Support for MQTT using Azure IoT Hub by Kevin Saye [#11906](https://github.com/arendst/Tasmota/issues/11906) @@ -96,6 +96,7 @@ The binaries can be downloaded from either https://github.com/arendst/Tasmota/tr - IRremoteESP8266 library from v2.7.16 to v2.7.18 - Allow longer MQTT response messages by removing fixed memory buffer with size 1040 to heap allocated buffer - Command ``Timers`` layout of JSON message changed to single line +- Command ``Gpio`` layout of JSON message changed to single line ### Fixed diff --git a/boards/esp32_16M.json b/boards/esp32_16M.json index 7d24cdac0..24eb490a7 100644 --- a/boards/esp32_16M.json +++ b/boards/esp32_16M.json @@ -5,7 +5,7 @@ }, "core": "esp32", "extra_flags": "-DARDUINO_ESP32_DEV", - "f_cpu": "800000000L", + "f_cpu": "80000000L", "f_flash": "40000000L", "flash_mode": "dio", "mcu": "esp32", diff --git a/boards/esp32_4M.json b/boards/esp32_4M.json index ecb2d4027..53afbd219 100644 --- a/boards/esp32_4M.json +++ b/boards/esp32_4M.json @@ -5,7 +5,7 @@ }, "core": "esp32", "extra_flags": "-DARDUINO_ESP32_DEV", - "f_cpu": "800000000L", + "f_cpu": "80000000L", "f_flash": "40000000L", "flash_mode": "dio", "mcu": "esp32", diff --git a/boards/esp32_8M.json b/boards/esp32_8M.json index 15c24ddcf..b390ebdf5 100644 --- a/boards/esp32_8M.json +++ b/boards/esp32_8M.json @@ -5,7 +5,7 @@ }, "core": "esp32", "extra_flags": "-DARDUINO_ESP32_DEV", - "f_cpu": "800000000L", + "f_cpu": "80000000L", "f_flash": "40000000L", "flash_mode": "dio", "mcu": "esp32", diff --git a/tasmota/support_command.ino b/tasmota/support_command.ino index d36d44c6d..9d7636e2c 100644 --- a/tasmota/support_command.ino +++ b/tasmota/support_command.ino @@ -125,6 +125,13 @@ void ResponseCmndIdxError(void) { void ResponseCmndAll(uint32_t text_index, uint32_t count) { uint32_t real_index = text_index; ResponseClear(); +#ifdef MQTT_DATA_STRING + for (uint32_t i = 0; i < count; i++) { + if ((SET_MQTT_GRP_TOPIC == text_index) && (1 == i)) { real_index = SET_MQTT_GRP_TOPIC2 -1; } + ResponseAppend_P(PSTR("%c\"%s%d\":\"%s\""), (i)?',':'{', XdrvMailbox.command, i +1, EscapeJSONString(SettingsText(real_index +i)).c_str()); + } + ResponseJsonEnd(); +#else bool jsflg = false; for (uint32_t i = 0; i < count; i++) { if ((SET_MQTT_GRP_TOPIC == text_index) && (1 == i)) { real_index = SET_MQTT_GRP_TOPIC2 -1; } @@ -137,6 +144,7 @@ void ResponseCmndAll(uint32_t text_index, uint32_t count) { jsflg = true; } } +#endif } /********************************************************************************************/ @@ -1209,6 +1217,18 @@ void CmndModule(void) void CmndModules(void) { uint32_t midx = USER_MODULE; +#ifdef MQTT_DATA_STRING + Response_P(PSTR("{\"" D_CMND_MODULES "\":{")); + for (uint32_t i = 0; i <= sizeof(kModuleNiceList); i++) { + if (i > 0) { + midx = pgm_read_byte(kModuleNiceList + i -1); + ResponseAppend_P(PSTR(",")); + } + uint32_t j = i ? midx +1 : 0; + ResponseAppend_P(PSTR("\"%d\":\"%s\""), j, AnyModuleName(midx).c_str()); + } + ResponseJsonEndEnd(); +#else uint32_t lines = 1; bool jsflg = false; for (uint32_t i = 0; i <= sizeof(kModuleNiceList); i++) { @@ -1228,6 +1248,7 @@ void CmndModules(void) } } ResponseClear(); +#endif } void CmndGpio(void) @@ -1288,6 +1309,10 @@ void CmndGpio(void) sensor_names = kSensorNamesFixed; } char stemp1[TOPSZ]; +#ifdef MQTT_DATA_STRING + ResponseAppend_P(PSTR("\"" D_CMND_GPIO "%d\":{\"%d\":\"%s%s\"}"), i, sensor_type, GetTextIndexed(stemp1, sizeof(stemp1), sensor_name_idx, sensor_names), sindex); + jsflg2 = true; +#else if ((ResponseAppend_P(PSTR("\"" D_CMND_GPIO "%d\":{\"%d\":\"%s%s\"}"), i, sensor_type, GetTextIndexed(stemp1, sizeof(stemp1), sensor_name_idx, sensor_names), sindex) > (MAX_LOGSZ - TOPSZ))) { ResponseJsonEnd(); MqttPublishPrefixTopicRulesProcess_P(RESULT_OR_STAT, XdrvMailbox.command); @@ -1295,6 +1320,7 @@ void CmndGpio(void) jsflg2 = true; jsflg = false; } +#endif } } if (jsflg) { diff --git a/tasmota/xdrv_10_scripter.ino b/tasmota/xdrv_10_scripter.ino index 05b69df0c..77927f9c1 100755 --- a/tasmota/xdrv_10_scripter.ino +++ b/tasmota/xdrv_10_scripter.ino @@ -3925,7 +3925,7 @@ void toLogN(const char *cp, uint8_t len) { void toLogEOL(const char *s1,const char *str) { if (!str) return; uint8_t index = 0; - char log_data[MAX_LOGSZ]; + char log_data[700]; // Was MAX_LOGSZ char *cp = log_data; strcpy(cp, s1); cp += strlen(s1); @@ -5802,7 +5802,7 @@ void Script_Check_Hue(String *response) { AddLog(LOG_LEVEL_DEBUG, PSTR("Hue: %d"), hue_devs); toLog(">>>>"); toLog(response->c_str()); - toLog(response->c_str()+MAX_LOGSZ); + toLog(response->c_str()+700); // Was MAX_LOGSZ } #endif } diff --git a/tasmota/xdrv_16_tuyamcu.ino b/tasmota/xdrv_16_tuyamcu.ino index 295860c33..a629c0a6d 100644 --- a/tasmota/xdrv_16_tuyamcu.ino +++ b/tasmota/xdrv_16_tuyamcu.ino @@ -433,7 +433,7 @@ void TuyaSendCmd(uint8_t cmd, uint8_t payload[] = nullptr, uint16_t payload_len TuyaSerial->write(cmd); // Tuya command TuyaSerial->write(payload_len >> 8); // following data length (Hi) TuyaSerial->write(payload_len & 0xFF); // following data length (Lo) - char log_data[MAX_LOGSZ]; + char log_data[700]; // Was MAX_LOGSZ snprintf_P(log_data, sizeof(log_data), PSTR("TYA: Send \"55aa00%02x%02x%02x"), cmd, payload_len >> 8, payload_len & 0xFF); for (uint32_t i = 0; i < payload_len; ++i) { TuyaSerial->write(payload[i]);