Skip to content

Commit

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

1. Add support to all STM32F/L/H/G/WB/MP1 boards.
2. Add support to Seeeduino SAMD21/SAMD51 boards.
3. Restructure examples. Clean-up code.
  • Loading branch information
khoih-prog authored Jul 24, 2020
1 parent 58a7b5e commit 80d1d7b
Show file tree
Hide file tree
Showing 46 changed files with 6,211 additions and 3,438 deletions.
553 changes: 374 additions & 179 deletions README.md

Large diffs are not rendered by default.

192 changes: 16 additions & 176 deletions examples/AP_SimpleWebServer/AP_SimpleWebServer.ino
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
/****************************************************************************************************************************
AP_SimpleWebServer.ino - Simple Arduino WiFi Web Server LED Blink sample for SAMD21 running WiFiNINA shield
For ESP32-based WiFi shields, such as WiFiNINA W101, W102, W13x, etc
WiFiWebServer is a library for the ESP32-based WiFi shields to run WebServer
Forked and modified from ESP8266 https://github.com/esp8266/Arduino/releases
Forked and modified from Arduino WiFiNINA library https://www.arduino.cc/en/Reference/WiFiNINA
Built by Khoi Hoang https://github.com/khoih-prog/WiFiWebServer
Licensed under MIT license
Version: 1.0.5
For any WiFi shields, such as WiFiNINA W101, W102, W13x, or custom, such as ESP8266/ESP32-AT, Ethernet, etc
WiFiWebServer is a library for the ESP32-based WiFi shields to run WebServer
Based on and modified from ESP8266 https://github.com/esp8266/Arduino/releases
Based on and modified from Arduino WiFiNINA library https://www.arduino.cc/en/Reference/WiFiNINA
Built by Khoi Hoang https://github.com/khoih-prog/WiFiWebServer
Licensed under MIT license
A simple web server that lets you blink an LED via the web.
This sketch will create a new access point (with no password).
Expand All @@ -23,180 +22,21 @@
by Tom Igoe
adapted to WiFi AP by Adafruit
Version Modified By Date Comments
------- ----------- ---------- -----------
Version: 1.0.6
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 12/02/2020 Initial coding for SAMD21, Nano 33 IoT, etc running WiFiNINA
1.0.1 K Hoang 28/03/2020 Change to use new WiFiNINA_Generic library to support many more boards running WiFiNINA
1.0.2 K Hoang 28/03/2020 Add support to SAMD51 and SAM DUE boards
1.0.3 K Hoang 22/04/2020 Add support to nRF52 boards, such as AdaFruit Feather nRF52832, nRF52840 Express, BlueFruit Sense,
Itsy-Bitsy nRF52840 Express, Metro nRF52840 Express, NINA_B30_ublox, etc.
1.0.3 K Hoang 22/04/2020 Add support to nRF52 boards, such as AdaFruit Feather nRF52832, nRF52840 Express, BlueFruit Sense,
Itsy-Bitsy nRF52840 Express, Metro nRF52840 Express, NINA_B30_ublox, etc.
1.0.4 K Hoang 23/04/2020 Add support to MKR1000 boards using WiFi101 and custom WiFi libraries.
1.0.5 K Hoang 21/07/2020 Fix bug not closing client and releasing socket.
*****************************************************************************************************************************/
#define DEBUG_WIFI_WEBSERVER_PORT Serial

// Debug Level from 0 to 4
#define _WIFI_LOGLEVEL_ 1
#define _WIFININA_LOGLEVEL_ 1

#define USE_WIFI_NINA true

#if defined(ARDUINO_SAMD_MKR1000)
#if defined(USE_WIFI_NINA)
#undef USE_WIFI_NINA
#endif
#define USE_WIFI_NINA false
#define USE_WIFI101 true
#endif

#if ( defined(NRF52840_FEATHER) || defined(NRF52832_FEATHER) || defined(NRF52_SERIES) || defined(ARDUINO_NRF52_ADAFRUIT) )
#if defined(WIFI_USE_NRF528XX)
#undef WIFI_USE_NRF528XX
#endif
#define WIFI_USE_NRF528XX true
#endif

#if ( 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(__SAMD21E18A__) || defined(__SAMD51__) || defined(__SAMD51J20A__) || defined(__SAMD51J19A__) \
|| defined(__SAMD51G19A__) || defined(__SAMD21G18A__) )
#if defined(WIFI_USE_SAMD)
#undef WIFI_USE_SAMD
#endif
#define WIFI_USE_SAMD true
#endif

#if ( defined(ARDUINO_SAM_DUE) || defined(__SAM3X8E__) )
#if defined(WIFI_USE_SAM_DUE)
#undef WIFI_USE_SAM_DUE
#endif
#define WIFI_USE_SAM_DUE true
#warning Use SAM_DUE architecture
#endif

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

