Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

Commit

Permalink
v1.2.0 to enable scan of WiFi networks
Browse files Browse the repository at this point in the history
### Major Release v1.2.0

1. Enable scan of WiFi networks for selection in Configuration Portal. Check [PR for v1.3.0 - Enable scan of WiFi networks #10](khoih-prog/WiFiManager_NINA_Lite#10). Now you can select optional **SCAN_WIFI_NETWORKS**, **MANUAL_SSID_INPUT_ALLOWED** to be able to manually input SSID, not only from a scanned SSID lists and **MAX_SSID_IN_LIST** (from 2-6 for ESP8266-AT or 2-15 for other)
2. Minor enhancement to not display garbage when data is invalid
3. Tested with new [Arduino Core for STM32 v2.0.0](https://github.com/stm32duino/Arduino_Core_STM32) and add support to new STM32L5 boards.
4. Enhance MultiWiFi connection logic
5. Enhance debugging feature
  • Loading branch information
khoih-prog committed Apr 29, 2021
1 parent fdb5b46 commit 263f560
Show file tree
Hide file tree
Showing 27 changed files with 2,914 additions and 742 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
Please ensure to specify the following:

* Arduino IDE version (e.g. 1.8.13) or Platform.io version
* Board Core Version (e.g. Arduino SAMDUE core v1.6.12, ESP8266 core v2.7.4, etc.)
* Board Core Version (e.g. Arduino SAMDUE core v1.6.12, ESP8266 core v2.7.4, STM32 core v2.0.0, etc.)
* Contextual information (e.g. what you were trying to achieve)
* Simplest possible steps to reproduce
* Anything that might be relevant in your opinion, such as:
Expand All @@ -29,7 +29,7 @@ Please ensure to specify the following:
Arduino IDE version: 1.8.13
Arduino SAM DUE Core Version 1.6.12
OS: Ubuntu 20.04 LTS
Linux xy-Inspiron-3593 5.4.0-71-generic #79-Ubuntu SMP Wed Mar 24 10:56:57 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Linux xy-Inspiron-3593 5.4.0-72-generic #80-Ubuntu SMP Mon Apr 12 17:35:00 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Context:
The board couldn't autoreconnect to Local Blynk Server after router power recycling.
Expand Down
452 changes: 324 additions & 128 deletions README.md

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions examples/Mega_ESP8266Shield/Mega_ESP8266Shield.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WM_Lite
Licensed under MIT license
Version: 1.1.0
Version: 1.2.0

Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -21,6 +21,7 @@
1.0.4 K Hoang 03/07/2020 Add support to ESP32-AT shields. Modify LOAD_DEFAULT_CONFIG_DATA logic.
Enhance MultiWiFi connection logic. Fix WiFi Status bug.
1.1.0 K Hoang 13/04/2021 Fix invalid "blank" Config Data treated as Valid. Optional one set of WiFi Credentials
1.2.0 Michael H 28/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
*****************************************************************************************************************************/

#include "defines.h"
Expand Down Expand Up @@ -72,8 +73,10 @@ void setup()
//delay(1000);

Serial.print(F("\nStart Mega_ESP8266Shield on "));
Serial.println(BOARD_TYPE);
Serial.println(BOARD_NAME);
Serial.println(ESP_AT_WM_LITE_VERSION);
Serial.print("Debug Level = ");
Serial.println(_ESP_AT_WM_LOGLEVEL_);

// initialize serial for ESP module
EspSerial.begin(115200);
Expand Down
9 changes: 9 additions & 0 deletions examples/Mega_ESP8266Shield/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#define ESP_AT_DEBUG_OUTPUT Serial

#define ESP_AT_DEBUG true
#define _ESP_AT_WM_LOGLEVEL_ 3

// Uncomment to use ESP32-AT commands
//#define USE_ESP32_AT true
Expand All @@ -41,12 +42,20 @@
#define BOARD_TYPE "AVR Mega"
#endif

#ifndef BOARD_NAME
#define BOARD_NAME BOARD_TYPE
#endif

// Start location in EEPROM to store config data. Default 0
// Config data Size currently is 116 bytes)
#define EEPROM_START 0

/////////////////////////////////////////////

// Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank"
// Default is false (if not defined) => must input 2 sets of SSID/PWD
#define REQUIRE_ONE_SET_SSID_PW false

#define USE_DYNAMIC_PARAMETERS true

/////////////////////////////////////////////
Expand Down
7 changes: 5 additions & 2 deletions examples/SAMD_ESP8266Shield/SAMD_ESP8266Shield.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WM_Lite
Licensed under MIT license
Version: 1.1.0
Version: 1.2.0

Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -21,6 +21,7 @@
1.0.4 K Hoang 03/07/2020 Add support to ESP32-AT shields. Modify LOAD_DEFAULT_CONFIG_DATA logic.
Enhance MultiWiFi connection logic. Fix WiFi Status bug.
1.1.0 K Hoang 13/04/2021 Fix invalid "blank" Config Data treated as Valid. Optional one set of WiFi Credentials
1.2.0 Michael H 28/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
*****************************************************************************************************************************/

#include "defines.h"
Expand Down Expand Up @@ -70,8 +71,10 @@ void setup()
while (!Serial);

Serial.print("\nStart SAMD_ESP8266Shield on ");
Serial.println(BOARD_TYPE);
Serial.println(BOARD_NAME);
Serial.println(ESP_AT_WM_LITE_VERSION);
Serial.print("Debug Level = ");
Serial.println(_ESP_AT_WM_LOGLEVEL_);

// initialize serial for ESP module
EspSerial.begin(115200);
Expand Down
15 changes: 15 additions & 0 deletions examples/SAMD_ESP8266Shield/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#define ESP_AT_DEBUG_OUTPUT Serial

#define ESP_AT_DEBUG true
#define _ESP_AT_WM_LOGLEVEL_ 3

// Uncomment to use ESP32-AT commands
//#define USE_ESP32_AT true
Expand Down Expand Up @@ -88,6 +89,10 @@

#endif

#ifndef BOARD_NAME
#define BOARD_NAME BOARD_TYPE
#endif

// Start location in EEPROM to store config data. Default 0
#define EEPROM_START 0
#define EEPROM_SIZE (2 * 1024)
Expand All @@ -102,6 +107,16 @@

/////////////////////////////////////////////

#define SCAN_WIFI_NETWORKS true

// To be able to manually input SSID, not from a scanned SSID lists
#define MANUAL_SSID_INPUT_ALLOWED true

// From 2-15
#define MAX_SSID_IN_LIST 6

/////////////////////////////////////////////

#include <Esp8266_AT_WM_Lite_SAMD.h>

#define HOST_NAME "SAMD_ESP_AT"
Expand Down
7 changes: 5 additions & 2 deletions examples/SAM_DUE_ESP8266Shield/SAM_DUE_ESP8266Shield.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WM_Lite
Licensed under MIT license
Version: 1.1.0
Version: 1.2.0

Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -21,6 +21,7 @@
1.0.4 K Hoang 03/07/2020 Add support to ESP32-AT shields. Modify LOAD_DEFAULT_CONFIG_DATA logic.
Enhance MultiWiFi connection logic. Fix WiFi Status bug.
1.1.0 K Hoang 13/04/2021 Fix invalid "blank" Config Data treated as Valid. Optional one set of WiFi Credentials
1.2.0 Michael H 28/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
*****************************************************************************************************************************/

#include "defines.h"
Expand Down Expand Up @@ -70,8 +71,10 @@ void setup()
while (!Serial);

Serial.print("\nStart SAM_DUE_ESP8266Shield on ");
Serial.println(BOARD_TYPE);
Serial.println(BOARD_NAME);
Serial.println(ESP_AT_WM_LITE_VERSION);
Serial.print("Debug Level = ");
Serial.println(_ESP_AT_WM_LOGLEVEL_);

// initialize serial for ESP module
EspSerial.begin(115200);
Expand Down
16 changes: 15 additions & 1 deletion examples/SAM_DUE_ESP8266Shield/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#define ESP_AT_DEBUG_OUTPUT Serial

#define ESP_AT_DEBUG true
#define _ESP_AT_WM_LOGLEVEL_ 3

// Uncomment to use ESP32-AT commands
//#define USE_ESP32_AT true
Expand Down Expand Up @@ -50,11 +51,14 @@
#endif
#endif

#ifndef BOARD_NAME
#define BOARD_NAME BOARD_TYPE
#endif

// Start location in EEPROM to store config data. Default 0
#define EEPROM_START 0

/////////////////////////////////////////////

// Permit input only one set of WiFi SSID/PWD. The other can be "NULL or "blank"
// Default is false (if not defined) => must input 2 sets of SSID/PWD
#define REQUIRE_ONE_SET_SSID_PW false
Expand All @@ -63,6 +67,16 @@

/////////////////////////////////////////////

#define SCAN_WIFI_NETWORKS true

// To be able to manually input SSID, not from a scanned SSID lists
#define MANUAL_SSID_INPUT_ALLOWED true

// From 2-15
#define MAX_SSID_IN_LIST 6

/////////////////////////////////////////////

#include <Esp8266_AT_WM_Lite_DUE.h>

#define HOST_NAME "SAM_DUE-ESP_AT"
Expand Down
9 changes: 6 additions & 3 deletions examples/STM32_ESP8266Shield/STM32_ESP8266Shield.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WM_Lite
Licensed under MIT license
Version: 1.1.0
Version: 1.2.0

Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -20,7 +20,8 @@
Add DRD support. Add MultiWiFi support
1.0.4 K Hoang 03/07/2020 Add support to ESP32-AT shields. Modify LOAD_DEFAULT_CONFIG_DATA logic.
Enhance MultiWiFi connection logic. Fix WiFi Status bug.
1.1.0 K Hoang 13/04/2021 Fix invalid "blank" Config Data treated as Valid. Optional one set of WiFi Credentials
1.1.0 K Hoang 13/04/2021 Fix invalid "blank" Config Data treated as Valid. Optional one set of WiFi Credentials
1.2.0 Michael H 28/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
*****************************************************************************************************************************/

#include "defines.h"
Expand Down Expand Up @@ -70,8 +71,10 @@ void setup()
while (!Serial);

Serial.print("\nStart STM32_ESP8266Shield on ");
Serial.println(BOARD_TYPE);
Serial.println(BOARD_NAME);
Serial.println(ESP_AT_WM_LITE_VERSION);
Serial.print("Debug Level = ");
Serial.println(_ESP_AT_WM_LOGLEVEL_);

// initialize serial for ESP module
EspSerial.begin(115200);
Expand Down
80 changes: 73 additions & 7 deletions examples/STM32_ESP8266Shield/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,45 +23,101 @@
#define ESP_AT_DEBUG_OUTPUT Serial

#define ESP_AT_DEBUG true
#define _ESP_AT_WM_LOGLEVEL_ 3

// Uncomment to use ESP32-AT commands
//#define USE_ESP32_AT true

#if ( defined(STM32F0) || defined(STM32F1) || defined(STM32F2) || defined(STM32F3) ||defined(STM32F4) || defined(STM32F7) )
#if ( defined(STM32F0) || defined(STM32F1) || defined(STM32F2) || defined(STM32F3) ||defined(STM32F4) || defined(STM32F7) || \
defined(STM32L0) || defined(STM32L1) || defined(STM32L4) || defined(STM32H7) ||defined(STM32G0) || defined(STM32G4) || \
defined(STM32WB) || defined(STM32MP1) || defined(STM32L5) )
#if defined(ESP8266_AT_USE_STM32)
#undef ESP8266_AT_USE_STM32
#endif
#define ESP8266_AT_USE_STM32 true
#endif

#if ( defined(ESP8266) || defined(ESP32) || defined(ARDUINO_AVR_MEGA) || defined(ARDUINO_AVR_MEGA2560) || defined(CORE_TEENSY) || !(ESP8266_AT_USE_STM32) )
#error This code is intended to run on STM32F platform! Please check your Tools->Board setting.
#else
#error This code is intended to run on STM32F platform! Please check your Tools->Board setting.
#endif

#if ESP8266_AT_USE_STM32
// For STM32, you have to declare and enable coreresponding Serial Port somewhere else before using it
#define EspSerial Serial1

#if defined(STM32F0)
#warning STM32F0 board selected
#define BOARD_TYPE "STM32F0"
#error Board STM32F0 not supported
#elif defined(STM32F1)
#warning STM32F1 board selected
#define BOARD_TYPE "STM32F1"
#elif defined(STM32F2)
#warning STM32F2 board selected
#define BOARD_TYPE "STM32F2"
#elif defined(STM32F3)
#warning STM32F3 board selected
#define BOARD_TYPE "STM32F3"
#elif defined(STM32F4)
#warning STM32F4 board selected
#define BOARD_TYPE "STM32F4"
#elif defined(STM32F7)
#define BOARD_TYPE "STM32F7"

#if defined(ARDUINO_NUCLEO_F767ZI)
#warning Nucleo-144 NUCLEO_F767ZI board selected, using HardwareSerial Serial1 @ pin D0/RX and D1/TX
// RX TX
HardwareSerial Serial1(D0, D1);
#else

#warning STM32F7 board selected
#define BOARD_TYPE "STM32F7"

#endif

#elif defined(STM32L0)
#if defined(ARDUINO_NUCLEO_L053R8)
#warning Nucleo-64 NUCLEO_L053R8 board selected, using HardwareSerial Serial1 @ pin D0/RX and D1/TX
// RX TX
HardwareSerial Serial1(D0, D1); // (PA3, PA2);
#else

#warning STM32L0 board selected
#define BOARD_TYPE "STM32L0"

#endif

#elif defined(STM32L1)
#warning STM32L1 board selected
#define BOARD_TYPE "STM32L1"
#elif defined(STM32L4)
#warning STM32L4 board selected
#define BOARD_TYPE "STM32L4"
#elif defined(STM32L5)
#warning STM32L5 board selected
#define BOARD_TYPE "STM32L5"
#elif defined(STM32H7)
#warning STM32H7 board selected
#define BOARD_TYPE "STM32H7"
#elif defined(STM32G0)
#warning STM32G0 board selected
#define BOARD_TYPE "STM32G0"
#elif defined(STM32G4)
#warning STM32G4 board selected
#define BOARD_TYPE "STM32G4"
#elif defined(STM32WB)
#warning STM32WB board selected
#define BOARD_TYPE "STM32WB"
#elif defined(STM32MP1)
#warning STM32MP1 board selected
#define BOARD_TYPE "STM32MP1"
#else
#warning STM32 unknown board selected
#define BOARD_TYPE "STM32 Unknown"
#endif

#endif

#ifndef BOARD_NAME
#define BOARD_NAME BOARD_TYPE
#endif

// Start location in EEPROM to store config data. Default 0
// Config data Size currently is 128 bytes)
#define EEPROM_START 0
Expand All @@ -76,6 +132,16 @@

/////////////////////////////////////////////

#define SCAN_WIFI_NETWORKS true

// To be able to manually input SSID, not from a scanned SSID lists
#define MANUAL_SSID_INPUT_ALLOWED true

// From 2-15
#define MAX_SSID_IN_LIST 6

/////////////////////////////////////////////

#include <Esp8266_AT_WM_Lite_STM32.h>


Expand Down
Loading

0 comments on commit 263f560

Please sign in to comment.