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

Commit

Permalink
v1.0.3
Browse files Browse the repository at this point in the history
### New Version v1.0.3

1. Add support to STM32 (STM32,F0,F1, F2, F3, F4, F7, etc) boards
  • Loading branch information
khoih-prog authored Mar 4, 2020
1 parent a0dcffc commit 6f41a58
Show file tree
Hide file tree
Showing 39 changed files with 908 additions and 218 deletions.
51 changes: 44 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

[![arduino-library-badge](https://www.ardu-badge.com/badge/ESP8266_AT_WebServer.svg?)](https://www.ardu-badge.com/ESP8266_AT_WebServer)

### New Version v1.0.3

1. Add support to STM32 (STM32,F0,F1, F2, F3, F4, F7, etc) boards

### New Version v1.0.2

1. Add support to SAMD (DUE, ZERO, MKR, NANO_33_IOT, M0, M0 Pro, AdaFruit CIRCUITPLAYGROUND_EXPRESS, etc.) boards

This is simple yet complete WebServer library for `AVR, Teensy, SAMD, etc.` boards running `ESP8266 AT-command` shields. The functions are similar and compatible to ESP8266/ESP32 WebServer libraries to make life much easier to port sketches from ESP8266/ESP32.
This is simple yet complete WebServer library for `AVR, Teensy, SAM DUE, SAMD, STM32, etc.` boards running `ESP8266 AT-command` shields. The functions are similar and compatible to ESP8266/ESP32 WebServer libraries to make life much easier to port sketches from ESP8266/ESP32.

The library supports
1. WiFi Client, STA and AP mode
Expand All @@ -23,13 +27,15 @@ The ESP8266_AT_Web_Server class found in `ESP8266_AT_Web_Server.h` header, is a

## Prerequisite
1. [`Arduino IDE 1.8.11 or later` for Arduino](https://www.arduino.cc/en/Main/Software)
2. `Arduino AVR core 1.8.2 or later` for Arduino (Use Arduino Board Manager)
3. [`Functional-VLPP library`](https://github.com/khoih-prog/functional-vlpp) to use server's lambda function
2. `Arduino AVR core 1.8.2 or later` for Arduino (Use Arduino Board Manager) for AVR boards
3. [`Arduino Core for STM32 v1.8.0 or later`](https://github.com/khoih-prog/Arduino_Core_STM32) for STM32 boards
4. [`Functional-VLPP library`](https://github.com/khoih-prog/functional-vlpp) to use server's lambda function

## Installation

### Use Arduino Library Manager
Another way is to use `Arduino Library Manager`. Search for `ESP8266_AT_Web_Server`, then select / install the latest version.
The best and easiest way is to use `Arduino Library Manager`. Search for `ESP8266_AT_Web_Server`, then select / install the latest version.
You can also use this link [![arduino-library-badge](https://www.ardu-badge.com/badge/ESP8266_AT_WebServer.svg?)](https://www.ardu-badge.com/ESP8266_AT_WebServer) for more detailed instructions.

### Manual Install

Expand Down Expand Up @@ -213,18 +219,23 @@ Please take a look at examples, as well.
```cpp
#define DEBUG_ESP8266_AT_WEBSERVER_PORT Serial

#include <ESP8266_AT_WebServer.h>

#if ( defined(ARDUINO_SAM_DUE) || defined(ARDUINO_SAMD_ZERO) || defined(ARDUINO_SAMD_MKR1000) || defined(ARDUINO_SAMD_MKRWIFI1010) \
|| defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_SAMD_MKRFox1200) || defined(ARDUINO_SAMD_MKRWAN1300) || defined(ARDUINO_SAMD_MKRWAN1310) \
|| defined(ARDUINO_SAMD_MKRGSM1400) || defined(ARDUINO_SAMD_MKRNB1500) || defined(ARDUINO_SAMD_MKRVIDOR4000) || defined(__SAMD21G18A__) \
|| defined(ARDUINO_SAMD_CIRCUITPLAYGROUND_EXPRESS) || defined(__SAM3X8E__) || defined(__CPU_ARC__) )
|| defined(ARDUINO_SAMD_CIRCUITPLAYGROUND_EXPRESS) || defined(__SAM3X8E__) || defined(__CPU_ARC__) )
#if defined(ESP8266_AT_USE_SAMD)
#undef ESP8266_AT_USE_SAMD
#endif
#define ESP8266_AT_USE_SAMD true
#endif

#if ( defined(STM32F0) || defined(STM32F1) || defined(STM32F2) || defined(STM32F3) ||defined(STM32F4) || defined(STM32F7) )
#if defined(ESP8266_AT_USE_STM32)
#undef ESP8266_AT_USE_STM32
#endif
#define ESP8266_AT_USE_STM32 true
#endif

#ifdef CORE_TEENSY
// For Teensy 4.0
#define EspSerial Serial2 //Serial2, Pin RX2 : 7, TX2 : 8
Expand Down Expand Up @@ -266,12 +277,34 @@ Please take a look at examples, as well.
#define BOARD_TYPE "SAMD Unknown"
#endif

#elif defined(ESP8266_AT_USE_STM32)
// For STM32
#define EspSerial Serial1

#if defined(STM32F0)
#define BOARD_TYPE "STM32F0"
#elif defined(STM32F1)
#define BOARD_TYPE "STM32F1"
#elif defined(STM32F2)
#define BOARD_TYPE "STM32F2"
#elif defined(STM32F3)
#define BOARD_TYPE "STM32F3"
#elif defined(STM32F4)
#define BOARD_TYPE "STM32F4"
#elif defined(STM32F7)
#define BOARD_TYPE "STM32F7"
#else
#warning STM32 unknown board selected
#define BOARD_TYPE "STM32 Unknown"
#endif
#else
// For Mega
#define EspSerial Serial3
#define BOARD_TYPE "AVR Mega"
#endif

#include <ESP8266_AT_WebServer.h>

char ssid[] = "****"; // your network SSID (name)
char pass[] = "****"; // your network password

Expand Down Expand Up @@ -410,6 +443,10 @@ HTTP server started @ 192.168.2.107

```
### New Version v1.0.3
1. Add support to STM32 (STM32,F0,F1, F2, F3, F4, F7, etc) boards
### Version v1.0.2
1. Add support to SAMD (DUE, ZERO, MKR, NANO_33_IOT, M0, Mo Pro, AdaFruit CIRCUITPLAYGROUND_EXPRESS, etc.) boards
Expand Down
35 changes: 31 additions & 4 deletions examples/AdvancedWebServer/AdvancedWebServer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Forked and modified from ESP8266 https://github.com/esp8266/Arduino/releases
* Built by Khoi Hoang https://github.com/khoih-prog/ESP8266_AT_WebServer
* Licensed under MIT license
* Version: 1.0.2
* Version: 1.0.3
*
* Copyright (c) 2015, Majenko Technologies
* All rights reserved.
Expand Down Expand Up @@ -43,11 +43,10 @@
* 1.0.0 K Hoang 12/02/2020 Initial coding for Arduino Mega, Teensy, etc
* 1.0.1 K Hoang 17/02/2020 Add support to server's lambda function calls
* 1.0.2 K Hoang 22/02/2020 Add support to SAMD (DUE, ZERO, MKR, NANO_33_IOT, M0, Mo Pro, AdaFruit, etc) boards
* 1.0.3 K Hoang 03/03/2020 Add support to STM32 (STM32,F0,F1, F2, F3, F4, F7, etc) boards
*****************************************************************************************************************************/
#define DEBUG_ESP8266_AT_WEBSERVER_PORT Serial

#include <ESP8266_AT_WebServer.h>

#if ( defined(ARDUINO_SAM_DUE) || defined(ARDUINO_SAMD_ZERO) || defined(ARDUINO_SAMD_MKR1000) || defined(ARDUINO_SAMD_MKRWIFI1010) \
|| defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_SAMD_MKRFox1200) || defined(ARDUINO_SAMD_MKRWAN1300) || defined(ARDUINO_SAMD_MKRWAN1310) \
|| defined(ARDUINO_SAMD_MKRGSM1400) || defined(ARDUINO_SAMD_MKRNB1500) || defined(ARDUINO_SAMD_MKRVIDOR4000) || defined(__SAMD21G18A__) \
Expand All @@ -58,6 +57,13 @@
#define ESP8266_AT_USE_SAMD true
#endif

#if ( defined(STM32F0) || defined(STM32F1) || defined(STM32F2) || defined(STM32F3) ||defined(STM32F4) || defined(STM32F7) )
#if defined(ESP8266_AT_USE_STM32)
#undef ESP8266_AT_USE_STM32
#endif
#define ESP8266_AT_USE_STM32 true
#endif

#ifdef CORE_TEENSY
// For Teensy 4.0
#define EspSerial Serial2 //Serial2, Pin RX2 : 7, TX2 : 8
Expand Down Expand Up @@ -99,13 +105,34 @@
#define BOARD_TYPE "SAMD Unknown"
#endif


#elif defined(ESP8266_AT_USE_STM32)
// For STM32
#define EspSerial Serial1

#if defined(STM32F0)
#define BOARD_TYPE "STM32F0"
#elif defined(STM32F1)
#define BOARD_TYPE "STM32F1"
#elif defined(STM32F2)
#define BOARD_TYPE "STM32F2"
#elif defined(STM32F3)
#define BOARD_TYPE "STM32F3"
#elif defined(STM32F4)
#define BOARD_TYPE "STM32F4"
#elif defined(STM32F7)
#define BOARD_TYPE "STM32F7"
#else
#warning STM32 unknown board selected
#define BOARD_TYPE "STM32 Unknown"
#endif
#else
// For Mega
#define EspSerial Serial3
#define BOARD_TYPE "AVR Mega"
#endif

#include <ESP8266_AT_WebServer.h>

char ssid[] = "****"; // your network SSID (name)
char pass[] = "****"; // your network password

Expand Down
39 changes: 33 additions & 6 deletions examples/ConnectWPA/ConnectWPA.ino
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Forked and modified from ESP8266 https://github.com/esp8266/Arduino/releases
* Built by Khoi Hoang https://github.com/khoih-prog/ESP8266_AT_WebServer
* Licensed under MIT license
* Version: 1.0.2
* Version: 1.0.3
*
* This example connects to an encrypted WiFi network using an ESP8266 module.
* Then it prints the MAC address of the WiFi shield, the IP address obtained
Expand All @@ -17,7 +17,7 @@
* ------- ----------- ---------- -----------
* 1.0.0 K Hoang 12/02/2020 Initial coding for Arduino Mega, Teensy, etc
* 1.0.1 K Hoang 17/02/2020 Add support to server's lambda function calls
* 1.0.2 K Hoang 22/02/2020 Add support to SAMD (DUE, ZERO, MKR, NANO_33_IOT, M0, Mo Pro, AdaFruit, etc) boards
* 1.0.3 K Hoang 03/03/2020 Add support to STM32 (STM32,F0,F1, F2, F3, F4, F7, etc) boards
*****************************************************************************************************************************/

#define DEBUG_ESP8266_AT_WEBSERVER_PORT Serial
Expand All @@ -34,6 +34,13 @@
#define ESP8266_AT_USE_SAMD true
#endif

#if ( defined(STM32F0) || defined(STM32F1) || defined(STM32F2) || defined(STM32F3) ||defined(STM32F4) || defined(STM32F7) )
#if defined(ESP8266_AT_USE_STM32)
#undef ESP8266_AT_USE_STM32
#endif
#define ESP8266_AT_USE_STM32 true
#endif

#ifdef CORE_TEENSY
// For Teensy 4.0
#define EspSerial Serial2 //Serial2, Pin RX2 : 7, TX2 : 8
Expand All @@ -44,7 +51,7 @@
#else
#define BOARD_TYPE "TEENSY 3.X"
#endif

#elif defined(ESP8266_AT_USE_SAMD)
// For SAMD
#define EspSerial Serial1
Expand Down Expand Up @@ -75,10 +82,30 @@
#define BOARD_TYPE "SAMD Unknown"
#endif

#elif defined(ESP8266_AT_USE_STM32)
// For STM32
#define EspSerial Serial1

#if defined(STM32F0)
#define BOARD_TYPE "STM32F0"
#elif defined(STM32F1)
#define BOARD_TYPE "STM32F1"
#elif defined(STM32F2)
#define BOARD_TYPE "STM32F2"
#elif defined(STM32F3)
#define BOARD_TYPE "STM32F3"
#elif defined(STM32F4)
#define BOARD_TYPE "STM32F4"
#elif defined(STM32F7)
#define BOARD_TYPE "STM32F7"
#else
#warning STM32 unknown board selected
#define BOARD_TYPE "STM32 Unknown"
#endif
#else
// For Mega
#define EspSerial Serial3
#define BOARD_TYPE "AVR Mega"
// For Mega
#define EspSerial Serial3
#define BOARD_TYPE "AVR Mega"
#endif

char ssid[] = "****"; // your network SSID (name)
Expand Down
43 changes: 35 additions & 8 deletions examples/HelloServer/HelloServer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,17 @@
* Forked and modified from ESP8266 https://github.com/esp8266/Arduino/releases
* Built by Khoi Hoang https://github.com/khoih-prog/ESP8266_AT_WebServer
* Licensed under MIT license
* Version: 1.0.2
* Version: 1.0.3
*
* Version Modified By Date Comments
* ------- ----------- ---------- -----------
* 1.0.0 K Hoang 12/02/2020 Initial coding for Arduino Mega, Teensy, etc
* 1.0.1 K Hoang 17/02/2020 Add support to server's lambda function calls
* 1.0.2 K Hoang 22/02/2020 Add support to SAMD (DUE, ZERO, MKR, NANO_33_IOT, M0, Mo Pro, AdaFruit, etc) boards
* 1.0.3 K Hoang 03/03/2020 Add support to STM32 (STM32,F0,F1, F2, F3, F4, F7, etc) boards
*****************************************************************************************************************************/

#define DEBUG_ESP8266_AT_WEBSERVER_PORT Serial

#include <ESP8266_AT_WebServer.h>

#if ( defined(ARDUINO_SAM_DUE) || defined(ARDUINO_SAMD_ZERO) || defined(ARDUINO_SAMD_MKR1000) || defined(ARDUINO_SAMD_MKRWIFI1010) \
|| defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_SAMD_MKRFox1200) || defined(ARDUINO_SAMD_MKRWAN1300) || defined(ARDUINO_SAMD_MKRWAN1310) \
|| defined(ARDUINO_SAMD_MKRGSM1400) || defined(ARDUINO_SAMD_MKRNB1500) || defined(ARDUINO_SAMD_MKRVIDOR4000) || defined(__SAMD21G18A__) \
Expand All @@ -29,6 +27,13 @@
#define ESP8266_AT_USE_SAMD true
#endif

#if ( defined(STM32F0) || defined(STM32F1) || defined(STM32F2) || defined(STM32F3) ||defined(STM32F4) || defined(STM32F7) )
#if defined(ESP8266_AT_USE_STM32)
#undef ESP8266_AT_USE_STM32
#endif
#define ESP8266_AT_USE_STM32 true
#endif

#ifdef CORE_TEENSY
// For Teensy 4.0
#define EspSerial Serial2 //Serial2, Pin RX2 : 7, TX2 : 8
Expand All @@ -39,7 +44,7 @@
#else
#define BOARD_TYPE "TEENSY 3.X"
#endif

#elif defined(ESP8266_AT_USE_SAMD)
// For SAMD
#define EspSerial Serial1
Expand Down Expand Up @@ -70,12 +75,34 @@
#define BOARD_TYPE "SAMD Unknown"
#endif

#elif defined(ESP8266_AT_USE_STM32)
// For STM32
#define EspSerial Serial1

#if defined(STM32F0)
#define BOARD_TYPE "STM32F0"
#elif defined(STM32F1)
#define BOARD_TYPE "STM32F1"
#elif defined(STM32F2)
#define BOARD_TYPE "STM32F2"
#elif defined(STM32F3)
#define BOARD_TYPE "STM32F3"
#elif defined(STM32F4)
#define BOARD_TYPE "STM32F4"
#elif defined(STM32F7)
#define BOARD_TYPE "STM32F7"
#else
#warning STM32 unknown board selected
#define BOARD_TYPE "STM32 Unknown"
#endif
#else
// For Mega
#define EspSerial Serial3
#define BOARD_TYPE "AVR Mega"
// For Mega
#define EspSerial Serial3
#define BOARD_TYPE "AVR Mega"
#endif

#include <ESP8266_AT_WebServer.h>

char ssid[] = "****"; // your network SSID (name)
char pass[] = "****"; // your network password

Expand Down
Loading

0 comments on commit 6f41a58

Please sign in to comment.