From a172a9c6c83f42ed255abb0babb609dfd455fa07 Mon Sep 17 00:00:00 2001 From: oarcher Date: Wed, 28 Aug 2024 21:20:36 +0200 Subject: [PATCH] check gnss len --- esphome/components/modem/sensor/modem_sensor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/modem/sensor/modem_sensor.cpp b/esphome/components/modem/sensor/modem_sensor.cpp index d72a5cd1c9..7793b923b2 100644 --- a/esphome/components/modem/sensor/modem_sensor.cpp +++ b/esphome/components/modem/sensor/modem_sensor.cpp @@ -66,7 +66,7 @@ std::map get_gnssinfo_tokens(const std::string &gnss_i std::map gnss_data; - if (gnss_info.find(",,,,,,") != std::string::npos) { + if ((gnss_info.find(",,,,,,") != std::string::npos) || (gnss_info.find("+CGNSSINFO:") == std::string::npos)) { ESP_LOGW(TAG, "No GNSS location available"); return gnss_data; // empty }