Added Nextion display error handling during setup (#5493)

This commit is contained in:
Oleg Tarasov 2023-10-11 01:56:53 +03:00 committed by GitHub
parent 5d5cc96017
commit 9d95f5c1da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,6 +61,11 @@ bool Nextion::check_connect_() {
std::string response;
this->recv_ret_string_(response, 0, false);
if (!response.empty() && response[0] == 0x1A) {
// Swallow invalid variable name responses that may be caused by the above commands
ESP_LOGD(TAG, "0x1A error ignored during setup");
return false;
}
if (response.empty() || response.find("comok") == std::string::npos) {
#ifdef NEXTION_PROTOCOL_LOG
ESP_LOGN(TAG, "Bad connect request %s", response.c_str());