Closed phazz1980 closed 2 years ago
Hi @phazz1980
I'm trying to reproduce your issue, but i don't undestand how you can get a such long list of unicode entities instead normal text.
\u00b0\u0421\n\ud83d\udd25\u041c\u0430\u043a\u0441.\u0442\u0435\u043c\u043f\u0435\u0440 etc etc
In this way the message is much longer than necessary because you need 6 bytes for each charater and buffer allocated memory is not enought for JSON parsing.
I've tryed also to switch to Russian in my app but the message received in serial monitor (enabling debug functionality) is still without unicode entities.
.................
"type": "private"
},
"date": 1643016127,
"text": "ℹ️ Авария низкой температуры! ❄️\n🌡Температура котла: 0.0°С\n🔥Макс.темпера"
}
Off course, the bug is that error is not properly handled and ESP freeze. I'm working on it, but in the meantime if you can understand why you got unicode entities instead normal text, I think you will avoid this malfunction.
Off course, the bug is that error is not properly handled and ESP freeze.
Yes. This problem also occurs if the telegram api blocks the bot due to exceeding the number of messages
Hi @phazz1980 I've just pushed a fix for error handling (still not released, it will be included in next release, but you can edit yourself source code or directly download zip file from Github).
Now MCU won't freeze and a message is sent informing user that message is too long to be parsed.
If you still need to handle such type of very long messages, you should increase the size of #define BUFFER_BIG 2048
inside DataStructures.h.
I can't increase it by default, because is useless more memory consumption which normally is not needed
when receiving invalid JSON, ESP is blocked for about 15 minutes