#ifdef CORE_TEENSY
#if defined(__IMXRT1062__)
// For Teensy 4.0
#define BOARD_TYPE "TEENSY 4.0"
#elif defined(__MK66FX1M0__)
#define BOARD_TYPE "Teensy 3.6"
#elif defined(__MK64FX512__)
#define BOARD_TYPE "Teensy 3.5"
#elif defined(__MKL26Z64__)
#define BOARD_TYPE "Teensy LC"
#elif defined(__MK20DX256__)
#define BOARD_TYPE "Teensy 3.2" // and Teensy 3.1 (obsolete)
#elif defined(__MK20DX128__)
#define BOARD_TYPE "Teensy 3.0"
#elif defined(__AVR_AT90USB1286__)
#error Teensy 2.0++ not supported yet
#elif defined(__AVR_ATmega32U4__)
#error Teensy 2.0 not supported yet
#else
// For Other Boards
#define BOARD_TYPE "Unknown Teensy Board"
#endif

#elif defined(WIFI_USE_NRF528XX)
#if defined(NRF52840_FEATHER)
#define BOARD_TYPE "NRF52840_FEATHER"
#elif defined(NRF52832_FEATHER)
#define BOARD_TYPE "NRF52832_FEATHER"
#else
#define BOARD_TYPE "NRF52 Unknown"
#endif

#elif defined(WIFI_USE_SAMD)
#if defined(ARDUINO_SAMD_ZERO)
#define BOARD_TYPE "SAMD Zero"
#elif defined(ARDUINO_SAMD_MKR1000)
#define BOARD_TYPE "SAMD MKR1000"
#elif defined(ARDUINO_SAMD_MKRWIFI1010)
#define BOARD_TYPE "SAMD MKRWIFI1010"
#elif defined(ARDUINO_SAMD_NANO_33_IOT)
#define BOARD_TYPE "SAMD NANO_33_IOT"
#elif defined(ARDUINO_SAMD_MKRFox1200)
#define BOARD_TYPE "SAMD MKRFox1200"
#elif ( defined(ARDUINO_SAMD_MKRWAN1300) || defined(ARDUINO_SAMD_MKRWAN1310) )
#define BOARD_TYPE "SAMD MKRWAN13X0"
#elif defined(ARDUINO_SAMD_MKRGSM1400)
#define BOARD_TYPE "SAMD MKRGSM1400"
#elif defined(ARDUINO_SAMD_MKRNB1500)
#define BOARD_TYPE "SAMD MKRNB1500"
#elif defined(ARDUINO_SAMD_MKRVIDOR4000)
#define BOARD_TYPE "SAMD MKRVIDOR4000"
#elif defined(ARDUINO_SAMD_CIRCUITPLAYGROUND_EXPRESS)
#define BOARD_TYPE "SAMD ARDUINO_SAMD_CIRCUITPLAYGROUND_EXPRESS"
#elif defined(ADAFRUIT_ITSYBITSY_M4_EXPRESS)
#define BOARD_TYPE "SAMD ADAFRUIT_ITSYBITSY_M4_EXPRESS"
#elif defined(__SAMD21E18A__)
#define BOARD_TYPE "SAMD21E18A"
#elif defined(__SAMD21G18A__)
#define BOARD_TYPE "SAMD21G18A"
#elif defined(__SAMD51G19A__)
#define BOARD_TYPE "SAMD51G19A"
#elif defined(__SAMD51J19A__)
#define BOARD_TYPE "SAMD51J19A"
#elif defined(__SAMD51J20A__)
#define BOARD_TYPE "SAMD51J20A"
#elif defined(__SAM3X8E__)
#define BOARD_TYPE "SAM3X8E"
#elif defined(__CPU_ARC__)
#define BOARD_TYPE "CPU_ARC"
#elif defined(__SAMD51__)
#define BOARD_TYPE "SAMD51"
#else
#define BOARD_TYPE "SAMD Unknown"
#endif

#elif defined(WIFI_USE_SAM_DUE)

#if defined(ARDUINO_SAM_DUE)
#define BOARD_TYPE "SAM DUE"
#elif defined(__SAM3X8E__)
#define BOARD_TYPE "SAM SAM3X8E"
#else
#define BOARD_TYPE "SAM Unknown"
#endif

#elif defined(WIFI_USE_STM32)
#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
#define BOARD_TYPE "AVR Mega"
#endif

#ifndef BOARD_NAME
#define BOARD_NAME BOARD_TYPE
#endif

#include <WiFiWebServer.h>
1.0.6 K Hoang 24/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. Restructure examples
***************************************************************************************************************************************/

// Important Note: passord length must be 8+ characters or AP creation failed
char ssid[] = "Nano"; // your network SSID (name)
char pass[] = "password"; // your network password
#include "defines.h"

int keyIndex = 0; // your network key Index number (needed only for WEP)

Expand Down
Loading

0 comments on commit 80d1d7b

Please sign in to comment.