From 9f38dae8ba99aea18bb82ecade79dad5c2ffec01 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Fri, 11 Aug 2023 00:07:02 +0200 Subject: [PATCH] Check bad AT firmware version --- GITHUB_SHA.h | 2 +- WifiInterface.cpp | 16 +++++++++++++++- version.h | 4 +++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/GITHUB_SHA.h b/GITHUB_SHA.h index a889ba7..de4f953 100644 --- a/GITHUB_SHA.h +++ b/GITHUB_SHA.h @@ -1 +1 @@ -#define GITHUB_SHA "devel-202308041244Z" +#define GITHUB_SHA "devel-202308102205Z" diff --git a/WifiInterface.cpp b/WifiInterface.cpp index 7511af6..ab36957 100644 --- a/WifiInterface.cpp +++ b/WifiInterface.cpp @@ -200,7 +200,21 @@ wifiSerialState WifiInterface::setup2(const FSH* SSid, const FSH* password, // Display the AT version information StringFormatter::send(wifiStream, F("AT+GMR\r\n")); - checkForOK(2000, true, false); // Makes this visible on the console + if (checkForOK(2000, F("AT version:"), true, false)) { + char version[] = "0.0.0.0"; + for (int i=0; i<8;i++) { + while(!wifiStream->available()); + version[i]=wifiStream->read(); + StringFormatter::printEscape(version[i]); + if ((version[0] == '0') || + (version[0] == '2' && version[2] == '0') || + (version[0] == '2' && version[2] == '2' && version[4] == '0' && version[6] == '0')) { + SSid = F("DCCEX_SAYS_BROKEN_FIRMWARE"); + forceAP = true; + } + } + } + checkForOK(2000, true, false); #ifdef DONT_TOUCH_WIFI_CONF DIAG(F("DONT_TOUCH_WIFI_CONF was set: Using existing config")); diff --git a/version.h b/version.h index eb2d068..076daef 100644 --- a/version.h +++ b/version.h @@ -3,7 +3,9 @@ #include "StringFormatter.h" -#define VERSION "4.2.69" +#define VERSION "5.0.1" +// 5.0.1 - Check bad AT firmware version +// 5.0.0 - Make 4.2.69 the 5.0.0 release // 4.2.69 - Bugfix: Make work in DC mode // 4.2.68 - Rename track mode OFF to NONE // 4.2.67 - AVR: Pin specific timer register seting