- Notifications
You must be signed in to change notification settings - Fork22
This is simple yet complete WebServer library for AVR, Portenta_H7, Teensy, SAM DUE, SAMD, STM32, RP2040-based, etc. boards running WiFi modules/shields (WiFiNINA, CYW43439, U-Blox W101, W102, etc.). The functions are similar and compatible to ESP8266/ESP32 WebServer libraries to make life much easier to port sketches from ESP8266/ESP32. Now usi…
License
khoih-prog/WiFiWebServer
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
- Why do we need this WiFiWebServer library
- Changelog
- Prerequisites
- Installation
- Packages' Patches
- 1. For Adafruit nRF52840 and nRF52832 boards
- 2. For Teensy boards
- 3. For Arduino SAM DUE boards
- 4. For Arduino SAMD boards
- 5. For Adafruit SAMD boards
- 6. For Seeeduino SAMD boards
- 7. For STM32 boards
- 8. For RP2040-based boards using Earle Philhower arduino-pico core
- 9. For Portenta_H7 boards using Arduino IDE in Linux
- 10. For RTL8720DN boards using AmebaD core
- 11. For SAMD21 and SAMD51 boards using ArduinoCore-fab-sam core
- 12. For Seeeduino RP2040 boards
- 13. For Seeeduino nRF52840 boards
- How to configure to use different WiFi Libraries
- Usage
- Examples
- Original Examples
- 1. AdvancedWebServer
- 2. AP_SimpleWebServer
- 3. HelloServer
- 4. HelloServer2
- 5. HttpBasicAuth
- 6.MQTTClient_Auth
- 7.MQTTClient_Basic
- 8.MQTT_ThingStream
- 9. PostServer
- 10. ScanNetworks
- 11. SimpleAuthentication
- 12. UdpNTPClient
- 13. UdpSendReceive
- 14. WebClient
- 15. WebClientRepeating
- 16. WebServer
- 17. WiFiUdpNtpClient
- 18. multiFileProjectNew
- HTTP and WebSocket Client New Examples
- WiFiMulti ExamplesNew
- Original Examples
- Example AdvancedWebServer
- Debug Terminal Output Samples
- 1. AdvancedWebServer on Arduino SAMD_NANO_33_IOT using WiFiNINA_Generic Library
- 2. SimpleWebSocket on Arduino SAMD_NANO_33_IOT using WiFiNINA_Generic Library
- 3. SimpleHTTPExample on Arduino SAMD_NANO_33_IOT using WiFiNINA_Generic Library
- 4. DweetPost on Arduino SAMD_NANO_33_IOT using WiFiNINA_Generic Library
- 5. DweetGet on Arduino SAMD_NANO_33_IOT using WiFiNINA_Generic Library
- 6. MQTTClient_Auth on Arduino SAMD_NANO_33_IOT using WiFiNINA_Generic Library
- 7. MQTT_ThingStream on Arduino SAMD_NANO_33_IOT using WiFiNINA_Generic Library
- 8. WebClientRepeating on RASPBERRY_PI_PICO with Custom WiFi using Custom WiFi Library
- 9. AdvancedWebServer on Arduino Nano RP2040 Connect with WiFiNINA using WiFiNINA_Generic Library
- 10. SimpleHTTPExample on ESP32_DEV
- 11. AdvancedWebServer on PORTENTA_H7_M7 with Portenta_H7 WiFi
- 12. MQTTClient_Auth on ESP32_DEV
- 13. WebClientRepeating on ESP32_DEV
- 14. AdvancedWebServer on ESP32C3_DEV with ESP WiFi
- 15. AdvancedWebServer on ESP32S3_DEV with ESP WiFi
- 16. AdvancedWebServer_WiFiMulti on Nano RP2040 Connect with WiFiNINA
- 17. MQTTClient_Auth_WiFiMulti on Nano RP2040 Connect with WiFiNINA
- 18. WiFiUdpNTPClient_WiFiMulti on Nano RP2040 Connect with WiFiNINA
- 19. AdvancedWebServer_WiFiMulti on RASPBERRY_PI_PICO_W
- Debug
- Troubleshooting
- Issues
- TO DO
- DONE
- Contributions and Thanks
- Contributing
- License
- Copyright
Why do we need thisWiFiWebServer library
ThisWiFiWebServer library is a simple yet complete WebServer library forAVR, Portenta_H7, Teensy, SAM DUE, Arduino SAMD21, Adafruit SAMD21/SAMD51, Adafruit nRF52, ESP32/ESP8266, STM32F/L/H/G/WB/MP1, etc. boards, using WiFi modules/shields (WiFiNINA, WiFi101, U-Blox W101, W102, ESP8266/ESP32-AT, etc.).
The functions are similar and compatible to those ofESP32 WebServer andESP8266WebServer libraries to make life much easier to port sketches from ESP8266/ESP32.
ThisWiFiWebServer library, from v1.1.0, also provides high-levelHTTP and WebSocket Client with the functions are similar and compatible to those ofArduinoHttpClient Library
The library provides supports to:
- WiFi Client, STA and AP mode
- TCP Server and Client
- UDP Server and Client
- HTTP Server and Client
- HTTP GET and POST requests, provides argument parsing, handles one client at a time.
- High-level HTTP (GET, POST, PUT, PATCH, DELETE) and WebSocket Client. From v1.1.0.
It is based on and modified from:
The WiFiWebServer class found inWiFiWebServer.h header, is a simple web server that knows how to handle HTTP requests such as GET and POST and can only support one client at a time.
The newly-created WiFiMulti-related examples inWiFiMulti demonstrate how to use the newWiFiMulti_Generic library to connect to the best ofmulti-WiFi APs, withauto-checking / auto-reconnecting features when WiFi connection is lost.
ThisWiFiWebServer library currently supports these following boards:
SAM DUE
SAMD21
- Arduino: ZERO, MKR, NANO_33_IOT, etc.
- Adafruit SAMD21 (M0) : ItsyBitsy M0, Feather M0, Feather M0 Express, Metro M0 Express, Circuit Playground Express, Trinket M0, PIRkey, HalloWing M0, Crickit M0, etc.
- Seeeduino: LoRaWAN, Zero, Femto M0, XIAO M0, Wio GPS Board, etc.
- SAMD51
- Adafruit SAMD51 (M4) : Metro M4, Grand Central M4, ItsyBitsy M4, Feather M44 Express, Trellis M4, Metro M4 AirLift lite, MONSTER M4SK Express, Hallowing EM4 xpress, etc.
- Seeeduino: Wio Terminal, Grove UI Wireless
Teensy (4.1, 4.0, 3.6, 3.5, 3,2, 3.1, 3.0, LC)
All STM32F/L/H/G/WB/MP1 with more than 32KB flash memory.
AVR Mega1280, 2560, ADK, 32U4, 16U4, etc. using Arduino, Adafruit or Sparkfun core. To use patch for
ArduinoSTLlibrary.RP2040-based boards, such asNano RP2040 Connect, orRASPBERRY_PI_PICO_W with CYW43439 WiFi, usingArduino-mbed RP2040 core orEarle Philhower's arduino-pico core
RP2040-based boards, such asRASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, usingArduino-mbed RP2040 core orEarle Philhower's arduino-pico core.
ESP32
- ESP32 boards, such as
ESP32_DEV, etc. - ESP32S2-based boards, such as
ESP32S2_DEV,ESP32_S2 Saola, etc. - ESP32C3-based boards, such as
ESP32C3_DEV, etc.New - ESP32_S3 (ESP32S3_DEV, ESP32_S3_BOX, UM TINYS3, UM PROS3, UM FEATHERS3, etc.)New
ESP8266
Portenta_H7
nRF52 boards, such asAdaFruit Feather nRF52832, nRF52840 Express, BlueFruit Sense, Itsy-Bitsy nRF52840 Express, Metro nRF52840 Express, NINA_B302_ublox, NINA_B112_ublox, etc.
Arduino
megaAVRboards using Arduino core
- UNO WiFi Rev2 :
WiFi101New - Nano Every :
WiFiEspATNew
- CO2 Ampel
- SAMD :
WiFi101New
STM32 using
STM32duino Maplecore.NewSparkfun SAMD
- SAMD21, SAMD51 :
WiFiEspATNew
- Industruino SAMD
- D21G : WiFiEspATNew
- Tlera Corp STM32WB boards
- Firefly-WB55RG, Nucleo-WB55RG, etc. :
WiFiEspATNew
- Maixduino boards
- Sipeed Maixduino, etc. :
WiFiEspATNew
RTL8720DNusing RealtekAmebaDcoreNewArduino, Sparkfun, Adafruit, etc. AVR boards (Mega, 32U4, etc.). To use patch for
ArduinoSTLlibraryNew
- Arduino Uno / Mega / Duemilanove / Diecimila / LilyPad / Mini / Fio / Nano, etc.
- Arduino ATMega 16U4, 32U4 such as AVR Leonardo, Leonardo ETH, YUN, Esplora, LILYPAD_USB, AVR_ROBOT_CONTROL, AVR_ROBOT_MOTOR, AVR_INDUSTRIAL101, etc.
- Adafruit ATMega 32U4 such as AVR_FLORA8, AVR_FEATHER32U4, AVR_CIRCUITPLAY, AVR_ITSYBITSY32U4_5V, AVR_ITSYBITSY32U4_3V, AVR_BLUEFRUITMICRO, AVR_ADAFRUIT32U4, etc.
- Adafruit ATMega 328(P) such as AVR_METRO, AVR_FEATHER328P, AVR_PROTRINKET5, AVR_PROTRINKET3, AVR_PROTRINKET5FTDI, AVR_PROTRINKET3FTDI, etc.
- Generic or Sparkfun AVR ATmega_32U4 such asAVR_MAKEYMAKEY, AVR_PROMICRO, etc.
- Generic or Sparkfun AVR ATmega_328(P) such asARDUINO_REDBOT, ARDUINO_AVR_DIGITAL_SANDBOX, etc.
- Generic or Sparkfun AVR ATmega128RFA1 such asATMEGA128RFA1_DEV_BOARD, etc.
- WiFiNINA using
WiFiNINA_Generic library - WiFi101 using
WiFi101_Generic libraryNew - u-blox W101, W102 using
WiFiNINA_Generic library - ESP8266-AT command using
WiFiEspAT library - ESP8266/ESP32-AT command using
ESP_AT_Lib library - Built-in WiFi of ESP32, ESP8266
- Built-in WiFi of Portenta_H7
- Built-in CYW43439 WiFi of RASPBERRY_PI_PICO_WNew
ESP32 Core 2.0.5+for ESP32-based boards.ESP8266 Core 3.0.2+for ESP8266-based boards..
Arduino AVR core 1.8.6+for Arduino (Use Arduino Board Manager) for AVR boards.Teensy core v1.57+for Teensy (4.1, 4.0, 3.6, 3.5, 3,2, 3.1, 3.0) boards.Arduino SAM DUE core v1.6.12+for SAM DUE ARM Cortex-M3 boards.Arduino SAMD core 1.8.13+for SAMD ARM Cortex-M0+ boards.Adafruit SAMD core 1.7.11+for SAMD ARM Cortex-M0+ and M4 boards (Nano 33 IoT, etc.).Seeeduino SAMD core 1.8.3+for SAMD21/SAMD51 boards (XIAO M0, Wio Terminal, etc.).Adafruit nRF52 v1.3.0+for nRF52 boards such as Adafruit NRF52840_FEATHER, NRF52832_FEATHER, NRF52840_FEATHER_SENSE, NRF52840_ITSYBITSY, NRF52840_CIRCUITPLAY, NRF52840_CLUE, NRF52840_METRO, NRF52840_PCA10056, PARTICLE_XENON,NINA_B302_ublox, etc.Arduino Core for STM32 v2.3.0+for STM32F/L/H/G/WB/MP1 boards.Earle Philhower's arduino-pico core v2.6.3+for RP2040-based boards such asRASPBERRY_PI_PICO, RASPBERRY_PI_PICO_W, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, etc.ArduinoCore-mbed mbed_rp2040, mbed_nano, mbed_portenta core 3.4.1+for Arduino (Use Arduino Board Manager)Portenta_H7, RP2040-based boards, such as Nano_RP2040_Connect, RASPBERRY_PI_PICO.Arduino megaAVR core 1.8.7+for Arduino megaAVR boards such asUNO_WIFI_REV2, NANO_EVERYFunctional-Vlpp library v1.0.2+to use server's lambda function. To install, checkWiFiNINA_Generic library v1.8.15-1+if using WiFiNINA. To install, check.
ESP_AT_Lib library v1.4.1+if using ESP8288/ESP32-AT shields. To install, check.
WiFi101_Generic library v1.0.0+to use SAMD MKR1000, etc. boards with WiFi101 for sending larger data. To install, check.
WiFiEspAT library v1.4.1+if using ESP8288/ESP32-AT shields.WiFiMulti_Generic library v1.2.2+to use WiFiMulti function. To install, check.New
The best and easiest way is to useArduino Library Manager. Search forWiFiWebServer, then select / install the latest version.You can also use this link for more detailed instructions.
- Navigate toWiFiWebServer page.
- Download the latest release
WiFiWebServer-master.zip. - Extract the zip file to
WiFiWebServer-masterdirectory - Copy the whole
WiFiWebServer-masterfolder to Arduino libraries' directory such as~/Arduino/libraries/.
- InstallVS Code
- InstallPlatformIO
- InstallWiFiWebServer library by usingLibrary Manager. Search forWiFiWebServer inPlatform.io Author's Libraries
- Use includedplatformio.ini file from examples to ensure that all dependent libraries will installed automatically. Please visit documentation for the other options and examples atProject Configuration File
To be able to compile, run and automatically detect and display BOARD_NAME on nRF52840/nRF52832 boards, you have to copy the wholenRF52 Packages_Patches directory into Adafruit nRF52 directory (~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0).
Supposing the Adafruit nRF52 version is 1.3.0. These files must be copied into the directory:
~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/platform.txt~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/boards.txt~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/cores/nRF5/Udp.h~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/cores/nRF5/Print.h~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/cores/nRF5/Print.cpp~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/variants/NINA_B302_ublox/variant.h~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/variants/NINA_B302_ublox/variant.cpp~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/variants/NINA_B112_ublox/variant.h~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/variants/NINA_B112_ublox/variant.cpp~/.arduino15/packages/adafruit/hardware/nrf52/1.3.0/cores/nRF5/Udp.h
Whenever a new version is installed, remember to copy these files into the new version directory. For example, new version is x.yy.zThese files must be copied into the directory:
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/platform.txt~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/boards.txt~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/cores/nRF5/Udp.h~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/cores/nRF5/Print.h~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/cores/nRF5/Print.cpp~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/variants/NINA_B302_ublox/variant.h~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/variants/NINA_B302_ublox/variant.cpp~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/variants/NINA_B112_ublox/variant.h~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/variants/NINA_B112_ublox/variant.cpp~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/cores/nRF5/Udp.h
To be able to compile and run on Teensy boards, you have to copy the files inPackages_Patches for Teensy directory into Teensy hardware directory (./arduino-1.8.19/hardware/teensy/avr/boards.txt).
Supposing the Arduino version is 1.8.19. These files must be copied into the directory:
./arduino-1.8.19/hardware/teensy/avr/boards.txt./arduino-1.8.19/hardware/teensy/avr/cores/teensy/Stream.h./arduino-1.8.19/hardware/teensy/avr/cores/teensy3/Stream.h./arduino-1.8.19/hardware/teensy/avr/cores/teensy4/Stream.h
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zzThese files must be copied into the directory:
./arduino-x.yy.zz/hardware/teensy/avr/boards.txt./arduino-x.yy.zz/hardware/teensy/avr/cores/teensy/Stream.h./arduino-x.yy.zz/hardware/teensy/avr/cores/teensy3/Stream.h./arduino-x.yy.zz/hardware/teensy/avr/cores/teensy4/Stream.h
To be able to compile and run on SAM DUE boards, you have to copy the wholeSAM DUE directory into Arduino sam directory (~/.arduino15/packages/arduino/hardware/sam/1.6.12).
Supposing the Arduino SAM core version is 1.6.12. This file must be copied into the directory:
~/.arduino15/packages/arduino/hardware/sam/1.6.12/platform.txt
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zzThis file must be copied into the directory:
~/.arduino15/packages/arduino/hardware/sam/x.yy.zz/platform.txt
To be able to compile, run and automatically detect and display BOARD_NAME on Arduino SAMD (Nano-33-IoT, etc) boards, you have to copy the wholeArduino SAMD Packages_Patches directory into Arduino SAMD directory (~/.arduino15/packages/arduino/hardware/samd/1.8.13).
Supposing the Arduino SAMD version is 1.8.13. Now only one file must be copied into the directory:
~/.arduino15/packages/arduino/hardware/samd/1.8.13/platform.txt
Whenever a new version is installed, remember to copy this files into the new version directory. For example, new version is x.yy.zz
This file must be copied into the directory:
~/.arduino15/packages/arduino/hardware/samd/x.yy.zz/platform.txt
Supposing the Arduino SAMD version is 1.8.9. These files must be copied into the directory:
~/.arduino15/packages/arduino/hardware/samd/1.8.9/platform.txt~/.arduino15/packages/arduino/hardware/samd/1.8.9/cores/arduino/Arduino.h
Whenever a new version is installed, remember to copy these files into the new version directory. For example, new version is x.yy.z
These files must be copied into the directory:
~/.arduino15/packages/arduino/hardware/samd/x.yy.z/platform.txt~/.arduino15/packages/arduino/hardware/samd/x.yy.z/cores/arduino/Arduino.h
This is mandatory to fix thenotorious Arduino SAMD compiler error. SeeImprove Arduino compatibility with the STL (min and max macro)
...\arm-none-eabi\include\c++\7.2.1\bits\stl_algobase.h:243:56: error: macro "min" passed 3 arguments, but takes just 2 min(const _Tp& __a, const _Tp& __b, _Compare __comp)Whenever the above-mentioned compiler error issue is fixed with the new Arduino SAMD release, you don't need to copy theArduino.h file anymore.
To be able to compile, run and automatically detect and display BOARD_NAME on Adafruit SAMD (Itsy-Bitsy M4, etc) boards, you have to copy the wholeAdafruit SAMD Packages_Patches directory into Adafruit samd directory (~/.arduino15/packages/adafruit/hardware/samd/1.7.11).
Supposing the Adafruit SAMD core version is 1.7.11. These files must be copied into the directory:
~/.arduino15/packages/adafruit/hardware/samd/1.7.11/platform.txt~/.arduino15/packages/adafruit/hardware/samd/1.7.11/cores/arduino/Print.h~/.arduino15/packages/adafruit/hardware/samd/1.7.11/cores/arduino/Print.cpp
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zzThese files must be copied into the directory:
~/.arduino15/packages/adafruit/hardware/samd/x.yy.zz/platform.txt~/.arduino15/packages/adafruit/hardware/samd/x.yy.zz/cores/arduino/Print.h~/.arduino15/packages/adafruit/hardware/samd/x.yy.zz/cores/arduino/Print.cpp
To be able to compile, run and automatically detect and display BOARD_NAME on Seeeduino SAMD (XIAO M0, Wio Terminal, etc) boards, you have to copy the wholeSeeeduino SAMD Packages_Patches directory into Seeeduino samd directory (~/.arduino15/packages/Seeeduino/hardware/samd/1.8.3).
Supposing the Seeeduino SAMD core version is 1.8.3. These files must be copied into the directory:
~/.arduino15/packages/Seeeduino/hardware/samd/1.8.3/platform.txt~/.arduino15/packages/Seeeduino/hardware/samd/1.8.3/cores/arduino/Arduino.h~/.arduino15/packages/Seeeduino/hardware/samd/1.8.3/cores/arduino/Print.h~/.arduino15/packages/Seeeduino/hardware/samd/1.8.3/cores/arduino/Print.cpp
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zzThese files must be copied into the directory:
~/.arduino15/packages/Seeeduino/hardware/samd/x.yy.zz/platform.txt~/.arduino15/packages/Seeeduino/hardware/samd/x.yy.zz/cores/arduino/Arduino.h~/.arduino15/packages/Seeeduino/hardware/samd/x.yy.zz/cores/arduino/Print.h~/.arduino15/packages/Seeeduino/hardware/samd/x.yy.zz/cores/arduino/Print.cpp
ForGeneric STM32F4 series boards, such asSTM32F407VE, usingLAN8720, please use STM32 corev2.2.0 as breaking corev2.3.0 creates the compile error.
To use LAN8720 on some STM32 boards
- Nucleo-144 (F429ZI, NUCLEO_F746NG, NUCLEO_F746ZG, NUCLEO_F756ZG)
- Discovery (DISCO_F746NG)
- STM32F4 boards (BLACK_F407VE, BLACK_F407VG, BLACK_F407ZE, BLACK_F407ZG, BLACK_F407VE_Mini, DIYMORE_F407VGT, FK407M1)
you have to copy the filesstm32f4xx_hal_conf_default.h andstm32f7xx_hal_conf_default.h into STM32 stm32 directory (~/.arduino15/packages/STM32/hardware/stm32/2.2.0/system) to overwrite the old files.
Supposing the STM32 stm32 core version is 2.2.0. These files must be copied into the directory:
~/.arduino15/packages/STM32/hardware/stm32/2.2.0/system/STM32F4xx/stm32f4xx_hal_conf_default.hfor STM32F4.~/.arduino15/packages/STM32/hardware/stm32/2.2.0/system/STM32F7xx/stm32f7xx_hal_conf_default.hfor Nucleo-144 STM32F7.
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz,these files must be copied into the corresponding directory:
~/.arduino15/packages/STM32/hardware/stm32/x.yy.zz/system/STM32F4xx/stm32f4xx_hal_conf_default.h~/.arduino15/packages/STM32/hardware/stm32/x.yy.zz/system/STM32F7xx/stm32f7xx_hal_conf_default.h
To use Serial1 on some STM32 boards without Serial1 definition (Nucleo-144 NUCLEO_F767ZI, Nucleo-64 NUCLEO_L053R8, etc.) boards, you have to copy the filesSTM32 variant.h into STM32 stm32 directory (~/.arduino15/packages/STM32/hardware/stm32/2.3.0). You have to modify the files corresponding to your boards, this is just an illustration how to do.
Supposing the STM32 stm32 core version is 2.3.0. These files must be copied into the directory:
~/.arduino15/packages/STM32/hardware/stm32/2.3.0/variants/STM32F7xx/F765Z(G-I)T_F767Z(G-I)T_F777ZIT/NUCLEO_F767ZI/variant.hfor Nucleo-144 NUCLEO_F767ZI.~/.arduino15/packages/STM32/hardware/stm32/2.3.0/variants/STM32L0xx/L052R(6-8)T_L053R(6-8)T_L063R8T/NUCLEO_L053R8/variant.hfor Nucleo-64 NUCLEO_L053R8.
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz,these files must be copied into the corresponding directory:
~/.arduino15/packages/STM32/hardware/stm32/x.yy.zz/variants/STM32F7xx/F765Z(G-I)T_F767Z(G-I)T_F777ZIT/NUCLEO_F767ZI/variant.h~/.arduino15/packages/STM32/hardware/stm32/x.yy.zz/variants/STM32L0xx/L052R(6-8)T_L053R(6-8)T_L063R8T/NUCLEO_L053R8/variant.h
8. For RP2040-based boards usingEarle Philhower arduino-pico core
To be able to automatically detect and display BOARD_NAME on RP2040-based boards (RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040, GENERIC_RP2040, etc) boards, you have to copy the fileRP2040 platform.txt into rp2040 directory (~/.arduino15/packages/rp2040/hardware/rp2040/1.4.0).
Supposing the rp2040 core version is 1.4.0. This file must be copied into the directory:
~/.arduino15/packages/rp2040/hardware/rp2040/1.4.0/platform.txt
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zzThis file must be copied into the directory:
~/.arduino15/packages/rp2040/hardware/rp2040/x.yy.zz/platform.txt
With core after v1.5.0, this step is not necessary anymore thanks to the PRAdd -DBOARD_NAME="{build.board}" #136.
Some libraries, such asAdafruit DHT-sensor-library, require the definition of microsecondsToClockCycles().To be able to compile and run on RP2040-based boards, you have to copy the files inRP2040 Arduino.h into rp2040 directory (~/.arduino15/packages/rp2040/hardware/rp2040/1.4.0).
Supposing the rp2040 core version is 1.4.0. This file must be copied to replace:
~/.arduino15/packages/rp2040/hardware/rp2040/1.4.0/cores/rp2040/Arduino.h
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zzThis file must be copied to replace:
~/.arduino15/packages/rp2040/hardware/rp2040/x.yy.zz/cores/rp2040/Arduino.h
With core after v1.5.0, this step is not necessary anymore thanks to the PRAdd defs for compatibility #142.
To be able to upload firmware to Portenta_H7 using Arduino IDE in Linux (Ubuntu, etc.), you have to copy the fileportenta_post_install.sh into mbed_portenta directory (~/.arduino15/packages/arduino/hardware/mbed_portenta/3.4.1/portenta_post_install.sh).
Then run the following command usingsudo
$ cd ~/.arduino15/packages/arduino/hardware/mbed_portenta/3.4.1$ chmod 755 portenta_post_install.sh$ sudo ./portenta_post_install.shThis will create the file/etc/udev/rules.d/49-portenta_h7.rules as follows:
# Portenta H7 bootloader mode UDEV rulesSUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="035b", GROUP="plugdev", MODE="0666"Supposing the ArduinoCore-mbed core version is 3.4.1. Now only one file must be copied into the directory:
~/.arduino15/packages/arduino/hardware/mbed_portenta/3.4.1/portenta_post_install.sh
Whenever a new version is installed, remember to copy this files into the new version directory. For example, new version is x.yy.zz
This file must be copied into the directory:
~/.arduino15/packages/arduino/hardware/mbed_portenta/x.yy.zz/portenta_post_install.sh
To avoid compile error relating to PROGMEM, you have to copy the fileRealtek AmebaD core pgmspace.h into Realtek AmebaD directory (~/.arduino15/packages/realtek/hardware/AmebaD/3.1.4/cores/ambd/avr/pgmspace.h).
Supposing the Realtek AmebaD core version is 3.1.4. This file must be copied into the directory:
~/.arduino15/packages/realtek/hardware/AmebaD/3.1.4/cores/ambd/avr/pgmspace.h
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zzThis file must be copied into the directory:
~/.arduino15/packages/realtek/hardware/AmebaD/x.yy.zz/cores/ambd/avr/pgmspace.h
To avoid compile error relating to SAMD21/SAMD51, you have to copy the fileArduinoCore-fab-sam core pgmspace.h intoArduinoCore-fab-sam samd directory (~/.arduino15/packages/Fab_SAM_Arduino/hardware/samd/1.9.0/boards.txt).
Supposing theArduinoCore-fab-sam samd core version is 1.9.0. This file must be copied into the directory:
~/.arduino15/packages/Fab_SAM_Arduino/hardware/samd/1.9.0/boards.txt
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zzThis file must be copied into the directory:
~/.arduino15/packages/Fab_SAM_Arduino/hardware/samd/x.yy.zz/boards.txt
To be able to compile, run and automatically detect and display BOARD_NAME on Seeeduino RP2040 (XIAO RP2040, Wio RP2040 Mini) boards, you have to copy the wholeSeeeduino RP2040 Packages_Patches directory into Seeeduino samd directory (~/.arduino15/packages/Seeeduino/hardware/rp2040/2.7.2).
Supposing the Seeeduino RP2040 core version is 2.7.2. These files must be copied into the directory:
~/.arduino15/packages/Seeeduino/hardware/rp2040/2.7.2/boards.txt~/.arduino15/packages/Seeeduino/hardware/rp2040/2.7.2/variants/Seeed_XIAO_RP2040/pins_arduino.h
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zzThese files must be copied into the directory:
~/.arduino15/packages/Seeeduino/hardware/samd/x.yy.zz/boards.txt~/.arduino15/packages/Seeeduino/hardware/samd/x.yy.zz/variants/Seeed_XIAO_RP2040/pins_arduino.h
To be able to compile and run on Xiao nRF52840 boards, you have to copy the wholenRF52 1.0.0 directory into Seeeduino nRF52 directory (~/.arduino15/packages/Seeeduino/hardware/nrf52/1.0.0).
Supposing the Seeeduino nRF52 version is 1.0.0. These files must be copied into the directory:
~/.arduino15/packages/Seeeduino/hardware/nrf52/1.0.0/platform.txt~/.arduino15/packages/Seeeduino/hardware/nrf52/1.0.0/cores/nRF5/Print.h~/.arduino15/packages/Seeeduino/hardware/nrf52/1.0.0/cores/nRF5/Print.cpp~/.arduino15/packages/Seeeduino/hardware/nrf52/1.0.0/cores/nRF5/Udp.h
Whenever a new version is installed, remember to copy these files into the new version directory. For example, new version is x.yy.zThese files must be copied into the directory:
~/.arduino15/packages/Seeeduino/hardware/nrf52/x.yy.z/platform.txt~/.arduino15/packages/Seeeduino/hardware/nrf52/x.yy.z/cores/nRF5/Print.h~/.arduino15/packages/Seeeduino/hardware/nrf52/x.yy.z/cores/nRF5/Print.cpp~/.arduino15/packages/Seeeduino/hardware/nrf52/x.yy.z/cores/nRF5/Udp.h
Please change the pin-to-pin connection in~/Arduino/libraries/src/WiFiNINA_Pinout_Generic.h to match actual connection if using WiFiNINA withWiFiNINA_Generic library.
For example
#elif ( defined(NRF52840_FEATHER) || defined(NRF52832_FEATHER) || defined(NRF52_SERIES) || defined(ARDUINO_NRF52_ADAFRUIT) || \defined(NRF52840_FEATHER_SENSE) || defined(NRF52840_ITSYBITSY) || defined(NRF52840_CIRCUITPLAY) || defined(NRF52840_CLUE) || \ defined(NRF52840_METRO) || defined(NRF52840_PCA10056) || defined(PARTICLE_XENON) || defined(NINA_B302_ublox) || defined(NINA_B112_ublox) ) #warning You have to modify pin usage according to actual connectionfor NRF528XX// To define pin out for WiFiNINA here//#define PINS_COUNT (60u)//NINA #defineNINA_GPIO0 (26u)//26 #defineNINA_RESETN (27u) #defineNINA_ACK (28u) #defineSPIWIFI_SS24//PIN_SPI1_SS //24 #defineSPIWIFI_ACK28//NINA_ACK //28 #defineSPIWIFI_RESET27//NINA_RESETN //27
- To use W102-based WiFiNINA, define in the sketch:
#defineUSE_WIFI_NINAtrue
- To use built-in WiFi101 or shield:
#defineUSE_WIFI_NINAfalse#defineUSE_WIFI101true
- To use MKR1000 with built-in WiFi101:
// Don't care false or true#defineUSE_WIFI_NINAfalse
- For boards other than MKR1000, to use another WiFi library with the standardWiFi.h, such as
WiFiEspAT librarylibrary
#defineUSE_WIFI_NINAfalse
- To use another WiFi library without the standardWiFi.h
For example, WiFi_XYZ library usesWiFi_XYZ.h
#defineUSE_WIFI_NINAfalse#defineUSE_WIFI_CUSTOMtrue...//Must be placed before #include <WiFiWebServer.h>#include<WiFi_XYZ.h>#include<WiFiWebServer.h>
- TheWiFiEsp, WiFi_Link libraries are not supported. Don't use unless you know how to modify those libraries.
- Requests to support for any custom WiFi library will be ignored.Use at your own risk.
WiFiWebServerserver(80);
Creates the WiFiWebServer class object.
Parameters:
host port number:int port (default is the standard HTTP port 80)
Starting the server
voidbegin();
Handling incoming client requests
voidhandleClient();
Disabling the server
voidclose();voidstop();
Both methods function the same
Client request handlers
voidon();voidaddHandler();voidonNotFound();voidonFileUpload();
Example:
server.on("/", handlerFunction); server.onNotFound(handlerFunction);// called when handler is not assigned server.onFileUpload(handlerFunction);// handle file uploads
Sending responses to the client
voidsend();voidsend_P();
Parameters:
code - HTTP response code, can be200 or404, etc.
content_type - HTTP content type, like"text/plain" or"image/png", etc.
content - actual content body
Getting information about request arguments
const String &arg();const String &argName();intargs();boolhasArg();
Function usage:
arg - get request argument value, usearg("plain") to get POST body
argName - get request argument name
args - get arguments count
hasArg - check if argument exist
Getting information about request headers
const String &header();const String &headerName();const String &hostHeader();intheaders();boolhasHeader();
Function usage:
header - get request header value
headerName - get request header name
hostHeader - get request host header if available, else empty string
headers - get header count
hasHeader - check if header exist
Authentication
boolauthenticate();voidrequestAuthentication();
Function usage:
authenticate - server authentication, returns true if client is authenticated else false
requestAuthentication - sends authentication failure response to the client
Example Usage:
if(!server.authenticate(username, password)) { server.requestAuthentication(); }
const String&uri();// get the current uri HTTPMethodmethod();// get the current method WiFiClientclient();// get the current client HTTPUpload&upload();// get the current uploadvoidsetContentLength();// set content lengthvoidsendHeader();// send HTTP headervoidsendContent();// send contentvoidsendContent_P();voidcollectHeaders();// set the request headers to collectvoidserveStatic();size_tstreamFile();
- AdvancedWebServer
- AP_SimpleWebServer
- HelloServer
- HelloServer2
- HttpBasicAuth
- MQTTClient_Auth
- MQTTClient_Basic
- MQTT_ThingStream
- PostServer
- ScanNetworks
- SimpleAuthentication
- UdpNTPClient
- UdpSendReceive
- WebClient
- WebClientRepeating
- WebServer
- WiFiUdpNtpClient
- multiFileProjectNew
- BasicAuthGet
- CustomHeader
- DweetGet
- DweetPost
- HueBlink
- node_test_server
- PostWithHeaders
- SimpleDelete
- SimpleGet
- SimpleHTTPExample
- SimplePost
- SimplePut
- SimpleWebSocket
- AdvancedWebServer_WiFiMulti
- MQTTClient_Auth_WiFiMulti
- MQTTClient_Basic_WiFiMulti
- MQTT_ThingStream_WiFiMulti
- WiFiUdpNtpClient_WiFiMulti
- WebClient_WiFiMulti
- WebClientRepeating_WiFiMulti
- WebServer_WiFiMulti
ExampleAdvancedWebServer
1. FileAdvancedWebServer.ino
WiFiWebServer/examples/AdvancedWebServer/AdvancedWebServer.ino
Lines 40 to 327 in9094e54
| #include"defines.h" | |
| int status = WL_IDLE_STATUS;// the Wifi radio's status | |
| int reqCount =0;// number of requests received | |
| WiFiWebServerserver(80); | |
| #if defined(LED_BUILTIN) | |
| constint led = LED_BUILTIN; | |
| #else | |
| #if (ESP32) | |
| // Using pin 13 will crash ESP32_C3 | |
| constint led =2; | |
| #else | |
| constint led =13; | |
| #endif | |
| #endif | |
| voidhandleRoot() | |
| { | |
| #defineBUFFER_SIZE512 | |
| digitalWrite(led,1); | |
| char temp[BUFFER_SIZE]; | |
| int sec =millis() /1000; | |
| int min = sec /60; | |
| int hr = min /60; | |
| int day = hr /24; | |
| hr = hr %24; | |
| snprintf(temp, BUFFER_SIZE -1, | |
| "<html>\ | |
| <head>\ | |
| <meta http-equiv='refresh' content='5'/>\ | |
| <title>%s</title>\ | |
| <style>\ | |
| body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }\ | |
| </style>\ | |
| </head>\ | |
| <body>\ | |
| <h1>Hello from %s</h1>\ | |
| <h3>running WiFiWebServer</h3>\ | |
| <h3>on %s</h3>\ | |
| <p>Uptime: %d d %02d:%02d:%02d</p>\ | |
| <img src=\"/test.svg\" />\ | |
| </body>\ | |
| </html>", BOARD_NAME, BOARD_NAME, SHIELD_TYPE, day, hr, min %60, sec %60); | |
| server.send(200,F("text/html"), temp); | |
| digitalWrite(led,0); | |
| } | |
| voidhandleNotFound() | |
| { | |
| digitalWrite(led,1); | |
| String message =F("File Not Found\n\n"); | |
| message +=F("URI:"); | |
| message += server.uri(); | |
| message +=F("\nMethod:"); | |
| message += (server.method() == HTTP_GET) ?F("GET") :F("POST"); | |
| message +=F("\nArguments:"); | |
| message += server.args(); | |
| message +=F("\n"); | |
| for (uint8_t i =0; i < server.args(); i++) | |
| { | |
| message +="" + server.argName(i) +":" + server.arg(i) +"\n"; | |
| } | |
| server.send(404,F("text/plain"), message); | |
| digitalWrite(led,0); | |
| } | |
| #defineORIGINAL_STR_LEN (2048 * MULTIPLY_FACTOR) | |
| //String out; | |
| voiddrawGraph() | |
| { | |
| static String out; | |
| staticuint16_t previousStrLen = ORIGINAL_STR_LEN; | |
| if (out.length() ==0) | |
| { | |
| WS_LOGWARN1(F("String Len = 0, extend to"), ORIGINAL_STR_LEN); | |
| out.reserve(ORIGINAL_STR_LEN); | |
| } | |
| #if (MULTIPLY_FACTOR == 1) | |
| out =F("<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"310\" height=\"150\">\n" \ | |
| "<rect width=\"310\" height=\"150\" fill=\"rgb(250, 230, 210)\" stroke-width=\"3\" stroke=\"rgb(0, 0, 0)\" />\n" \ | |
| "<g stroke=\"blue\">\n"); | |
| #elif (MULTIPLY_FACTOR == 2) | |
| out =F("<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"610\" height=\"150\">\n" \ | |
| "<rect width=\"610\" height=\"150\" fill=\"rgb(250, 230, 210)\" stroke-width=\"3\" stroke=\"rgb(0, 0, 0)\" />\n" \ | |
| "<g stroke=\"blue\">\n"); | |
| #elif (MULTIPLY_FACTOR == 4) | |
| out =F("<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"1210\" height=\"150\">\n" \ | |
| "<rect width=\"1210\" height=\"150\" fill=\"rgb(250, 230, 210)\" stroke-width=\"3\" stroke=\"rgb(0, 0, 0)\" />\n" \ | |
| "<g stroke=\"blue\">\n"); | |
| #endif | |
| char temp[70]; | |
| int y =rand() %130; | |
| for (int x =10; x < (300 * MULTIPLY_FACTOR); x +=10) | |
| { | |
| int y2 =rand() %130; | |
| sprintf(temp,"<line x1=\"%d\" y1=\"%d\" x2=\"%d\" y2=\"%d\" stroke-width=\"2\" />\n", x,140 - y, x +10,140 - y2); | |
| out += temp; | |
| y = y2; | |
| } | |
| out +=F("</g>\n</svg>\n"); | |
| WS_LOGDEBUG1(F("String Len ="), out.length()); | |
| if (out.length() > previousStrLen) | |
| { | |
| WS_LOGERROR3(F("String Len >"), previousStrLen,F(", extend to"), out.length() +48); | |
| previousStrLen = out.length() +48; | |
| out.reserve(previousStrLen); | |
| } | |
| else | |
| { | |
| server.send(200,"image/svg+xml", out); | |
| } | |
| } | |
| voidsetup() | |
| { | |
| //out.reserve(ORIGINAL_STR_LEN); | |
| pinMode(led, OUTPUT); | |
| digitalWrite(led,0); | |
| Serial.begin(115200); | |
| while (!Serial &&millis() <5000); | |
| delay(200); | |
| Serial.print(F("\nStarting AdvancedWebServer on")); | |
| Serial.print(BOARD_NAME); | |
| Serial.print(F(" with")); | |
| Serial.println(SHIELD_TYPE); | |
| Serial.println(WIFI_WEBSERVER_VERSION); | |
| #if WIFI_USING_ESP_AT | |
| // initialize serial for ESP module | |
| EspSerial.begin(115200); | |
| // initialize ESP module | |
| WiFi.init(&EspSerial); | |
| Serial.println(F("WiFi shield init done")); | |
| #endif | |
| #if ! (ESP32 || ESP8266) | |
| // check for the presence of the shield | |
| #if USE_WIFI_NINA | |
| if (WiFi.status() == WL_NO_MODULE) | |
| #else | |
| if (WiFi.status() == WL_NO_SHIELD) | |
| #endif | |
| { | |
| Serial.println(F("WiFi shield not present")); | |
| // don't continue | |
| while (true); | |
| } | |
| #endif | |
| #if USE_WIFI_NINA | |
| String fv = WiFi.firmwareVersion(); | |
| if (fv < WIFI_FIRMWARE_LATEST_VERSION) | |
| { | |
| Serial.println(F("Please upgrade the firmware")); | |
| } | |
| #endif | |
| #if (ESP32 || ESP8266) | |
| WiFi.mode(WIFI_STA); | |
| Serial.print(F("Connecting to WPA SSID:")); | |
| Serial.println(ssid); | |
| if (WiFi.status() != WL_CONNECTED) | |
| { | |
| if (strlen(pass) >=8) | |
| { | |
| WiFi.begin(ssid, pass); | |
| } | |
| else | |
| { | |
| WiFi.begin(ssid); | |
| } | |
| } | |
| while (WiFi.status() != WL_CONNECTED) | |
| { | |
| delay(500); | |
| } | |
| #else | |
| // attempt to connect to WiFi network | |
| while ( status != WL_CONNECTED) | |
| { | |
| //delay(500); | |
| Serial.print(F("Connecting to WPA SSID:")); | |
| Serial.println(ssid); | |
| // Connect to WPA/WPA2 network | |
| status = WiFi.begin(ssid, pass); | |
| } | |
| #endif | |
| server.on(F("/"), handleRoot); | |
| server.on(F("/test.svg"), drawGraph); | |
| server.on(F("/inline"), []() | |
| { | |
| server.send(200,F("text/plain"),F("This works as well")); | |
| }); | |
| server.onNotFound(handleNotFound); | |
| server.begin(); | |
| Serial.print(F("HTTP server started @")); | |
| Serial.println(WiFi.localIP()); | |
| } | |
| voidheartBeatPrint() | |
| { | |
| staticint num =1; | |
| Serial.print(F("H")); | |
| if (num ==80) | |
| { | |
| Serial.println(); | |
| num =1; | |
| } | |
| elseif (num++ %10 ==0) | |
| { | |
| Serial.print(F("")); | |
| } | |
| } | |
| voidcheck_status() | |
| { | |
| staticunsignedlong checkstatus_timeout =0; | |
| #defineSTATUS_CHECK_INTERVAL60000L | |
| // Send status report every STATUS_REPORT_INTERVAL (60) seconds: we don't need to send updates frequently if there is no status change. | |
| if ((millis() > checkstatus_timeout) || (checkstatus_timeout ==0)) | |
| { | |
| heartBeatPrint(); | |
| checkstatus_timeout =millis() + STATUS_CHECK_INTERVAL; | |
| } | |
| } | |
| voidloop() | |
| { | |
| server.handleClient(); | |
| check_status(); | |
| } |
2. Filedefines.h
WiFiWebServer/examples/AdvancedWebServer/defines.h
Lines 12 to 409 in9094e54
| #ifndefdefines_h | |
| #definedefines_h | |
| #defineDEBUG_WIFI_WEBSERVER_PORT Serial | |
| // Debug Level from 0 to 4 | |
| #define_WIFI_LOGLEVEL_ 1 | |
| #define_WIFININA_LOGLEVEL_ 1 | |
| #if ( defined(ARDUINO_PORTENTA_H7_M7)|| defined(ARDUINO_PORTENTA_H7_M4) ) | |
| #defineMULTIPLY_FACTOR 4 | |
| #if defined(BOARD_NAME) | |
| #undef BOARD_NAME | |
| #endif | |
| #if defined(CORE_CM7) | |
| #warning Using Portenta H7 M7 core | |
| #defineBOARD_NAME "PORTENTA_H7_M7" | |
| #else | |
| #warning Using Portenta H7 M4 core | |
| #defineBOARD_NAME "PORTENTA_H7_M4" | |
| #endif | |
| #defineUSE_WIFI_PORTENTA_H7 true | |
| #defineUSE_WIFI_NINA false | |
| // To use the default WiFi library here | |
| #defineUSE_WIFI_CUSTOM false | |
| #elif (ESP32) | |
| #defineUSE_WIFI_NINA false | |
| // To use the default WiFi library here | |
| #defineUSE_WIFI_CUSTOM false | |
| #elif (ESP8266) | |
| #defineUSE_WIFI_NINA false | |
| // To use the default WiFi library here | |
| #defineUSE_WIFI_CUSTOM true | |
| #elif ( defined(ARDUINO_SAMD_MKR1000)|| defined(ARDUINO_SAMD_MKRWIFI1010) ) | |
| #defineMULTIPLY_FACTOR 2 | |
| #defineUSE_WIFI_NINA false | |
| #defineUSE_WIFI101 true | |
| #defineUSE_WIFI_CUSTOM false | |
| #elif ( defined(ARDUINO_NANO_RP2040_CONNECT)|| defined(ARDUINO_SAMD_NANO_33_IOT) ) | |
| #defineMULTIPLY_FACTOR 4 //2 | |
| #defineUSE_WIFI_NINA true | |
| #defineUSE_WIFI101 false | |
| #defineUSE_WIFI_CUSTOM false | |
| #elif defined(ARDUINO_RASPBERRY_PI_PICO_W) | |
| #defineMULTIPLY_FACTOR 4 | |
| #defineUSE_WIFI_NINA false | |
| #defineUSE_WIFI101 false | |
| #defineUSE_WIFI_CUSTOM false | |
| #elif ( defined(__AVR_ATmega4809__)|| defined(ARDUINO_AVR_UNO_WIFI_REV2)|| defined(ARDUINO_AVR_NANO_EVERY)|| \ | |
| defined(ARDUINO_AVR_ATmega4809)|| defined(ARDUINO_AVR_ATmega4808)|| defined(ARDUINO_AVR_ATmega3209)|| \ | |
| defined(ARDUINO_AVR_ATmega3208)|| defined(ARDUINO_AVR_ATmega1609)|| defined(ARDUINO_AVR_ATmega1608)|| \ | |
| defined(ARDUINO_AVR_ATmega809)|| defined(ARDUINO_AVR_ATmega808) ) | |
| #error Not supported. Lack of memory for megaAVR | |
| #else | |
| #defineUSE_WIFI_NINA false | |
| #defineUSE_WIFI101 false | |
| // If not USE_WIFI_NINA, you can USE_WIFI_CUSTOM, then include the custom WiFi library here | |
| #defineUSE_WIFI_CUSTOM true | |
| #endif | |
| #if (!USE_WIFI_NINA&&USE_WIFI_CUSTOM) | |
| #if (ESP8266) | |
| #include"ESP8266WiFi.h" | |
| #else | |
| //#include "WiFi_XYZ.h" | |
| #include"WiFiEspAT.h" | |
| #defineWIFI_USING_ESP_AT true | |
| #endif | |
| #endif | |
| #ifWIFI_USING_ESP_AT | |
| #defineEspSerial Serial1 | |
| #error WIFI_USING_ESP_AT is not supported for AdvancedWebServer | |
| #endif | |
| #ifUSE_WIFI_PORTENTA_H7 | |
| #warning Using Portenta H7 WiFi | |
| #defineSHIELD_TYPE "Portenta_H7 WiFi" | |
| #elifUSE_WIFI_NINA | |
| #warning Using WiFiNINA using WiFiNINA_Generic Library | |
| #defineSHIELD_TYPE "WiFiNINA using WiFiNINA_Generic Library" | |
| #elifUSE_WIFI101 | |
| #warning Using WiFi101 using WiFi101 Library | |
| #defineSHIELD_TYPE "WiFi101 using WiFi101 Library" | |
| #elif (ESP32||ESP8266) | |
| #warning Using ESP WiFi with WiFi Library | |
| #defineSHIELD_TYPE "ESP WiFi using WiFi Library" | |
| #elif defined(ARDUINO_RASPBERRY_PI_PICO_W) | |
| #warning Using RP2040W CYW43439 WiFi | |
| #defineSHIELD_TYPE "RP2040W CYW43439 WiFi" | |
| #elifUSE_WIFI_CUSTOM | |
| #warning Using Custom WiFi using Custom WiFi Library | |
| #defineSHIELD_TYPE "Custom WiFi using Custom WiFi Library" | |
| #else | |
| #defineSHIELD_TYPE "Unknown WiFi shield/Library" | |
| #endif | |
| #if ( defined(NRF52840_FEATHER)|| defined(NRF52832_FEATHER)|| defined(NRF52_SERIES)|| defined(ARDUINO_NRF52_ADAFRUIT)|| \ | |
| defined(NRF52840_FEATHER_SENSE)|| defined(NRF52840_ITSYBITSY)|| defined(NRF52840_CIRCUITPLAY)|| defined(NRF52840_CLUE)|| \ | |
| defined(NRF52840_METRO)|| defined(NRF52840_PCA10056)|| defined(PARTICLE_XENON)|| defined(NINA_B302_ublox)|| defined(NINA_B112_ublox) ) | |
| #if defined(WIFI_USE_NRF528XX) | |
| #undef WIFI_USE_NRF528XX | |
| #endif | |
| #defineWIFI_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(__SAMD51P19A__)|| defined(__SAMD21G18A__) ) | |
| #if defined(WIFI_USE_SAMD) | |
| #undef WIFI_USE_SAMD | |
| #endif | |
| #defineWIFI_USE_SAMD true | |
| #endif | |
| #if ( defined(ARDUINO_SAM_DUE)|| defined(__SAM3X8E__) ) | |
| #if defined(WIFI_USE_SAM_DUE) | |
| #undef WIFI_USE_SAM_DUE | |
| #endif | |
| #defineWIFI_USE_SAM_DUE true | |
| #warning Use SAM_DUE architecture | |
| #endif | |
| #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(ARDUINO_PORTENTA_H7_M7)|| defined(ARDUINO_PORTENTA_H7_M4) ) | |
| #if defined(WIFI_USE_STM32) | |
| #undef WIFI_USE_STM32 | |
| #endif | |
| #defineWIFI_USE_STM32 true | |
| #endif | |
| #ifdefCORE_TEENSY | |
| #if defined(__IMXRT1062__) | |
| // For Teensy 4.1/4.0 | |
| #defineBOARD_TYPE "TEENSY 4.1/4.0" | |
| #elif defined(__MK66FX1M0__) | |
| #defineBOARD_TYPE "Teensy 3.6" | |
| #elif defined(__MK64FX512__) | |
| #defineBOARD_TYPE "Teensy 3.5" | |
| #elif defined(__MKL26Z64__) | |
| #defineBOARD_TYPE "Teensy LC" | |
| #elif defined(__MK20DX256__) | |
| #defineBOARD_TYPE "Teensy 3.2" // and Teensy 3.1 (obsolete) | |
| #elif defined(__MK20DX128__) | |
| #defineBOARD_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 | |
| #defineBOARD_TYPE "Unknown Teensy Board" | |
| #endif | |
| #elif defined(WIFI_USE_NRF528XX) | |
| #if defined(NRF52840_FEATHER) | |
| #defineBOARD_TYPE "NRF52840_FEATHER_EXPRESS" | |
| #elif defined(NRF52832_FEATHER) | |
| #defineBOARD_TYPE "NRF52832_FEATHER" | |
| #elif defined(NRF52840_FEATHER_SENSE) | |
| #defineBOARD_TYPE "NRF52840_FEATHER_SENSE" | |
| #elif defined(NRF52840_ITSYBITSY) | |
| #defineBOARD_TYPE "NRF52840_ITSYBITSY_EXPRESS" | |
| #elif defined(NRF52840_CIRCUITPLAY) | |
| #defineBOARD_TYPE "NRF52840_CIRCUIT_PLAYGROUND" | |
| #elif defined(NRF52840_CLUE) | |
| #defineBOARD_TYPE "NRF52840_CLUE" | |
| #elif defined(NRF52840_METRO) | |
| #defineBOARD_TYPE "NRF52840_METRO_EXPRESS" | |
| #elif defined(NRF52840_PCA10056) | |
| #defineBOARD_TYPE "NORDIC_NRF52840DK" | |
| #elif defined(NINA_B302_ublox) | |
| #defineBOARD_TYPE "NINA_B302_ublox" | |
| #elif defined(NINA_B112_ublox) | |
| #defineBOARD_TYPE "NINA_B112_ublox" | |
| #elif defined(PARTICLE_XENON) | |
| #defineBOARD_TYPE "PARTICLE_XENON" | |
| #elif defined(MDBT50Q_RX) | |
| #defineBOARD_TYPE "RAYTAC_MDBT50Q_RX" | |
| #elif defined(ARDUINO_NRF52_ADAFRUIT) | |
| #defineBOARD_TYPE "ARDUINO_NRF52_ADAFRUIT" | |
| #else | |
| #defineBOARD_TYPE "nRF52 Unknown" | |
| #endif | |
| #elif defined(WIFI_USE_SAMD) | |
| #if defined(ARDUINO_SAMD_ZERO) | |
| #defineBOARD_TYPE "SAMD Zero" | |
| #elif defined(ARDUINO_SAMD_MKR1000) | |
| #defineBOARD_TYPE "SAMD MKR1000" | |
| #elif defined(ARDUINO_SAMD_MKRWIFI1010) | |
| #defineBOARD_TYPE "SAMD MKRWIFI1010" | |
| #elif defined(ARDUINO_SAMD_NANO_33_IOT) | |
| #defineBOARD_TYPE "SAMD NANO_33_IOT" | |
| #elif defined(ARDUINO_SAMD_MKRFox1200) | |
| #defineBOARD_TYPE "SAMD MKRFox1200" | |
| #elif ( defined(ARDUINO_SAMD_MKRWAN1300)|| defined(ARDUINO_SAMD_MKRWAN1310) ) | |
| #defineBOARD_TYPE "SAMD MKRWAN13X0" | |
| #elif defined(ARDUINO_SAMD_MKRGSM1400) | |
| #defineBOARD_TYPE "SAMD MKRGSM1400" | |
| #elif defined(ARDUINO_SAMD_MKRNB1500) | |
| #defineBOARD_TYPE "SAMD MKRNB1500" | |
| #elif defined(ARDUINO_SAMD_MKRVIDOR4000) | |
| #defineBOARD_TYPE "SAMD MKRVIDOR4000" | |
| #elif defined(ARDUINO_SAMD_CIRCUITPLAYGROUND_EXPRESS) | |
| #defineBOARD_TYPE "SAMD ARDUINO_SAMD_CIRCUITPLAYGROUND_EXPRESS" | |
| #elif defined(ADAFRUIT_FEATHER_M0_EXPRESS) | |
| #defineBOARD_TYPE "SAMD21 ADAFRUIT_FEATHER_M0_EXPRESS" | |
| #elif defined(ADAFRUIT_METRO_M0_EXPRESS) | |
| #defineBOARD_TYPE "SAMD21 ADAFRUIT_METRO_M0_EXPRESS" | |
| #elif defined(ADAFRUIT_CIRCUITPLAYGROUND_M0) | |
| #defineBOARD_TYPE "SAMD21 ADAFRUIT_CIRCUITPLAYGROUND_M0" | |
| #elif defined(ADAFRUIT_GEMMA_M0) | |
| #defineBOARD_TYPE "SAMD21 ADAFRUIT_GEMMA_M0" | |
| #elif defined(ADAFRUIT_TRINKET_M0) | |
| #defineBOARD_TYPE "SAMD21 ADAFRUIT_TRINKET_M0" | |
| #elif defined(ADAFRUIT_ITSYBITSY_M0) | |
| #defineBOARD_TYPE "SAMD21 ADAFRUIT_ITSYBITSY_M0" | |
| #elif defined(ARDUINO_SAMD_HALLOWING_M0) | |
| #defineBOARD_TYPE "SAMD21 ARDUINO_SAMD_HALLOWING_M0" | |
| #elif defined(ADAFRUIT_METRO_M4_EXPRESS) | |
| #defineBOARD_TYPE "SAMD51 ADAFRUIT_METRO_M4_EXPRESS" | |
| #elif defined(ADAFRUIT_GRAND_CENTRAL_M4) | |
| #defineBOARD_TYPE "SAMD51 ADAFRUIT_GRAND_CENTRAL_M4" | |
| #elif defined(ADAFRUIT_FEATHER_M4_EXPRESS) | |
| #defineBOARD_TYPE "SAMD51 ADAFRUIT_FEATHER_M4_EXPRESS" | |
| #elif defined(ADAFRUIT_ITSYBITSY_M4_EXPRESS) | |
| #defineBOARD_TYPE "SAMD51 ADAFRUIT_ITSYBITSY_M4_EXPRESS" | |
| #elif defined(ADAFRUIT_TRELLIS_M4_EXPRESS) | |
| #defineBOARD_TYPE "SAMD51 ADAFRUIT_TRELLIS_M4_EXPRESS" | |
| #elif defined(ADAFRUIT_PYPORTAL) | |
| #defineBOARD_TYPE "SAMD51 ADAFRUIT_PYPORTAL" | |
| #elif defined(ADAFRUIT_PYPORTAL_M4_TITANO) | |
| #defineBOARD_TYPE "SAMD51 ADAFRUIT_PYPORTAL_M4_TITANO" | |
| #elif defined(ADAFRUIT_PYBADGE_M4_EXPRESS) | |
| #defineBOARD_TYPE "SAMD51 ADAFRUIT_PYBADGE_M4_EXPRESS" | |
| #elif defined(ADAFRUIT_METRO_M4_AIRLIFT_LITE) | |
| #defineBOARD_TYPE "SAMD51 ADAFRUIT_METRO_M4_AIRLIFT_LITE" | |
| #elif defined(ADAFRUIT_PYGAMER_M4_EXPRESS) | |
| #defineBOARD_TYPE "SAMD51 ADAFRUIT_PYGAMER_M4_EXPRESS" | |
| #elif defined(ADAFRUIT_PYGAMER_ADVANCE_M4_EXPRESS) | |
| #defineBOARD_TYPE "SAMD51 ADAFRUIT_PYGAMER_ADVANCE_M4_EXPRESS" | |
| #elif defined(ADAFRUIT_PYBADGE_AIRLIFT_M4) | |
| #defineBOARD_TYPE "SAMD51 ADAFRUIT_PYBADGE_AIRLIFT_M4" | |
| #elif defined(ADAFRUIT_MONSTER_M4SK_EXPRESS) | |
| #defineBOARD_TYPE "SAMD51 ADAFRUIT_MONSTER_M4SK_EXPRESS" | |
| #elif defined(ADAFRUIT_HALLOWING_M4_EXPRESS) | |
| #defineBOARD_TYPE "SAMD51 ADAFRUIT_HALLOWING_M4_EXPRESS" | |
| #elif defined(SEEED_WIO_TERMINAL) | |
| #defineBOARD_TYPE "SAMD SEEED_WIO_TERMINAL" | |
| #elif defined(SEEED_FEMTO_M0) | |
| #defineBOARD_TYPE "SAMD SEEED_FEMTO_M0" | |
| #elif defined(SEEED_XIAO_M0) | |
| #defineBOARD_TYPE "SAMD SEEED_XIAO_M0" | |
| #elif defined(Wio_Lite_MG126) | |
| #defineBOARD_TYPE "SAMD SEEED Wio_Lite_MG126" | |
| #elif defined(WIO_GPS_BOARD) | |
| #defineBOARD_TYPE "SAMD SEEED WIO_GPS_BOARD" | |
| #elif defined(SEEEDUINO_ZERO) | |
| #defineBOARD_TYPE "SAMD SEEEDUINO_ZERO" | |
| #elif defined(SEEEDUINO_LORAWAN) | |
| #defineBOARD_TYPE "SAMD SEEEDUINO_LORAWAN" | |
| #elif defined(SEEED_GROVE_UI_WIRELESS) | |
| #defineBOARD_TYPE "SAMD SEEED_GROVE_UI_WIRELESS" | |
| #elif defined(__SAMD21E18A__) | |
| #defineBOARD_TYPE "SAMD21E18A" | |
| #elif defined(__SAMD21G18A__) | |
| #defineBOARD_TYPE "SAMD21G18A" | |
| #elif defined(__SAMD51G19A__) | |
| #defineBOARD_TYPE "SAMD51G19A" | |
| #elif defined(__SAMD51J19A__) | |
| #defineBOARD_TYPE "SAMD51J19A" | |
| #elif defined(__SAMD51P19A__) | |
| #defineBOARD_TYPE "__SAMD51P19A__" | |
| #elif defined(__SAMD51J20A__) | |
| #defineBOARD_TYPE "SAMD51J20A" | |
| #elif defined(__SAM3X8E__) | |
| #defineBOARD_TYPE "SAM3X8E" | |
| #elif defined(__CPU_ARC__) | |
| #defineBOARD_TYPE "CPU_ARC" | |
| #elif defined(__SAMD51__) | |
| #defineBOARD_TYPE "SAMD51" | |
| #else | |
| #defineBOARD_TYPE "SAMD Unknown" | |
| #endif | |
| #elif defined(WIFI_USE_STM32) | |
| #if defined(STM32F0) | |
| #warning STM32F0 board selected | |
| #defineBOARD_TYPE "STM32F0" | |
| #elif defined(STM32F1) | |
| #warning STM32F1 board selected | |
| #defineBOARD_TYPE "STM32F1" | |
| #elif defined(STM32F2) | |
| #warning STM32F2 board selected | |
| #defineBOARD_TYPE "STM32F2" | |
| #elif defined(STM32F3) | |
| #warning STM32F3 board selected | |
| #defineBOARD_TYPE "STM32F3" | |
| #elif defined(STM32F4) | |
| #warning STM32F4 board selected | |
| #defineBOARD_TYPE "STM32F4" | |
| #elif defined(STM32F7) | |
| #warning STM32F7 board selected | |
| #defineBOARD_TYPE "STM32F7" | |
| #elif defined(STM32L0) | |
| #warning STM32L0 board selected | |
| #defineBOARD_TYPE "STM32L0" | |
| #elif defined(STM32L1) | |
| #warning STM32L1 board selected | |
| #defineBOARD_TYPE "STM32L1" | |
| #elif defined(STM32L4) | |
| #warning STM32L4 board selected | |
| #defineBOARD_TYPE "STM32L4" | |
| #elif defined(STM32H7) | |
| #warning STM32H7 board selected | |
| #defineBOARD_TYPE "STM32H7" | |
| #elif defined(STM32G0) | |
| #warning STM32G0 board selected | |
| #defineBOARD_TYPE "STM32G0" | |
| #elif defined(STM32G4) | |
| #warning STM32G4 board selected | |
| #defineBOARD_TYPE "STM32G4" | |
| #elif defined(STM32WB) | |
| #warning STM32WB board selected | |
| #defineBOARD_TYPE "STM32WB" | |
| #elif defined(STM32MP1) | |
| #warning STM32MP1 board selected | |
| #defineBOARD_TYPE "STM32MP1" | |
| #else | |
| #warning STM32 unknown board selected | |
| #defineBOARD_TYPE "STM32 Unknown" | |
| #endif | |
| #elif defined(ESP32) | |
| #warning ESP32 board selected | |
| #defineBOARD_TYPE "ESP32" | |
| #defineMULTIPLY_FACTOR 4 | |
| #elif defined(ESP8266) | |
| #warning ESP8266 board selected | |
| #defineBOARD_TYPE "ESP8266" | |
| #defineMULTIPLY_FACTOR 4 | |
| #else | |
| #defineBOARD_TYPE "AVR Mega" | |
| #endif | |
| #ifndefBOARD_NAME | |
| #if defined(ARDUINO_BOARD) | |
| #defineBOARD_NAME ARDUINO_BOARD | |
| #elif defined(BOARD_TYPE) | |
| #defineBOARD_NAME BOARD_TYPE | |
| #else | |
| #defineBOARD_NAME "Unknown Board" | |
| #endif | |
| #endif | |
| #if !defined(MULTIPLY_FACTOR) | |
| #defineMULTIPLY_FACTOR 1 | |
| #endif | |
| //#define SENDCONTENT_P_BUFFER_SZ 8192 | |
| #include<WiFiWebServer.h> | |
| charssid[]="YOUR_SSID";// your network SSID (name) | |
| charpass[]="12345678";// your network password | |
| #endif//defines_h |
The following are debug terminal output and screen shot when running exampleAdvancedWebServer onSAMD_NANO_33_IOT with WiFiNINA using WiFiNINA_Generic Library
Starting AdvancedServer on SAMD_NANO_33_IOTWiFiWebServer v1.10.1[NN] ===============================[NN] Used/default SPI pinout: [NN] MOSI:11[NN] MISO:12[NN] SCK:13[NN] SS:10[NN] ===============================[NN] Used/default NINA pinout: [NN] NINA_GPIO0:26[NN] NINA_RESETN/SPIWIFI_RESET:27[NN] NINA_ACK:28[NN] SS:10[NN] ===============================[NN] Actualfinal pinout to used: [NN] SPIWIFI_SS:24[NN] SLAVESELECT/SPIWIFI_SS:24[NN] SLAVEREADY/SPIWIFI_ACK/NINA_ACK:28[NN] SLAVERESET/SPIWIFI_RESET/NINA_RESETN:27[NN] ===============================Connecting to WPA SSID: HueNet1HTTP server started @192.168.2.118H[WIFI] String Len =0, extend to2048WiFiWebServer::handleClient: New Clientmethod: GETurl: /search:headerName: HostheaderValue:192.168.2.118headerName: ConnectionheaderValue: keep-aliveheaderName: Cache-ControlheaderValue: max-age=0headerName: DNTheaderValue:1headerName: Upgrade-Insecure-RequestsheaderValue:1headerName: User-AgentheaderValue: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36headerName: AcceptheaderValue: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9headerName: Accept-EncodingheaderValue: gzip, deflateheaderName: Accept-LanguageheaderValue: en-GB,en-US;q=0.9,en;q=0.8headerName: CookieheaderValue: NINASESSIONID=0args:args count:0args:args count:0Request: /Arguments: Final list of key/value pairs:WiFiWebServer::_handleRequest handleWiFiWebServer::send1: len =330content = <html><head><meta http-equiv='refresh' content='5'/><title>WiFiNINA SAMD_NANO_33_IOT</title><style>body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }</style></head><body><h1>Hello from WiFiNINA</h1><h2>on SAMD_NANO_33_IOT</h2><p>Uptime:00:00:20</p><img src="/test.svg" /></body></html>WiFiWebServer::_prepareHeader sendHeader Conn closeWiFiWebServer::send1: write header = HTTP/1.1200 OKContent-Type: text/htmlContent-Length:330Connection: closeWiFiWebServer::sendContent: Client.write content: <html><head><meta http-equiv='refresh' content='5'/><title>WiFiNINA SAMD_NANO_33_IOT</title><style>body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }</style></head><body><h1>Hello from WiFiNINA</h1><h2>on SAMD_NANO_33_IOT</h2><p>Uptime:00:00:20</p><img src="/test.svg" /></body></html>WiFiWebServer::_handleRequest OKWiFiWebServer::handleClient: Client disconnectedWiFiWebServer::handleClient: Don't keepCurrentClientWiFiWebServer::handleClient: Client disconnectedWiFiWebServer::handleClient: New Clientmethod: GETurl: /test.svgsearch:headerName: HostheaderValue: 192.168.2.118headerName: ConnectionheaderValue: keep-aliveheaderName: User-AgentheaderValue: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36headerName: DNTheaderValue: 1headerName: AcceptheaderValue: image/webp,image/apng,image/*,*/*;q=0.8headerName: RefererheaderValue: http://192.168.2.118/headerName: Accept-EncodingheaderValue: gzip, deflateheaderName: Accept-LanguageheaderValue: en-GB,en-US;q=0.9,en;q=0.8headerName: CookieheaderValue: NINASESSIONID=0args:args count: 0args:args count: 0Request: /test.svgArguments:Final list of key/value pairs:WiFiWebServer::_handleRequest handleWiFiWebServer::send1: len = 1946content = <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="310" height="150"><rect width="310" height="150" fill="rgb(250, 230, 210)" stroke-width="1" stroke="rgb(0, 0, 0)" /><g stroke="black"><line x1="10" y1="77" x2="20" y2="67" stroke-width="1" /><line x1="20" y1="67" x2="30" y2="98" stroke-width="1" /><line x1="30" y1="98" x2="40" y2="111" stroke-width="1" /><line x1="40" y1="111" x2="50" y2="90" stroke-width="1" /><line x1="50" y1="90" x2="60" y2="22" stroke-width="1" /><line x1="60" y1="22" x2="70" y2="98" stroke-width="1" /><line x1="70" y1="98" x2="80" y2="64" stroke-width="1" /><line x1="80" y1="64" x2="90" y2="104" stroke-width="1" /><line x1="90" y1="104" x2="100" y2="31" stroke-width="1" /><line x1="100" y1="31" x2="110" y2="59" stroke-width="1" /><line x1="110" y1="59" x2="120" y2="139" stroke-width="1" /><line x1="120" y1="139" x2="130" y2="117" stroke-width="1" /><line x1="130" y1="117" x2="140" y2="75" stroke-width="1" /><line x1="140" y1="75" x2="150" y2="72" stroke-width="1" /><line x1="150" y1="72" x2="160" y2="137" stroke-width="1" /><line x1="160" y1="137" x2="170" y2="20" stroke-width="1" /><line x1="170" y1="20" x2="180" y2="94" stroke-width="1" /><line x1="180" y1="94" x2="190" y2="81" stroke-width="1" /><line x1="190" y1="81" x2="200" y2="38" stroke-width="1" /><line x1="200" y1="38" x2="210" y2="33" stroke-width="1" /><line x1="210" y1="33" x2="220" y2="53" stroke-width="1" /><line x1="220" y1="53" x2="230" y2="88" stroke-width="1" /><line x1="230" y1="88" x2="240" y2="32" stroke-width="1" /><line x1="240" y1="32" x2="250" y2="110" stroke-width="1" /><line x1="250" y1="110" x2="260" y2="87" stroke-width="1" /><line x1="260" y1="87" x2="270" y2="11" stroke-width="1" /><line x1="270" y1="11" x2="280" y2="98" stroke-width="1" /><line x1="280" y1="98" x2="290" y2="76" stroke-width="1" /><line x1="290" y1="76" x2="300" y2="121" stroke-width="1" /></g></svg>WiFiWebServer::_prepareHeader sendHeader Conn closeWiFiWebServer::send1: write header = HTTP/1.1 200 OKContent-Type: image/svg+xmlContent-Length: 1946Connection: close
The terminal output ofSAMD_NANO_33_IOT with WiFiNINA using WiFiNINA_Generic Library runningSimpleWebSocket example to demonstrate newly-added WebSocket Client feature.
Starting SimpleWebSocket on SAMD_NANO_33_IOT with WiFiNINAusing WiFiNINA_Generic LibraryWiFiWebServer v1.10.1Connecting to SSID: HueNet1You're connected to the network, IP = 192.168.2.98SSID: HueNet1, Signal strength (RSSI):-24 dBmstarting WebSocket clientSending Hello 0Sending Hello 1Received a message:0 => Hello from SimpleWebSocket on SAMD_NANO_33_IOT, millis = 6642Sending Hello 2Received a message:1 => Hello from SimpleWebSocket on SAMD_NANO_33_IOT, millis = 11648Sending Hello 3Received a message:2 => Hello from SimpleWebSocket on SAMD_NANO_33_IOT, millis = 16655Sending Hello 4Received a message:3 => Hello from SimpleWebSocket on SAMD_NANO_33_IOT, millis = 21661Sending Hello 5Received a message:4 => Hello from SimpleWebSocket on SAMD_NANO_33_IOT, millis = 26668Sending Hello 6Received a message:5 => Hello from SimpleWebSocket on SAMD_NANO_33_IOT, millis = 31675
The terminal output ofSAMD_NANO_33_IOT with WiFiNINA using WiFiNINA_Generic Library runningSimpleHTTPExample example to demonstrate newly-added HTTP Client feature.
Starting SimpleHTTPExample on SAMD_NANO_33_IOT with WiFiNINAusing WiFiNINA_Generic LibraryWiFiWebServer v1.10.1Connecting to SSID: HueNet1You're connected to the network, IP = 192.168.2.98SSID: HueNet1, Signal strength (RSSI):-21 dBmstartedRequest okGot status code: 200Content length is: 2263Body returned follows: `:;;;,` .:;;:. .;;;;;;;;;;;` :;;;;;;;;;;: TM `;;;;;;;;;;;;;;;` :;;;;;;;;;;;;;;; :;;;;;;;;;;;;;;;;;; `;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; .;;;;;;;;;;;;;;;;;;;; ;;;;;;;;:` `;;;;;;;;; ,;;;;;;;;.` .;;;;;;;; .;;;;;;, :;;;;;;; .;;;;;;; ;;;;;;; ;;;;;; ;;;;;;; ;;;;;;, ;;;;;;. ,;;;;; ;;;;;;.;;;;;;` ;;;;;; ;;;;;. ;;;;;;;;;;;` ``` ;;;;;` ;;;;; ;;;;;;;;;, ;;; .;;;;;`;;;;: `;;;;;;;; ;;; ;;;;;,;;;;` `,,,,,,,, ;;;;;;; .,,;;;,,, ;;;;;:;;;;` .;;;;;;;; ;;;;;, :;;;;;;;; ;;;;;:;;;;` .;;;;;;;; `;;;;;; :;;;;;;;; ;;;;;.;;;;. ;;;;;;;. ;;; ;;;;; ;;;;; ;;;;;;;;; ;;; ;;;;; ;;;;; .;;;;;;;;;; ;;; ;;;;;, ;;;;;; `;;;;;;;;;;;; ;;;;; `;;;;;, .;;;;;; ;;;;;;; ;;;;;; ;;;;;;: :;;;;;;. ;;;;;;; ;;;;;; ;;;;;;;` .;;;;;;;, ;;;;;;;; ;;;;;;;: ;;;;;;;;;:,:;;;;;;;;;: ;;;;;;;;;;:,;;;;;;;;;; `;;;;;;;;;;;;;;;;;;;. ;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;; :;;;;;;;;;;;;;;;;: ,;;;;;;;;;;;;;, ;;;;;;;;;;;;;; .;;;;;;;;;` ,;;;;;;;;: ;;; ;;;;;` ;;;;: .;; ;; ,;;;;;, ;;. `;, ;;;; ;;; ;;:;;; ;;;;;; .;; ;; ,;;;;;: ;;; `;, ;;;:;; ,;:; ;; ;; ;; ;; .;; ;; ,;, ;;;,`;, ;; ;; ;; ;: ;; ;; ;; ;; .;; ;; ,;, ;;;;`;, ;; ;;. ;: ;; ;;;;;: ;; ;; .;; ;; ,;, ;;`;;;, ;; ;;` ,;;;;; ;;`;; ;; ;; .;; ;; ,;, ;; ;;;, ;; ;; ;; ,;, ;; .;; ;;;;;: ;;;;;: ,;;;;;: ;; ;;, ;;;;;; ;; ;; ;; ;;` ;;;;. `;;;: ,;;;;;, ;; ;;, ;;;;
The terminal output ofSAMD_NANO_33_IOT with WiFiNINA using WiFiNINA_Generic Library runningDweetPost example to demonstrate newly-added HTTP Client feature.
Starting DweetPost on SAMD_NANO_33_IOT with WiFiNINAusing WiFiNINA_Generic LibraryWiFiWebServer v1.10.1Connecting to SSID: HueNet1You're connected to the network, IP = 192.168.2.98SSID: HueNet1, Signal strength (RSSI):-22 dBmmaking POST requestStatus code: 200Response: {"this":"succeeded","by":"dweeting","the":"dweet","with":{"thing":"Hello-from-SAMD_NANO_33_IOT","created":"2020-11-17T19:55:37.378Z","content":{"sensorValue":581},"transaction":"f968ee5f-35b5-4984-ac3d-34d93fdaddbe"}}Wait ten secondsmaking POST requestStatus code: 200Response: {"this":"succeeded","by":"dweeting","the":"dweet","with":{"thing":"Hello-from-SAMD_NANO_33_IOT","created":"2020-11-17T19:55:48.925Z","content":{"sensorValue":570},"transaction":"68ee52e0-22a3-4af2-96cd-aaa53587b314"}}Wait ten seconds
The terminal output ofSAMD_NANO_33_IOT with WiFiNINA using WiFiNINA_Generic Library runningDweetGet example to demonstrate newly-added HTTP Client feature.
Starting DweetGet on SAMD_NANO_33_IOT with WiFiNINAusing WiFiNINA_Generic LibraryWiFiWebServer v1.10.1Connecting to SSID: HueNet1You're connected to the network, IP = 192.168.2.98SSID: HueNet1, Signal strength (RSSI):-25 dBmMaking GET requestStatus code: 200Response: {"this":"succeeded","by":"getting","the":"dweets","with":[{"thing":"Hello-from-SAMD_NANO_33_IOT","created":"2020-11-17T20:06:18.905Z","content":{"sensorValue":567}}]}"sensorValue":567Value string: 567Actual value: 567Wait ten secondsMaking GET requestStatus code: 200Response: {"this":"succeeded","by":"getting","the":"dweets","with":[{"thing":"Hello-from-SAMD_NANO_33_IOT","created":"2020-11-17T20:06:18.905Z","content":{"sensorValue":567}}]}"sensorValue":567Value string: 567Actual value: 567Wait ten seconds
The terminal output ofSAMD_NANO_33_IOT with WiFiNINA using WiFiNINA_Generic Library runningMQTTClient_Auth example to demonstrate newly-added MQTT Client feature.
Starting MQTTClient_Auth on SAMD_NANO_33_IOT with WiFiNINAusing WiFiNINA_Generic LibraryWiFiWebServer v1.10.1Please upgrade the firmwareConnecting to WPA SSID: HueNet1Connected! IP address:192.168.2.98Attempting MQTT connection to broker.emqx.io...connectedMessage Send : MQTT_Pub => Hello from MQTTClient_Auth on SAMD_NANO_33_IOT with WiFiNINAusing WiFiNINA_Generic LibraryMessage arrived [MQTT_Pub] Hello from MQTTClient_Auth on SAMD_NANO_33_IOT with WiFiNINAusing WiFiNINA_Generic LibraryMessage Send : MQTT_Pub => Hello from MQTTClient_Auth on SAMD_NANO_33_IOT with WiFiNINAusing WiFiNINA_Generic LibraryMessage arrived [MQTT_Pub] Hello from MQTTClient_Auth on SAMD_NANO_33_IOT with WiFiNINAusing WiFiNINA_Generic Library
The terminal output ofSAMD_NANO_33_IOT with WiFiNINA using WiFiNINA_Generic Library runningMQTT_ThingStream example to demonstrate newly-added MQTT Client feature.
Start MQTT_ThingStream on SAMD_NANO_33_IOTStarting MQTTClient_Auth on SAMD_NANO_33_IOT with WiFiNINAusing WiFiNINA_Generic LibraryWiFiWebServer v1.10.1Please upgrade the firmwareConnecting to WPA SSID: HueNet1Connected! IP address:192.168.2.98***************************************STM32_Pub***************************************Attempting MQTT connection to broker.emqx.io...connectedPublished connection message successfully!Subscribed to: STM32_SubMQTT Message Send : STM32_Pub => Hello from MQTT_ThingStream on SAMD_NANO_33_IOT with WiFiNINAusing WiFiNINA_Generic LibraryMQTT Message receive [STM32_Pub] Hello from MQTT_ThingStream on SAMD_NANO_33_IOT with WiFiNINAusing WiFiNINA_Generic LibraryMQTT Message Send : STM32_Pub => Hello from MQTT_ThingStream on SAMD_NANO_33_IOT with WiFiNINAusing WiFiNINA_Generic LibraryMQTT Message receive [STM32_Pub] Hello from MQTT_ThingStream on SAMD_NANO_33_IOT with WiFiNINAusing WiFiNINA_Generic LibraryMQTT Message Send : STM32_Pub => Hello from MQTT_ThingStream on SAMD_NANO_33_IOT with WiFiNINAusing WiFiNINA_Generic LibraryMQTT Message receive [STM32_Pub] Hello from MQTT_ThingStream on SAMD_NANO_33_IOT with WiFiNINAusing WiFiNINA_Generic Library
The terminal output ofRASPBERRY_PI_PICO with Custom WiFi (ESP8266-AT) using Custom WiFi (WiFiEspAT) Library runningWebClientRepeating example to demonstrate new RP2040-based board usingEarle Philhower's arduino-pico core
Starting WebClientRepeating on RASPBERRY_PI_PICO with Custom WiFiusing Custom WiFi LibraryWiFiWebServer v1.10.1WiFi shield init doneConnecting to SSID: HueNet1You're connected to the network, IP = 192.168.2.76SSID: HueNet1, Signal strength (RSSI):-29 dBmConnecting...HTTP/1.1 200 OKServer: nginx/1.4.2Date: Wed, 26 May 2021 03:56:08 GMTContent-Type: text/plainContent-Length: 2263Last-Modified: Wed, 02 Oct 2013 13:46:47 GMTConnection: closeVary: Accept-EncodingETag: "524c23c7-8d7"Accept-Ranges: bytes `:;;;,` .:;;:. .;;;;;;;;;;;` :;;;;;;;;;;: TM `;;;;;;;;;;;;;;;` :;;;;;;;;;;;;;;; :;;;;;;;;;;;;;;;;;; `;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; .;;;;;;;;;;;;;;;;;;;; ;;;;;;;;:` `;;;;;;;;; ,;;;;;;;;.` .;;;;;;;; .;;;;;;, :;;;;;;; .;;;;;;; ;;;;;;; ;;;;;; ;;;;;;; ;;;;;;, ;;;;;;. ,;;;;; ;;;;;;.;;;;;;` ;;;;;; ;;;;;. ;;;;;;;;;;;` ``` ;;;;;` ;;;;; ;;;;;;;;;, ;;; .;;;;;`;;;;: `;;;;;;;; ;;; ;;;;;,;;;;` `,,,,,,,, ;;;;;;; .,,;;;,,, ;;;;;:;;;;` .;;;;;;;; ;;;;;, :;;;;;;;; ;;;;;:;;;;` .;;;;;;;; `;;;;;; :;;;;;;;; ;;;;;.;;;;. ;;;;;;;. ;;; ;;;;; ;;;;; ;;;;;;;;; ;;; ;;;;; ;;;;; .;;;;;;;;;; ;;; ;;;;;, ;;;;;; `;;;;;;;;;;;; ;;;;; `;;;;;, .;;;;;; ;;;;;;; ;;;;;; ;;;;;;: :;;;;;;. ;;;;;;; ;;;;;; ;;;;;;;` .;;;;;;;, ;;;;;;;; ;;;;;;;: ;;;;;;;;;:,:;;;;;;;;;: ;;;;;;;;;;:,;;;;;;;;;; `;;;;;;;;;;;;;;;;;;;. ;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;; :;;;;;;;;;;;;;;;;: ,;;;;;;;;;;;;;, ;;;;;;;;;;;;;; .;;;;;;;;;` ,;;;;;;;;: ;;; ;;;;;` ;;;;: .;; ;; ,;;;;;, ;;. `;, ;;;; ;;; ;;:;;; ;;;;;; .;; ;; ,;;;;;: ;;; `;, ;;;:;; ,;:; ;; ;; ;; ;; .;; ;; ,;, ;;;,`;, ;; ;; ;; ;: ;; ;; ;; ;; .;; ;; ,;, ;;;;`;, ;; ;;. ;: ;; ;;;;;: ;; ;; .;; ;; ,;, ;;`;;;, ;; ;;` ,;;;;; ;;`;; ;; ;; .;; ;; ,;, ;; ;;;, ;; ;; ;; ,;, ;; .;; ;;;;;: ;;;;;: ,;;;;;: ;; ;;, ;;;;;; ;; ;; ;; ;;` ;;;;. `;;;: ,;;;;;, ;; ;;, ;;;;
The following are debug terminal output and screen shot when running exampleAdvancedWebServer onNano RP2040 Connect with WiFiNINA using WiFiNINA_Generic Library
Starting AdvancedServer on Nano RP2040 Connect with WiFiNINAusing WiFiNINA_Generic LibraryWiFiWebServer v1.10.1Connecting to WPA SSID: HueNet1HTTP server started @192.168.2.130H[WIFI] handleClient: New Client[WIFI] method: GET[WIFI] url: /[WIFI] search:[WIFI] headerName: Host[WIFI] headerValue:192.168.2.130[WIFI] headerName: Connection[WIFI] headerValue: keep-alive[WIFI] headerName: Cache-Control[WIFI] headerValue: max-age=0[WIFI] headerName: Upgrade-Insecure-Requests[WIFI] headerValue:1[WIFI] headerName: DNT[WIFI] headerValue:1[WIFI] headerName: User-Agent[WIFI] headerValue: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36[WIFI] headerName: Accept[WIFI] headerValue: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9[WIFI] headerName: Referer[WIFI] headerValue: http://192.168.2.130/[WIFI] headerName: Accept-Encoding[WIFI] headerValue: gzip, deflate[WIFI] headerName: Accept-Language[WIFI] headerValue: en-GB,en-US;q=0.9,en;q=0.8,vi;q=0.7[WIFI] args:[WIFI] args count:0[WIFI] args:[WIFI] args count:0[WIFI] Request: /[WIFI] Arguments: [WIFI] Final list of key/value pairs:[WIFI] _handleRequest handle[WIFI] send1: len =392[WIFI] content = <html><head><meta http-equiv='refresh' content='5'/><title>Nano RP2040 Connect</title><style>body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }</style></head><body><h1>Hello from Nano RP2040 Connect</h1><h3>running WiFiWebServer</h3><h3>on WiFiNINAusing WiFiNINA_Generic Library</h3><p>Uptime:0 d00:00:12</p><img src="/test.svg" /></body></html>[WIFI] _prepareHeader sendHeader Conn close[WIFI] send1: write header = HTTP/1.1200 OKContent-Type: text/htmlContent-Length:392Connection: close[WIFI] sendContent: Client.write content: <html><head><meta http-equiv='refresh' content='5'/><title>Nano RP2040 Connect</title><style>body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }</style></head><body><h1>Hello from Nano RP2040 Connect</h1><h3>running WiFiWebServer</h3><h3>on WiFiNINAusing WiFiNINA_Generic Library</h3><p>Uptime:0 d00:00:12</p><img src="/test.svg" /></body></html>[WIFI] _handleRequest OK[WIFI] handleClient: Client disconnected[WIFI] handleClient: Don't keepCurrentClient[WIFI] handleClient: Client disconnected[WIFI] handleClient: New Client[WIFI] method: GET[WIFI] url: /test.svg[WIFI] search:[WIFI] headerName: Host[WIFI] headerValue: 192.168.2.130[WIFI] headerName: Connection[WIFI] headerValue: keep-alive[WIFI] headerName: User-Agent[WIFI] headerValue: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36[WIFI] headerName: DNT[WIFI] headerValue: 1[WIFI] headerName: Accept[WIFI] headerValue: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8[WIFI] headerName: Referer[WIFI] headerValue: http://192.168.2.130/[WIFI] headerName: Accept-Encoding[WIFI] headerValue: gzip, deflate[WIFI] headerName: Accept-Language[WIFI] headerValue: en-GB,en-US;q=0.9,en;q=0.8,vi;q=0.7[WIFI] args:[WIFI] args count: 0[WIFI] args:[WIFI] args count: 0[WIFI] Request: /test.svg[WIFI] Arguments:[WIFI] Final list of key/value pairs:[WIFI] _handleRequest handle[WIFI] send1: len = 1954[WIFI] content = <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="310" height="150"><rect width="310" height="150" fill="rgb(250, 230, 210)" stroke-width="3" stroke="rgb(0, 0, 0)" /><g stroke="blue"><line x1="10" y1="77" x2="20" y2="92" stroke-width="2" /><line x1="20" y1="92" x2="30" y2="123" stroke-width="2" /><line x1="30" y1="123" x2="40" y2="136" stroke-width="2" /><line x1="40" y1="136" x2="50" y2="115" stroke-width="2" /><line x1="50" y1="115" x2="60" y2="47" stroke-width="2" /><line x1="60" y1="47" x2="70" y2="123" stroke-width="2" /><line x1="70" y1="123" x2="80" y2="89" stroke-width="2" /><line x1="80" y1="89" x2="90" y2="129" stroke-width="2" /><line x1="90" y1="129" x2="100" y2="56" stroke-width="2" /><line x1="100" y1="56" x2="110" y2="83" stroke-width="2" /><line x1="110" y1="83" x2="120" y2="33" stroke-width="2" /><line x1="120" y1="33" x2="130" y2="11" stroke-width="2" /><line x1="130" y1="11" x2="140" y2="99" stroke-width="2" /><line x1="140" y1="99" x2="150" y2="96" stroke-width="2" /><line x1="150" y1="96" x2="160" y2="31" stroke-width="2" /><line x1="160" y1="31" x2="170" y2="44" stroke-width="2" /><line x1="170" y1="44" x2="180" y2="118" stroke-width="2" /><line x1="180" y1="118" x2="190" y2="105" stroke-width="2" /><line x1="190" y1="105" x2="200" y2="62" stroke-width="2" /><line x1="200" y1="62" x2="210" y2="57" stroke-width="2" /><line x1="210" y1="57" x2="220" y2="77" stroke-width="2" /><line x1="220" y1="77" x2="230" y2="111" stroke-width="2" /><line x1="230" y1="111" x2="240" y2="55" stroke-width="2" /><line x1="240" y1="55" x2="250" y2="133" stroke-width="2" /><line x1="250" y1="133" x2="260" y2="110" stroke-width="2" /><line x1="260" y1="110" x2="270" y2="34" stroke-width="2" /><line x1="270" y1="34" x2="280" y2="121" stroke-width="2" /><line x1="280" y1="121" x2="290" y2="99" stroke-width="2" /><line x1="290" y1="99" x2="300" y2="14" stroke-width="2" /></g></svg>[WIFI] _prepareHeader sendHeader Conn close[WIFI] send1: write header = HTTP/1.1 200 OKContent-Type: image/svg+xmlContent-Length: 1954Connection: close
The terminal output ofESP32_DEV runningSimpleHTTPExample example to demonstrate newly-added HTTP Client feature.
Starting SimpleHTTPExample on ESP32_DEV with ESP WiFiusing WiFi LibraryWiFiWebServer v1.10.1Connecting to SSID: HueNet1You're connected to the network, IP = 192.168.2.80SSID: HueNet1, Signal strength (RSSI):-23 dBmstartedRequest okGot status code: 200Content length is: 2263Body returned follows: `:;;;,` .:;;:. .;;;;;;;;;;;` :;;;;;;;;;;: TM `;;;;;;;;;;;;;;;` :;;;;;;;;;;;;;;; :;;;;;;;;;;;;;;;;;; `;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; .;;;;;;;;;;;;;;;;;;;; ;;;;;;;;:` `;;;;;;;;; ,;;;;;;;;.` .;;;;;;;; .;;;;;;, :;;;;;;; .;;;;;;; ;;;;;;; ;;;;;; ;;;;;;; ;;;;;;, ;;;;;;. ,;;;;; ;;;;;;.;;;;;;` ;;;;;; ;;;;;. ;;;;;;;;;;;` ``` ;;;;;` ;;;;; ;;;;;;;;;, ;;; .;;;;;`;;;;: `;;;;;;;; ;;; ;;;;;,;;;;` `,,,,,,,, ;;;;;;; .,,;;;,,, ;;;;;:;;;;` .;;;;;;;; ;;;;;, :;;;;;;;; ;;;;;:;;;;` .;;;;;;;; `;;;;;; :;;;;;;;; ;;;;;.;;;;. ;;;;;;;. ;;; ;;;;; ;;;;; ;;;;;;;;; ;;; ;;;;; ;;;;; .;;;;;;;;;; ;;; ;;;;;, ;;;;;; `;;;;;;;;;;;; ;;;;; `;;;;;, .;;;;;; ;;;;;;; ;;;;;; ;;;;;;: :;;;;;;. ;;;;;;; ;;;;;; ;;;;;;;` .;;;;;;;, ;;;;;;;; ;;;;;;;: ;;;;;;;;;:,:;;;;;;;;;: ;;;;;;;;;;:,;;;;;;;;;; `;;;;;;;;;;;;;;;;;;;. ;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;; :;;;;;;;;;;;;;;;;: ,;;;;;;;;;;;;;, ;;;;;;;;;;;;;; .;;;;;;;;;` ,;;;;;;;;: ;;; ;;;;;` ;;;;: .;; ;; ,;;;;;, ;;. `;, ;;;; ;;; ;;:;;; ;;;;;; .;; ;; ,;;;;;: ;;; `;, ;;;:;; ,;:; ;; ;; ;; ;; .;; ;; ,;, ;;;,`;, ;; ;; ;; ;: ;; ;; ;; ;; .;; ;; ,;, ;;;;`;, ;; ;;. ;: ;; ;;;;;: ;; ;; .;; ;; ,;, ;;`;;;, ;; ;;` ,;;;;; ;;`;; ;; ;; .;; ;; ,;, ;; ;;;, ;; ;; ;; ,;, ;; .;; ;;;;;: ;;;;;: ,;;;;;: ;; ;;, ;;;;;; ;; ;; ;; ;;` ;;;;. `;;;: ,;;;;;, ;; ;;, ;;;;Got status code: 200Content length is: 2263
The following are debug terminal output and screen shot when running exampleAdvancedWebServer onPORTENTA_H7_M7 with Portenta_H7 WiFi
Starting AdvancedServer on PORTENTA_H7_M7 with Portenta_H7 WiFiWiFiWebServer v1.10.1Connecting to WPA SSID: HueNet1HTTP server started @192.168.2.138H[WIFI] String Len =0, extend to2048HHHHHHHHH HHHHHHH
The terminal output ofPORTENTA_H7_M7 with Portenta_H7 WiFi runningMQTTClient_Auth example to demonstrate MQTT Client feature.
Starting MQTTClient_Auth on PORTENTA_H7_M7 with Portenta_H7 WiFiWiFiWebServer v1.10.1Connecting to SSID: HueNet1Connected! IP address:192.168.2.130Attempting MQTT connection to broker.emqx.io...connectedMessage Send : MQTT_Pub => Hello from MQTTClient_Auth on PORTENTA_H7_M7 with Portenta_H7 WiFiMessage arrived [MQTT_Pub] Hello from MQTTClient_Auth on PORTENTA_H7_M7 with Portenta_H7 WiFiMessage Send : MQTT_Pub => Hello from MQTTClient_Auth on PORTENTA_H7_M7 with Portenta_H7 WiFiMessage arrived [MQTT_Pub] Hello from MQTTClient_Auth on PORTENTA_H7_M7 with Portenta_H7 WiFi
The terminal output ofPORTENTA_H7_M7 with Portenta_H7 WiFi runningWebClientRepeating example.
Starting WebClientRepeating on PORTENTA_H7_M7 with Portenta_H7 WiFiWiFiWebServer v1.10.1Connecting to SSID: HueNet1You're connected to the network, IP = 192.168.2.130SSID: HueNet1, Signal strength (RSSI):-33 dBmConnecting...HTTP/1.1 200 OKServer: nginx/1.4.2Date: Wed, 08 Sep 2021 01:29:41 GMTContent-Type: text/plainContent-Length: 2263Last-Modified: Wed, 02 Oct 2013 13:46:47 GMTConnection: closeVary: Accept-EncodingETag: "524c23c7-8d7"Accept-Ranges: bytes `:;;;,` .:;;:. .;;;;;;;;;;;` :;;;;;;;;;;: TM `;;;;;;;;;;;;;;;` :;;;;;;;;;;;;;;; :;;;;;;;;;;;;;;;;;; `;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; .;;;;;;;;;;;;;;;;;;;; ;;;;;;;;:` `;;;;;;;;; ,;;;;;;;;.` .;;;;;;;; .;;;;;;, :;;;;;;; .;;;;;;; ;;;;;;; ;;;;;; ;;;;;;; ;;;;;;, ;;;;;;. ,;;;;; ;;;;;;.;;;;;;` ;;;;;; ;;;;;. ;;;;;;;;;;;` ``` ;;;;;` ;;;;; ;;;;;;;;;, ;;; .;;;;;`;;;;: `;;;;;;;; ;;; ;;;;;,;;;;` `,,,,,,,, ;;;;;;; .,,;;;,,, ;;;;;:;;;;` .;;;;;;;; ;;;;;, :;;;;;;;; ;;;;;:;;;;` .;;;;;;;; `;;;;;; :;;;;;;;; ;;;;;.;;;;. ;;;;;;;. ;;; ;;;;; ;;;;; ;;;;;;;;; ;;; ;;;;; ;;;;; .;;;;;;;;;; ;;; ;;;;;, ;;;;;; `;;;;;;;;;;;; ;;;;; `;;;;;, .;;;;;; ;;;;;;; ;;;;;; ;;;;;;: :;;;;;;. ;;;;;;; ;;;;;; ;;;;;;;` .;;;;;;;, ;;;;;;;; ;;;;;;;: ;;;;;;;;;:,:;;;;;;;;;: ;;;;;;;;;;:,;;;;;;;;;; `;;;;;;;;;;;;;;;;;;;. ;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;; :;;;;;;;;;;;;;;;;: ,;;;;;;;;;;;;;, ;;;;;;;;;;;;;; .;;;;;;;;;` ,;;;;;;;;: ;;; ;;;;;` ;;;;: .;; ;; ,;;;;;, ;;. `;, ;;;; ;;; ;;:;;; ;;;;;; .;; ;; ,;;;;;: ;;; `;, ;;;:;; ,;:; ;; ;; ;; ;; .;; ;; ,;, ;;;,`;, ;; ;; ;; ;: ;; ;; ;; ;; .;; ;; ,;, ;;;;`;, ;; ;;. ;: ;; ;;;;;: ;; ;; .;; ;; ,;, ;;`;;;, ;; ;;` ,;;;;; ;;`;; ;; ;; .;; ;; ,;, ;; ;;;, ;; ;; ;; ,;, ;; .;; ;;;;;: ;;;;;: ,;;;;;: ;; ;;, ;;;;;; ;; ;; ;; ;;` ;;;;. `;;;: ,;;;;;, ;; ;;, ;;;;
The following are debug terminal output and screen shot when running exampleAdvancedWebServer onPORTENTA_H7_M7 with Portenta_H7 WiFi
Starting AdvancedWebServer on ESP32C3_DEV with ESP WiFiusing WiFi LibraryWiFiWebServer v1.10.1Connecting to WPA SSID: HueNet1HTTP server started @192.168.2.86HH
The following are debug terminal output and screen shot when running exampleAdvancedWebServer onPORTENTA_H7_M7 with Portenta_H7 WiFi
Starting AdvancedWebServer on ESP32S3_DEV with ESP WiFiusing WiFi LibraryWiFiWebServer v1.10.1Connecting to WPA SSID: HueNet1HTTP server started @192.168.2.86HH
The following are debug terminal output and screen shot when running exampleAdvancedWebServer_WiFiMulti onNano RP2040 Connect with WiFiNINA using WiFiNINA_Generic Library
Starting AdvancedWebServer_WiFiMulti on Nano RP2040 Connect with WiFiNINAusing WiFiNINA_Generic LibraryWiFiMulti_Generic v1.2.2WiFiWebServer v1.10.1Connecting WiFi...WiFi connected, IP address:192.168.2.113You're connected to the network, IP = 192.168.2.113SSID: HueNet1, Signal strength (RSSI):-20 dBmHTTP server started @ 192.168.2.113H
The following are debug terminal output and screen shot when running exampleMQTTClient_Auth_WiFiMulti onNano RP2040 Connect with WiFiNINA using WiFiNINA_Generic Library
Starting MQTTClient_Auth_WiFiMulti on Nano RP2040 Connect with WiFiNINAusing WiFiNINA_Generic LibraryWiFiMulti_Generic v1.2.2WiFiWebServer v1.10.1Connecting WiFi...WiFi connected, IP address:192.168.2.113You're connected to the network, IP = 192.168.2.113SSID: HueNet1, Signal strength (RSSI):-18 dBmAttempting MQTT connection to broker.emqx.io...connectedPublished connection message successfully!Subscribed to: Nano RP2040 ConnectSubHMQTT Message Send : Nano RP2040 ConnectPub => Hello from MQTTClient_Auth__WiFiMulti on Nano RP2040 Connect with WiFiNINA using WiFiNINA_Generic LibraryMessage arrived [Nano RP2040 ConnectPub] Hello from MQTTClient_Auth__WiFiMulti on Nano RP2040 Connect with WiFiNINA using WiFiNINA_Generic LibraryHHMQTT Message Send : Nano RP2040 ConnectPub => Hello from MQTTClient_Auth__WiFiMulti on Nano RP2040 Connect with WiFiNINA using WiFiNINA_Generic LibraryHMessage arrived [Nano RP2040 ConnectPub] Hello from MQTTClient_Auth__WiFiMulti on Nano RP2040 Connect with WiFiNINA using WiFiNINA_Generic LibraryHHMQTT Message Send : Nano RP2040 ConnectPub => Hello from MQTTClient_Auth__WiFiMulti on Nano RP2040 Connect with WiFiNINA using WiFiNINA_Generic LibraryHMessage arrived [Nano RP2040 ConnectPub] Hello from MQTTClient_Auth__WiFiMulti on Nano RP2040 Connect with WiFiNINA using WiFiNINA_Generic Library
The following are debug terminal output and screen shot when running exampleWiFiUdpNTPClient_WiFiMulti onNano RP2040 Connect with WiFiNINA using WiFiNINA_Generic Library
Starting WiFiUdpNTPClient_WiFiMulti on Nano RP2040 Connect with WiFiNINAusing WiFiNINA_Generic LibraryWiFiMulti_Generic v1.2.2WiFiWebServer v1.10.1Connecting WiFi...WiFi connected, IP address:192.168.2.113You're connected to the network, IP = 192.168.2.113SSID: HueNet1, Signal strength (RSSI):-17 dBmStarting connection to server...Listening on port 2390HHHPacket receivedSeconds since Jan 1 1900 = 3869665072Unix time = 1660676272The UTC time is 18:57:52HHPacket receivedSeconds since Jan 1 1900 = 3869665132Unix time = 1660676332The UTC time is 18:58:52HH
The following are debug terminal output and screen shot when running exampleAdvancedWebServer_WiFiMulti onRASPBERRY_PI_PICO_W with CYW43439 WiFi
Starting AdvancedWebServer_WiFiMulti on RASPBERRY_PI_PICO_W with RP2040W CYW43439 WiFiWiFiMulti_Generic v1.2.2WiFiWebServer v1.10.1Connecting WiFi...WiFi connected, IP address:192.168.2.180You're connected to the network, IP = 192.168.2.180SSID: HueNet1, Signal strength (RSSI):0 dBmHTTP server started @ 192.168.2.180HH
Debug is enabled by default on Serial. Debug Level from 0 to 4. To disable, change theWIFI_LOGLEVEL andWIFININA_LOGLEVEL to 0
// Use this to output debug msgs to Serial#defineDEBUG_WIFI_WEBSERVER_PORT Serial// Debug Level from 0 to 4#define_WIFI_LOGLEVEL_1#define_WIFININA_LOGLEVEL_1
If you get compilation errors, more often than not, you may need to install a newer version of the board's core, applying Libraries' Patches, Packages' Patches or this library latest version.
Submit issues to:WiFiWebServer issues
- Bug Searching and Killing
- Add SSL/TLS Client and Server support
- Support more types of boards using WiFiNINA and other WiFi shields.
- Add support to megaAVR boards usingMegaCoreX core
- Add support to Arduino SAMD21, Adafruit SAMD21/SAMD51, Seeeduino SAMD21/SAMD51.
- Add support to nRF52.
- Add support to SAM DUE.
- Add support to all STM32F/L/H/G/WB/MP1.
- Add support to WiFiNINA usingWiFiNINA_Generic library.
- Add support toESP_AT_Lib library.
- Add support to
WiFi101 library. - Add support to
WiFiEspAT library. - Add support to PROGMEM-related commands, such as sendContent_P() and send_P()
- AddHigh-level HTTP (GET, POST, PUT, PATCH, DELETE) and WebSocket Client
- Add support toArduino Nano RP2040 Connect usingArduino mbed OS for Nano boards.
- Add support to RP2040-based boards, such asRASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, usingEarle Philhower's arduino-pico core.
- Add support to RP2040-based boards, such asRASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, usingArduino-mbed mbed_rp2040 core.
- Add support toPortenta_H7 boards, usingArduino-mbed mbed_portenta core.
- Reduce usage of Arduino String with std::string
- Optimize library code and examples by usingreference-passing instead of value-passing.
- Add support to newESP32-S3 andESP32_C3
- Add support to megaAVR boards (UNO_WIFI_REV2, NANO_EVERY) usingArduino megaAVR core
- Rewrite library and add examplemultiFileProject to demo for multiple-file project to fix
multiple-definitionslinker error - AddWiFiMulti_Generic library support
- Add many WiFiMulti-related examples inWiFiMulti
- Add support to RASPBERRY_PI_PICO_W using CYW4343 WiFi withEarle Philhower's arduino-pico core v2.4.0+
- Better workaround for RP2040W
WiFi.status()bug usingping()to local gateway - Add new features, such as
CORS - Use
allman astyleand addutils - Using new
WiFi101_Generic libraryfor sending larger data
- Based on and modified fromIvan Grokhotkov's ESP8266WebServer
- Thanks to good work ofMiguel Alexandre Wisintainer for initiating, inspriring, working with, developing, debugging and testing. Without that, support to nRF52, especiallyU-Blox B302 running as nRF52840 and U-Blox B112 running as nRF52832, has never been started and finished. Seeu-blox nina b
- Adrian McEwen forHttpClient Library on which theArduinoHttpClient Library and thisEthernetWebServer library are relied.
- RQnet to report issueDecoding Error. two times called urlDecode in Parsing-impl.h. #17 leading to version v1.6.3 to fix the decoding error bug when using special
&in data fields.
![]() ⭐️⭐️ Ivan Grokhotkov | ![]() ⭐️ Adrian McEwen | ![]() ⭐️ Miguel Wisintainer | ![]() RQnet |
If you want to contribute to this project:
- Report bugs and errors
- Ask for enhancements
- Create issues and pull requests
- Tell other people about this library
- The library is licensed underMIT
Copyright (c) 2020- Khoi Hoang
About
This is simple yet complete WebServer library for AVR, Portenta_H7, Teensy, SAM DUE, SAMD, STM32, RP2040-based, etc. boards running WiFi modules/shields (WiFiNINA, CYW43439, U-Blox W101, W102, etc.). The functions are similar and compatible to ESP8266/ESP32 WebServer libraries to make life much easier to port sketches from ESP8266/ESP32. Now usi…
Topics
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.











