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

Commit

Permalink
v1.4.0 to add support to Mbed RP2040-based boards
Browse files Browse the repository at this point in the history
### Major Release v1.4.0

1. Add support to RP2040-based boards, such as **Nano_RP2040_Connect, RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040**, using [**Arduino-mbed RP2040** core](https://github.com/arduino/ArduinoCore-mbed).
  • Loading branch information
khoih-prog committed Jun 2, 2021
1 parent 9aa449f commit 414ea55
Show file tree
Hide file tree
Showing 37 changed files with 2,671 additions and 367 deletions.
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ 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, STM32 core v2.0.0, etc.)
* Arduino IDE version (e.g. 1.8.15) or Platform.io version
* Board Core Version (e.g. Arduino SAMDUE core v1.6.12, MBED RP2040 core v2.1.0, 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 @@ -26,8 +26,8 @@ Please ensure to specify the following:
### Example

```
Arduino IDE version: 1.8.13
Arduino SAM DUE Core Version 1.6.12
Arduino IDE version: 1.8.15
Arduino MBED RP2040 core v2.1.0
OS: Ubuntu 20.04 LTS
Linux xy-Inspiron-3593 5.4.0-73-generic #82-Ubuntu SMP Wed Apr 14 17:39:42 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Expand Down
199 changes: 157 additions & 42 deletions README.md

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions examples/Mega_ESP8266Shield/Credentials.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/****************************************************************************************************************************
Credentials.h for Mega_ESP8266Shield.ino
For AVR or Generic boards using ESP8266 AT WiFi Shields, using much less code to support boards with smaller memory
ESP_AT_WM_Lite is a library for the Mega, Teensy, SAM DUE, SAMD and STM32 boards (https://github.com/khoih-prog/ESP_AT_WM_Lite)
to enable store Credentials in EEPROM to easy configuration/reconfiguration and autoconnect/autoreconnect of WiFi and other services
without Hardcoding.
Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WM_Lite
Licensed under MIT license
Credentials.h for Mega_ESP8266Shield.ino
For AVR or Generic boards using ESP8266 AT WiFi Shields, using much less code to support boards with smaller memory
ESP_AT_WM_Lite is a library for the Mega, Teensy, SAM DUE, SAMD and STM32 boards (https://github.com/khoih-prog/ESP_AT_WM_Lite)
to enable store Credentials in EEPROM to easy configuration/reconfiguration and autoconnect/autoreconnect of WiFi and other services
without Hardcoding.
Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WM_Lite
Licensed under MIT license
*****************************************************************************************************************************/

#ifndef Credentials_h
Expand Down
29 changes: 15 additions & 14 deletions examples/Mega_ESP8266Shield/Mega_ESP8266Shield.ino
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
/****************************************************************************************************************************
Mega_ESP8266Shield.ino
For AVR or Generic boards using ESP8266 AT WiFi Shields, using much less code to support boards with smaller memory

ESP_AT_WM_Lite is a library for the Mega, Teensy, SAM DUE, SAMD and STM32 boards (https://github.com/khoih-prog/ESP_AT_WM_Lite)
to enable store Credentials in EEPROM to easy configuration/reconfiguration and autoconnect/autoreconnect of WiFi and other services
without Hardcoding.

Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WM_Lite
Licensed under MIT license
Version: 1.3.0
Mega_ESP8266Shield.ino
For AVR or Generic boards using ESP8266 AT WiFi Shields, using much less code to support boards with smaller memory
ESP_AT_WM_Lite is a library for the Mega, Teensy, SAM DUE, SAMD and STM32 boards (https://github.com/khoih-prog/ESP_AT_WM_Lite)
to enable store Credentials in EEPROM to easy configuration/reconfiguration and autoconnect/autoreconnect of WiFi and other services
without Hardcoding.
Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WM_Lite
Licensed under MIT license
Version: 1.4.0

Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 09/03/2020 Initial coding
1.0.1 K Hoang 20/03/2020 Add feature to enable adding dynamically more Credentials parameters in sketch
1.0.2 K Hoang 17/04/2020 Fix bug. Add support to SAMD51 and SAMD DUE. WPA2 SSID PW to 63 chars.
Permit to input special chars such as !,@,#,$,%,^,&,* into data fields.
Permit to input special chars such as !,@,#,$,%,^,&,* into data fields.
1.0.3 K Hoang 11/06/2020 Add support to nRF52 boards, such as AdaFruit Feather nRF52832, NINA_B30_ublox, etc.
Add DRD support. Add MultiWiFi support
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.
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
1.3.0 K Hoang 12/05/2021 Add support to RP2040-based boards, such as RASPBERRY_PI_PICO
1.3.0 K Hoang 12/05/2021 Add support to RASPBERRY_PI_PICO using Arduino-pico core
1.4.0 K Hoang 01/06/2021 Add support to Nano_RP2040_Connect, RASPBERRY_PI_PICO using RP2040 Arduino mbed core
*****************************************************************************************************************************/

#include "defines.h"
Expand Down
21 changes: 11 additions & 10 deletions examples/Mega_ESP8266Shield/defines.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/****************************************************************************************************************************
defines.h for Mega_ESP8266Shield.ino
For AVR or Generic boards using ESP8266 AT WiFi Shields, using much less code to support boards with smaller memory
ESP_AT_WM_Lite is a library for the Mega, Teensy, SAM DUE, SAMD and STM32 boards (https://github.com/khoih-prog/ESP_AT_WM_Lite)
to enable store Credentials in EEPROM to easy configuration/reconfiguration and autoconnect/autoreconnect of WiFi and other services
without Hardcoding.
Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WM_Lite
Licensed under MIT license
defines.h for Mega_ESP8266Shield.ino
For AVR or Generic boards using ESP8266 AT WiFi Shields, using much less code to support boards with smaller memory
ESP_AT_WM_Lite is a library for the Mega, Teensy, SAM DUE, SAMD and STM32 boards (https://github.com/khoih-prog/ESP_AT_WM_Lite)
to enable store Credentials in EEPROM to easy configuration/reconfiguration and autoconnect/autoreconnect of WiFi and other services
without Hardcoding.
Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WM_Lite
Licensed under MIT license
*****************************************************************************************************************************/

#ifndef defines_h
Expand Down Expand Up @@ -52,7 +52,8 @@

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

#define USE_DYNAMIC_PARAMETERS true
#define USE_DYNAMIC_PARAMETERS false
#warning Disable USE_DYNAMIC_PARAMETERS for ESP_AT_SHIELD

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

Expand Down
20 changes: 10 additions & 10 deletions examples/Mega_ESP8266Shield/dynamicParams.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/****************************************************************************************************************************
dynamicParams.h for Mega_ESP8266Shield.ino
For AVR or Generic boards using ESP8266 AT WiFi Shields, using much less code to support boards with smaller memory
ESP_AT_WM_Lite is a library for the Mega, Teensy, SAM DUE, SAMD and STM32 boards (https://github.com/khoih-prog/ESP_AT_WM_Lite)
to enable store Credentials in EEPROM to easy configuration/reconfiguration and autoconnect/autoreconnect of WiFi and other services
without Hardcoding.
Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WM_Lite
Licensed under MIT license
/****************************************************************************************************************************
dynamicParams.h for Mega_ESP8266Shield.ino
For AVR or Generic boards using ESP8266 AT WiFi Shields, using much less code to support boards with smaller memory
ESP_AT_WM_Lite is a library for the Mega, Teensy, SAM DUE, SAMD and STM32 boards (https://github.com/khoih-prog/ESP_AT_WM_Lite)
to enable store Credentials in EEPROM to easy configuration/reconfiguration and autoconnect/autoreconnect of WiFi and other services
without Hardcoding.
Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WM_Lite
Licensed under MIT license
*****************************************************************************************************************************/

#ifndef dynamicParams_h
Expand Down
18 changes: 9 additions & 9 deletions examples/RPi_Pico_ESP8266Shield/Credentials.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/****************************************************************************************************************************
Credentials.h for nRF52_ESP8266Shield.ino
For nRF52 boards using ESP8266 AT WiFi Shields, using much less code to support boards with smaller memory
ESP_AT_WM_Lite is a library for the Mega, Teensy, SAM DUE, SAMD and STM32 boards (https://github.com/khoih-prog/ESP_AT_WM_Lite)
to enable store Credentials in EEPROM to easy configuration/reconfiguration and autoconnect/autoreconnect of WiFi and other services
without Hardcoding.
Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WM_Lite
Licensed under MIT license
Credentials.h
For nRF52 boards using ESP8266 AT WiFi Shields, using much less code to support boards with smaller memory
ESP_AT_WM_Lite is a library for the Mega, Teensy, SAM DUE, SAMD and STM32 boards (https://github.com/khoih-prog/ESP_AT_WM_Lite)
to enable store Credentials in EEPROM to easy configuration/reconfiguration and autoconnect/autoreconnect of WiFi and other services
without Hardcoding.
Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WM_Lite
Licensed under MIT license
*****************************************************************************************************************************/

#ifndef Credentials_h
Expand Down
29 changes: 15 additions & 14 deletions examples/RPi_Pico_ESP8266Shield/RPi_Pico_ESP8266Shield.ino
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
/****************************************************************************************************************************
RPi_Pico_ESP8266Shield.ino
For nRF52 boards using ESP8266 AT WiFi Shields, using much less code to support boards with smaller memory

ESP_AT_WM_Lite is a library for the Mega, Teensy, SAM DUE, SAMD and STM32 boards (https://github.com/khoih-prog/ESP_AT_WM_Lite)
to enable store Credentials in EEPROM to easy configuration/reconfiguration and autoconnect/autoreconnect of WiFi and other services
without Hardcoding.

Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WM_Lite
Licensed under MIT license
Version: 1.3.0
RPi_Pico_ESP8266Shield.ino
For nRF52 boards using ESP8266 AT WiFi Shields, using much less code to support boards with smaller memory
ESP_AT_WM_Lite is a library for the Mega, Teensy, SAM DUE, SAMD and STM32 boards (https://github.com/khoih-prog/ESP_AT_WM_Lite)
to enable store Credentials in EEPROM to easy configuration/reconfiguration and autoconnect/autoreconnect of WiFi and other services
without Hardcoding.
Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WM_Lite
Licensed under MIT license
Version: 1.4.0

Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 09/03/2020 Initial coding
1.0.1 K Hoang 20/03/2020 Add feature to enable adding dynamically more Credentials parameters in sketch
1.0.2 K Hoang 17/04/2020 Fix bug. Add support to SAMD51 and SAMD DUE. WPA2 SSID PW to 63 chars.
Permit to input special chars such as !,@,#,$,%,^,&,* into data fields.
Permit to input special chars such as !,@,#,$,%,^,&,* into data fields.
1.0.3 K Hoang 11/06/2020 Add support to nRF52 boards, such as AdaFruit Feather nRF52832, NINA_B30_ublox, etc.
Add DRD support. Add MultiWiFi support
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.
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
1.3.0 K Hoang 12/05/2021 Add support to RP2040-based boards, such as RASPBERRY_PI_PICO
1.3.0 K Hoang 12/05/2021 Add support to RASPBERRY_PI_PICO using Arduino-pico core
1.4.0 K Hoang 01/06/2021 Add support to Nano_RP2040_Connect, RASPBERRY_PI_PICO using RP2040 Arduino mbed core
*****************************************************************************************************************************/

#include "defines.h"
Expand Down
110 changes: 78 additions & 32 deletions examples/RPi_Pico_ESP8266Shield/defines.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/****************************************************************************************************************************
defines.h for nRF52_ESP8266Shield.ino
For nRF52 boards using ESP8266 AT WiFi Shields, using much less code to support boards with smaller memory
ESP_AT_WM_Lite is a library for the Mega, Teensy, SAM DUE, SAMD and STM32 boards (https://github.com/khoih-prog/ESP_AT_WM_Lite)
to enable store Credentials in EEPROM to easy configuration/reconfiguration and autoconnect/autoreconnect of WiFi and other services
without Hardcoding.
Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WM_Lite
Licensed under MIT license
defines.h
For nRF52 boards using ESP8266 AT WiFi Shields, using much less code to support boards with smaller memory
ESP_AT_WM_Lite is a library for the Mega, Teensy, SAM DUE, SAMD and STM32 boards (https://github.com/khoih-prog/ESP_AT_WM_Lite)
to enable store Credentials in EEPROM to easy configuration/reconfiguration and autoconnect/autoreconnect of WiFi and other services
without Hardcoding.
Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WM_Lite
Licensed under MIT license
*****************************************************************************************************************************/

#ifndef defines_h
Expand All @@ -28,30 +28,64 @@
// Uncomment to use ESP32-AT commands
//#define USE_ESP32_AT true

#if ( defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_RASPBERRY_PI_PICO) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) || defined(ARDUINO_GENERIC_RP2040) )
#if defined(ESP8266_AT_USE_RP2040)
#undef ESP8266_AT_USE_RP2040
#endif
#define ESP8266_AT_USE_RP2040 true
#else
#error This code is intended to run only on the RP2040-based boards ! Please check your Tools->Board setting.
#endif

#if (ESP8266_AT_USE_RP2040)
#if ( defined(ARDUINO_NANO_RP2040_CONNECT) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_RASPBERRY_PI_PICO) || \
defined(ARDUINO_GENERIC_RP2040) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) )

#warning RASPBERRY_PI_PICO board selected

#if defined(ARDUINO_ARCH_MBED)

#warning Using ARDUINO_ARCH_MBED

#if defined(ESP8266_AT_USE_MBED_RP2040)
#undef ESP8266_AT_USE_MBED_RP2040
#endif

#define ESP8266_AT_USE_MBED_RP2040 true
#define ESP8266_AT_USE_RP2040 false

// Use true only for testing. Will erase stored config data
#define FORCE_REFORMAT false

#if ( defined(ARDUINO_NANO_RP2040_CONNECT) || defined(ARDUINO_RASPBERRY_PI_PICO) || \
defined(ARDUINO_GENERIC_RP2040) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) )
// Only undef known BOARD_NAME to use better one
#undef BOARD_NAME
#endif

#if defined(ARDUINO_RASPBERRY_PI_PICO)
#define BOARD_NAME "MBED RASPBERRY_PI_PICO"
#elif defined(ARDUINO_ADAFRUIT_FEATHER_RP2040)
#define BOARD_NAME "MBED ADAFRUIT_FEATHER_RP2040"
#elif defined(ARDUINO_GENERIC_RP2040)
#define BOARD_NAME "MBED GENERIC_RP2040"
#elif defined(ARDUINO_NANO_RP2040_CONNECT)
#define BOARD_NAME "MBED NANO_RP2040_CONNECT"
#else
// Use default BOARD_NAME if exists
#if !defined(BOARD_NAME)
#define BOARD_NAME "MBED Unknown RP2040"
#endif
#endif

#if defined(ARDUINO_RASPBERRY_PI_PICO)
#define BOARD_TYPE "ARDUINO_RASPBERRY_PI_PICO"
#elif defined(ARDUINO_ADAFRUIT_FEATHER_RP2040)
#define BOARD_TYPE "ARDUINO_ADAFRUIT_FEATHER_RP2040"
#elif defined(ARDUINO_GENERIC_RP2040)
#define BOARD_TYPE "ARDUINO_GENERIC_RP2040"
#else
#define BOARD_TYPE "RP2040 Unknown"

#if defined(ESP8266_AT_USE_RP2040)
#undef ESP8266_AT_USE_RP2040
#endif

#define ESP8266_AT_USE_RP2040 true
#define ESP8266_AT_USE_MBED_RP2040 false

#endif

#define EspSerial Serial1
#define EspSerial Serial1

#endif //ESP8266_AT_USE_RP2040
#else

#error This code is intended to run only on the RP2040-based boards ! Please check your Tools->Board setting

#endif

#ifndef BOARD_NAME
#define BOARD_NAME BOARD_TYPE
Expand All @@ -63,7 +97,8 @@
// 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
#define USE_DYNAMIC_PARAMETERS false
#warning Disable USE_DYNAMIC_PARAMETERS for ESP_AT_SHIELD

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

Expand All @@ -73,13 +108,24 @@
#define MANUAL_SSID_INPUT_ALLOWED true

// From 2-15
#define MAX_SSID_IN_LIST 6
#define MAX_SSID_IN_LIST 4

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

#include <Esp8266_AT_WM_Lite_RPi_Pico.h>
#if ESP8266_AT_USE_RP2040

#include <Esp8266_AT_WM_Lite_RPi_Pico.h>

#define HOST_NAME "RP2040-ESP_AT"

#define HOST_NAME "RP2040-ESP_AT"
#elif ESP8266_AT_USE_MBED_RP2040

#include <Esp8266_AT_WM_Lite_Mbed_RPi_Pico.h>

#define HOST_NAME "MBED-RP2040-ESP_AT"

#endif


// SSID and PW for Config Portal
String portal_ssid = "CfgPrtl-SSID";
Expand Down
18 changes: 9 additions & 9 deletions examples/RPi_Pico_ESP8266Shield/dynamicParams.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/****************************************************************************************************************************
dynamicParams.h for nRF52_ESP8266Shield.ino
For nRF52 boards using ESP8266 AT WiFi Shields, using much less code to support boards with smaller memory
ESP_AT_WM_Lite is a library for the Mega, Teensy, SAM DUE, SAMD and STM32 boards (https://github.com/khoih-prog/ESP_AT_WM_Lite)
to enable store Credentials in EEPROM to easy configuration/reconfiguration and autoconnect/autoreconnect of WiFi and other services
without Hardcoding.
Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WM_Lite
Licensed under MIT license
dynamicParams.h
For nRF52 boards using ESP8266 AT WiFi Shields, using much less code to support boards with smaller memory
ESP_AT_WM_Lite is a library for the Mega, Teensy, SAM DUE, SAMD and STM32 boards (https://github.com/khoih-prog/ESP_AT_WM_Lite)
to enable store Credentials in EEPROM to easy configuration/reconfiguration and autoconnect/autoreconnect of WiFi and other services
without Hardcoding.
Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WM_Lite
Licensed under MIT license
*****************************************************************************************************************************/

#ifndef dynamicParams_h
Expand Down
Loading

0 comments on commit 414ea55

Please sign in to comment.