oops 80M not 800M

* oops 80M not 800M
This commit is contained in:
Jason2866 2021-06-08 21:05:52 +02:00 committed by GitHub
parent adc7b9b0f2
commit b2b138e7b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 35 additions and 7 deletions

View File

@ -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

View File

@ -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":"<any template related command>|<any template related command>|..."`` [#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

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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) {

View File

@ -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
}

View File

@ -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]);