Skip to content

This is simple yet complete WebServer library for AVR, Portenta_H7, Teensy, SAM DUE, SAMD21/SAMD51, nRF52, STM32, RP2040-based, etc. boards running Ethernet shields. The functions are similar and compatible to ESP8266/ESP32 WebServer libraries to make life much easier to port sketches from ESP8266/ESP32. Coexisting now with `ESP32 WebServer` and…

License

Notifications You must be signed in to change notification settings

manmuqingshan/EthernetWebServer

 
 

Repository files navigation

EthernetWebServer

arduino-library-badge GitHub release GitHub contributions welcome GitHub issues

Donate to my libraries using BuyMeACoffee



Table of Contents



Important Breaking Change from v2.0.0

From v2.0.0, breaking changes were made to permit coexistence with ESP32 WebServer and ESP8266 ESP8266WebServer libraries.

The changes will affect only ESP32 and ESP8266 code.

Using ethernetHTTPUpload instead of HTTPUpload

If server using EthernetWebServer, then use ethernetHTTPUpload instead of HTTPUpload. HTTPUpload can be used only with server using WiFi WebServer or ESP8266WebServer

For example, in these examples, server is using EthernetWebServer

just change from

HTTPUpload& upload = server.upload();

to

ethernetHTTPUpload& upload = server.upload();

Please check these new examples to see how to use the new features

  1. WiFi_Ethernet_Complex_ESP32
  2. WiFi_Ethernet_Complex_ESP8266

Why do we need this EthernetWebServer library

Features

This EthernetWebServer library is a simple yet complete WebServer library for AVR, Portenta_H7, Teensy, SAM DUE, Arduino SAMD21, Adafruit SAMD21/SAMD51, Adafruit nRF52, ESP32/ESP8266, STM32, RP2040-based, etc. boards using Ethernet shields. The functions are similar and compatible to those of ESP32 WebServer and ESP8266WebServer libraries to make life much easier to port sketches from ESP8266/ESP32.

The RP2040-based boards, such as RASPBERRY_PI_PICO, are currently supported using Arduino-mbed RP2040 core or Earle Philhower's arduino-pico core.

This EthernetWebServer library, from v1.1.0, also provides high-level HTTP and WebSocket Client with the functions are similar and compatible to those of ArduinoHttpClient Library

The library provides these features:

  1. TCP Server and Client
  2. UDP Server and Client
  3. HTTP Server and Client
  4. HTTP GET and POST requests, provides argument parsing, handles one client at a time.
  5. High-level HTTP (GET, POST, PUT, PATCH, DELETE) and WebSocket Client. From v1.1.0.

Library is based on and modified from:

  1. Ivan Grokhotkov's ESP8266WebServer
  2. Ivan Grokhotkov's ESP32 WebServer
  3. ArduinoHttpClient Library

The EthernetWebServer class, found in EthernetWebServer.h header, is a simple WebServer class, knowing how to handle HTTP requests such as GET and POST and can only support one simultaneous client.

Currently supported Boards

This EthernetWebServer library currently supports these following boards:

  1. nRF52 boards, such as AdaFruit Feather nRF52832, nRF52840 Express, BlueFruit Sense, Itsy-Bitsy nRF52840 Express, Metro nRF52840 Express, NINA_B302_ublox, NINA_B112_ublox, etc.
  2. SAM DUE
  3. SAMD21
  • Arduino SAMD21: ZERO, MKRs, 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.
  1. SAMD51
  • Adafruit SAMD51 (M4): Metro M4, Grand Central M4, ItsyBitsy M4, Feather M4 Express, Trellis M4, Metro M4 AirLift Lite, MONSTER M4SK Express, Hallowing M4, etc.
  • Seeeduino: Wio Terminal, Grove UI Wireless
  1. Teensy (4.1, 4.0, 3.6, 3.5, 3,2, 3.1, 3.0, LC)

  2. AVR Mega1280, 2560, ADK.

  3. ESP32

  4. ESP8266

  5. RP2040-based boards, such as RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, using Arduino-mbed RP2040 core or Earle Philhower's arduino-pico core v1.3.1+.

  6. Portenta_H7

  7. Arduino UNO WiFi Rev2, AVR_NANO_EVERY, etc.

Currently supported Ethernet shields/modules

  1. W5x00 using Ethernet, EthernetLarge, Ethernet2 or Ethernet3 library

  2. ENC28J60 using EthernetENC or UIPEthernet library

  3. Teensy 4.1 built-in Ethernet using NativeEthernet library

  4. Teensy 4.1 built-in Ethernet using QNEthernet library

  5. Portenta_H7 Ethernet using Portenta_Ethernet library



Prerequisites

  1. Arduino IDE 1.8.19+ for Arduino. GitHub release
  2. Arduino AVR core 1.8.5+ for Arduino (Use Arduino Board Manager) AVR boards. GitHub release
  3. Teensy core v1.56+ for Teensy (4.1, 4.0, 3.6, 3.5, 3,2, 3.1, 3.0) boards.
  4. Arduino SAM DUE core v1.6.12+ for SAM DUE ARM Cortex-M3 boards.
  5. Arduino SAMD core 1.8.13+ for SAMD ARM Cortex-M0+ boards. GitHub release
  6. Adafruit SAMD core 1.7.9+ for SAMD ARM Cortex-M0+ and M4 boards (Nano 33 IoT, etc.). GitHub release
  7. Seeeduino SAMD core 1.8.2+ for SAMD21/SAMD51 boards (XIAO M0, Wio Terminal, etc.). Latest release
  8. 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. GitHub release
  9. ESP32 Core 2.0.2+ for ESP32-based boards. Latest release
  10. ESP8266 Core 3.0.2+ for ESP8266-based boards. Latest release. To use ESP8266 core 2.7.1+ for LittleFS.
  11. ArduinoCore-mbed mbed_rp2040, mbed_nano, mbed_portenta core 3.0.1+ for Arduino (Use Arduino Board Manager) Portenta_H7, RP2040-based boards, such as Nano_RP2040_Connect, RASPBERRY_PI_PICO. GitHub release
  12. Earle Philhower's arduino-pico core v1.13.1+ for RP2040-based boards such as RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, etc. GitHub release
  13. Arduino megaAVR core 1.8.7+ for Arduino megaAVR boards such as Arduino UNO WiFi Rev2, AVR_NANO_EVERY, etc.
  14. Functional-Vlpp library v1.0.2+ to use server's lambda function. To install. check arduino-library-badge
  15. Depending on which Ethernet card you're using:

Installation

Use Arduino Library Manager

The best and easiest way is to use Arduino Library Manager. Search for EthernetWebServer, then select / install the latest version. You can also use this link arduino-library-badge for more detailed instructions.

Manual Install

  1. Navigate to EthernetWebServer page.
  2. Download the latest release EthernetWebServer-master.zip.
  3. Extract the zip file to EthernetWebServer-master directory
  4. Copy the whole EthernetWebServer-master folder to Arduino libraries' directory such as ~/Arduino/libraries/.

VS Code & PlatformIO:

  1. Install VS Code
  2. Install PlatformIO
  3. Install EthernetWebServer library by using Library Manager. Search for EthernetWebServer in Platform.io Author's Libraries
  4. Use included platformio.ini file from examples to ensure that all dependent libraries will installed automatically. Please visit documentation for the other options and examples at Project Configuration File


Packages' Patches

1. For Adafruit nRF52840 and nRF52832 boards

To be able to compile, run and automatically detect and display BOARD_NAME on nRF52840/nRF52832 boards, you have to copy the whole nRF52 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.z These 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

2. For Teensy boards

To be able to compile and run on Teensy boards, you have to copy the files in Packages_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.zz These 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

3. For Arduino SAM DUE boards

To be able to compile and run on SAM DUE boards, you have to copy the whole SAM 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.zz This file must be copied into the directory:

  • ~/.arduino15/packages/arduino/hardware/sam/x.yy.zz/platform.txt

4. For Arduino SAMD boards

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 whole Arduino SAMD Packages_Patches directory into Arduino SAMD directory (~/.arduino15/packages/arduino/hardware/samd/1.8.13).

For core version v1.8.10+

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

For core version v1.8.9-

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 the notorious Arduino SAMD compiler error. See Improve 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 the Arduino.h file anymore.

5. For Adafruit SAMD boards

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 whole Adafruit SAMD Packages_Patches directory into Adafruit samd directory (~/.arduino15/packages/adafruit/hardware/samd/1.7.9).

Supposing the Adafruit SAMD core version is 1.7.9. This file must be copied into the directory:

  • ~/.arduino15/packages/adafruit/hardware/samd/1.7.9/platform.txt
  • ~/.arduino15/packages/adafruit/hardware/samd/1.7.9/cores/arduino/Print.h
  • ~/.arduino15/packages/adafruit/hardware/samd/1.7.9/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.zz This file 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

6. For Seeeduino SAMD boards

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 whole Seeeduino SAMD Packages_Patches directory into Seeeduino samd directory (~/.arduino15/packages/Seeeduino/hardware/samd/1.8.2).

Supposing the Seeeduino SAMD core version is 1.8.2. This file must be copied into the directory:

  • ~/.arduino15/packages/Seeeduino/hardware/samd/1.8.2/platform.txt
  • ~/.arduino15/packages/Seeeduino/hardware/samd/1.8.2/cores/arduino/Arduino.h
  • ~/.arduino15/packages/Seeeduino/hardware/samd/1.8.2/cores/arduino/Print.h
  • ~/.arduino15/packages/Seeeduino/hardware/samd/1.8.2/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.zz This file 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

7. For STM32 boards

7.1 For STM32 boards to use LAN8720

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 files stm32f4xx_hal_conf_default.h and stm32f7xx_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.h for STM32F4.
  • ~/.arduino15/packages/STM32/hardware/stm32/2.2.0/system/STM32F7xx/stm32f7xx_hal_conf_default.h for 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, theses 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

7.2 For STM32 boards to use Serial1

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 files STM32 variant.h into STM32 stm32 directory (~/.arduino15/packages/STM32/hardware/stm32/2.2.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.2.0. These files must be copied into the directory:

  • ~/.arduino15/packages/STM32/hardware/stm32/2.2.0/variants/STM32F7xx/F765Z(G-I)T_F767Z(G-I)T_F777ZIT/NUCLEO_F767ZI/variant.h for Nucleo-144 NUCLEO_F767ZI.
  • ~/.arduino15/packages/STM32/hardware/stm32/2.2.0/variants/STM32L0xx/L052R(6-8)T_L053R(6-8)T_L063R8T/NUCLEO_L053R8/variant.h for 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, theses 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 using Earle Philhower arduino-pico core

8.1 To use BOARD_NAME

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 file RP2040 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.zz This 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 PR Add -DBOARD_NAME="{build.board}" #136.

8.2 To avoid compile error relating to microsecondsToClockCycles

Some libraries, such as Adafruit 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 in RP2040 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.zz This 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 PR Add defs for compatibility #142.

9. For Portenta_H7 boards using Arduino IDE in Linux

To be able to upload firmware to Portenta_H7 using Arduino IDE in Linux (Ubuntu, etc.), you have to copy the file portenta_post_install.sh into mbed_portenta directory (~/.arduino15/packages/arduino/hardware/mbed_portenta/3.0.0/portenta_post_install.sh).

Then run the following command using sudo

$ cd ~/.arduino15/packages/arduino/hardware/mbed_portenta/3.0.0
$ chmod 755 portenta_post_install.sh
$ sudo ./portenta_post_install.sh

This will create the file /etc/udev/rules.d/49-portenta_h7.rules as follows:

# Portenta H7 bootloader mode UDEV rules

SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="035b", GROUP="plugdev", MODE="0666"

Supposing the ArduinoCore-mbed core version is 3.0.0. Now only one file must be copied into the directory:

  • ~/.arduino15/packages/arduino/hardware/mbed_portenta/3.0.0/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

10. For RTL8720DN boards using AmebaD core

To avoid compile error relating to PROGMEM, you have to copy the file Realtek AmebaD core pgmspace.h into Realtek AmebaD directory (~/.arduino15/packages/realtek/hardware/AmebaD/3.1.2/cores/arduino/avr/pgmspace.h).

Supposing the Realtek AmebaD core version is 3.1.2. This file must be copied into the directory:

  • ~/.arduino15/packages/realtek/hardware/AmebaD/3.1.2/cores/arduino/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.zz This file must be copied into the directory:

  • ~/.arduino15/packages/realtek/hardware/AmebaD/x.yy.zz/cores/arduino/avr/pgmspace.h

11. For SAMD21 and SAMD51 boards using ArduinoCore-fab-sam core

To avoid compile error relating to SAMD21/SAMD51, you have to copy the file ArduinoCore-fab-sam core pgmspace.h into ArduinoCore-fab-sam samd directory (~/.arduino15/packages/Fab_SAM_Arduino/hardware/samd/1.6.18-alpha2/boards.txt).

Supposing the ArduinoCore-fab-sam samd core version is 1.6.18-alpha2. This file must be copied into the directory:

  • ~/.arduino15/packages/Fab_SAM_Arduino/hardware/samd/1.6.18-alpha2/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.zz This file must be copied into the directory:

  • ~/.arduino15/packages/Fab_SAM_Arduino/hardware/samd/x.yy.zz/boards.txt


Libraries' Patches

1. For application requiring 2K+ HTML page

If your application requires 2K+ HTML page, the current Ethernet library must be modified if you are using W5200/W5500 Ethernet shields. W5100 is not supported for 2K+ buffer. If you use boards requiring different CS/SS pin for W5x00 Ethernet shield, for example ESP32, ESP8266, nRF52, etc., you also have to modify the following libraries to be able to specify the CS/SS pin correctly.

2. For Ethernet library

To fix Ethernet library, just copy these following files into the Ethernet library directory to overwrite the old files:

You can also use the forked and modified library at Patched Ethernet

3. For EthernetLarge library

To fix EthernetLarge library, just copy these following files into the EthernetLarge library directory to overwrite the old files:

You can also use the forked and modified library at Patched EthernetLarge

4. For Ethernet2 library

To fix Ethernet2 library, just copy these following files into the Ethernet2 library directory to overwrite the old files:

To add UDP Multicast support, necessary for the UPnP_Generic library:

You can also use the forked and modified library at Patched Ethernet2

5. For Ethernet3 library

  1. To fix Ethernet3 library, just copy these following files into the Ethernet3 library directory to overwrite the old files:

You can also use the forked and modified library at Patched Ethernet3

6. For UIPEthernet library

To be able to compile and run on nRF52 boards with ENC28J60 using UIPEthernet library, you have to copy these following files into the UIPEthernet utility directory to overwrite the old files:

7. For fixing ESP32 compile error

To fix ESP32 compile error, just copy the following file into the ESP32 cores/esp32 directory (e.g. ./arduino-1.8.19/hardware/espressif/cores/esp32) to overwrite the old file:

8. For fixing ESP8266 compile error

To fix ESP8266 compile error such as

error: 'class EthernetClass' has no member named 'init'
Ethernet.init (USE_THIS_SS_PIN);

just rename the following file in ./arduino-1.8.19/hardware/esp8266com/esp8266/libraries/Ethernet directory

  • From Ethernet.h to Ethernet_ESP8266.h


HOWTO Use analogRead() with ESP32 running WiFi and/or BlueTooth (BT/BLE)

Please have a look at ESP_WiFiManager Issue 39: Not able to read analog port when using the autoconnect example to have more detailed description and solution of the issue.

1. ESP32 has 2 ADCs, named ADC1 and ADC2

2. ESP32 ADCs functions

  • ADC1 controls ADC function for pins GPIO32-GPIO39
  • ADC2 controls ADC function for pins GPIO0, 2, 4, 12-15, 25-27

3.. ESP32 WiFi uses ADC2 for WiFi functions

Look in file adc_common.c

In ADC2, there're two locks used for different cases:

  1. lock shared with app and Wi-Fi: ESP32: When Wi-Fi using the ADC2, we assume it will never stop, so app checks the lock and returns immediately if failed. ESP32S2: The controller's control over the ADC is determined by the arbiter. There is no need to control by lock.

  2. lock shared between tasks: when several tasks sharing the ADC2, we want to guarantee all the requests will be handled. Since conversions are short (about 31us), app returns the lock very soon, we use a spinlock to stand there waiting to do conversions one by one.

adc2_spinlock should be acquired first, then adc2_wifi_lock or rtc_spinlock.

  • In order to use ADC2 for other functions, we have to acquire complicated firmware locks and very difficult to do
  • So, it's not advisable to use ADC2 with WiFi/BlueTooth (BT/BLE).
  • Use ADC1, and pins GPIO32-GPIO39
  • If somehow it's a must to use those pins serviced by ADC2 (GPIO0, 2, 4, 12, 13, 14, 15, 25, 26 and 27), use the fix mentioned at the end of ESP_WiFiManager Issue 39: Not able to read analog port when using the autoconnect example to work with ESP32 WiFi/BlueTooth (BT/BLE).


Configuration Notes

1. How to select which built-in Ethernet or shield to use

The easiest way is to use

#define USE_ETHERNET_WRAPPER    true

then select one and only one Ethernet library to use as follows:

  • Standard W5x00 Ethernet_Generic library is used by default, in the sketch, just be sure to comment out or leave these #defines to be false :
// Only one if the following to be true
#define USE_UIP_ETHERNET          false
#define USE_ETHERNET_PORTENTA_H7  false
#define USE_NATIVE_ETHERNET       false
#define USE_QN_ETHERNET           false
#define USE_ETHERNET_GENERIC      false
#define USE_ETHERNET_ESP8266      false 
#define USE_ETHERNET_ENC          false
#define USE_CUSTOM_ETHERNET       false

To use W5x00 Ethernet, for example using Ethernet_Generic library

// Only one if the following to be true
#define USE_UIP_ETHERNET          false
#define USE_ETHERNET_PORTENTA_H7  false
#define USE_NATIVE_ETHERNET       false
#define USE_QN_ETHERNET           false
#define USE_ETHERNET_GENERIC      true
#define USE_ETHERNET_ESP8266      false
#define USE_ETHERNET_ENC          false
#define USE_CUSTOM_ETHERNET       false
  • To use ENC28J60 Ethernet, using EthernetENC library (NEW and Better)
// Only one if the following to be true
#define USE_UIP_ETHERNET          false
#define USE_ETHERNET_PORTENTA_H7  false
#define USE_NATIVE_ETHERNET       false
#define USE_QN_ETHERNET           false
#define USE_ETHERNET_GENERIC      false
#define USE_ETHERNET_ESP8266      false
#define USE_ETHERNET_ENC          true
#define USE_CUSTOM_ETHERNET       false
  • To use ENC28J60 Ethernet, using UIPEthernet library:
// Only one if the following to be true
#define USE_UIP_ETHERNET          true
#define USE_ETHERNET_PORTENTA_H7  false
#define USE_NATIVE_ETHERNET       false
#define USE_QN_ETHERNET           false
#define USE_ETHERNET_GENERIC      false
#define USE_ETHERNET_ESP8266      false 
#define USE_ETHERNET_ENC          false
#define USE_CUSTOM_ETHERNET       false
  • To use another Ethernet library For example, EthernetLarge library
// Only one if the following to be true
#define USE_UIP_ETHERNET          false
#define USE_ETHERNET_PORTENTA_H7  false
#define USE_NATIVE_ETHERNET       false
#define USE_QN_ETHERNET           false
#define USE_ETHERNET_GENERIC      false
#define USE_ETHERNET_ESP8266      false 
#define USE_ETHERNET_ENC          false
#define USE_CUSTOM_ETHERNET       true

//Must be placed before #include <EthernetWebServer.h>
#include <EthernetLarge.h>
...

#include <EthernetWebServer.h>
  • Only for Teensy 4.1, to use NativeEthernet library
#if defined(__IMXRT1062__)
    // For Teensy 4.1/4.0
    #if defined(ARDUINO_TEENSY41)
      #define BOARD_TYPE      "TEENSY 4.1"
      // Use true for NativeEthernet Library, false if using other Ethernet libraries
      #define USE_NATIVE_ETHERNET     true
      #define USE_QN_ETHERNET         false
    #elif defined(ARDUINO_TEENSY40)
      #define BOARD_TYPE      "TEENSY 4.0"
    #else
      #define BOARD_TYPE      "TEENSY 4.x"
    #endif      
  #elif defined(__MK66FX1M0__)
  ....
  • Only for Teensy 4.1, to use another Ethernet library, for example Ethernet_Generic library
#if defined(__IMXRT1062__)
  // For Teensy 4.1/4.0
  #if defined(ARDUINO_TEENSY41)
    #define BOARD_TYPE      "TEENSY 4.1"
    // Use true for NativeEthernet Library, false if using other Ethernet libraries
    #define USE_NATIVE_ETHERNET     false
    #define USE_QN_ETHERNET         false
  #elif defined(ARDUINO_TEENSY40)
    #define BOARD_TYPE      "TEENSY 4.0"
  #else
    #define BOARD_TYPE      "TEENSY 4.x"
  #endif      
#elif defined(__MK66FX1M0__)
  ....
  
#define USE_UIP_ETHERNET        false

// Only one if the following to be true
#define USE_ETHERNET_GENERIC    true
#define USE_ETHERNET_ESP8266    false
#define USE_ETHERNET_ENC        false
#define USE_CUSTOM_ETHERNET     false  
  • Only for Teensy 4.1, to use QNEthernet library
#if ( defined(CORE_TEENSY) && defined(__IMXRT1062__) && defined(ARDUINO_TEENSY41) ) 
  // For Teensy 4.1
  #define BOARD_TYPE      "TEENSY 4.1"
  // Use true for NativeEthernet Library, false if using other Ethernet libraries
  #define USE_NATIVE_ETHERNET     false
  #define USE_QN_ETHERNET         true
#else
  #error Only Teensy 4.1 supported
#endif

#define USE_ETHERNET_WRAPPER    false

// Use true  for ENC28J60 and UIPEthernet library (https://github.com/UIPEthernet/UIPEthernet)
// Use false for W5x00 and Ethernetx library      (https://www.arduino.cc/en/Reference/Ethernet)

#define USE_UIP_ETHERNET        false
#define USE_ETHERNET_GENERIC    false
#define USE_ETHERNET_ESP8266    false 
#define USE_ETHERNET_ENC        false
#define USE_CUSTOM_ETHERNET     false

#if USE_NATIVE_ETHERNET
  #include "NativeEthernet.h"
  #warning Using NativeEthernet lib for Teensy 4.1. Must also use Teensy Packages Patch or error
  #define SHIELD_TYPE           "using NativeEthernet"
#elif USE_QN_ETHERNET
  #include "QNEthernet.h"
  using namespace qindesign::network;
  #warning Using QNEthernet lib for Teensy 4.1. Must also use Teensy Packages Patch or error
  #define SHIELD_TYPE           "using QNEthernet"  
#endif 

Important:

  • The Ethernet_Shield_W5200, EtherCard, EtherSia libraries are not supported. Don't use unless you know how to modify those libraries.
  • Requests to support for any future custom Ethernet library will be ignored. Use at your own risk.

2. How to select another CS/SS pin to use

The default CS/SS pin is GPIO4(D2) for ESP8266, GPIO22 for ESP32, 10 for all other boards.

If the default pin is not corect, the easiest way is to change is to use

#define USE_ETHERNET_WRAPPER    true

then select the CS/SS pin (e.g. 22) to use as follows:

// To override the default CS/SS pin. Don't use unless you know exactly which pin to use
#define USE_THIS_SS_PIN   22

3. How to use W5x00 with ESP8266

To avoid using the default but not-working Ethernet library of ESP8266, rename the Ethernet.h/cpp to Ethernet_ESP8266.h/cpp to avoid library conflict if you're using the Arduino Ethernet library. The Ethernet_Generic, Ethernet2, Ethernet3, EthernetLarge library can be used without conflict.

These pins are tested OK with ESP8266 and W5x00

  // For ESP8266
  // Pin                D0(GPIO16)    D1(GPIO5)    D2(GPIO4)    D3(GPIO0)    D4(GPIO2)    D8
  // Ethernet           0                 X            X            X            X        0
  // Ethernet2          X                 X            X            X            X        0
  // Ethernet3          X                 X            X            X            X        0
  // EthernetLarge      X                 X            X            X            X        0
  // Ethernet_ESP8266   0                 0            0            0            0        0
  // D2 is safe to used for Ethernet, Ethernet2, Ethernet3, EthernetLarge libs
  // Must use library patch for Ethernet, EthernetLarge libraries
  //Ethernet.setCsPin (USE_THIS_SS_PIN);
  Ethernet.init (USE_THIS_SS_PIN);

4. How to increase W5x00 TX/RX buffer

  • For Ethernet_Generic library only, simply use as follows to have large buffer similar to EthernetLarge library
#define ETHERNET_LARGE_BUFFERS
  • For Ethernet3 library only, use as follows
  // Use  MAX_SOCK_NUM = 4 for 4K, 2 for 8K, 1 for 16K RX/TX buffer
  #ifndef ETHERNET3_MAX_SOCK_NUM
    #define ETHERNET3_MAX_SOCK_NUM      4
  #endif
  
  Ethernet.setCsPin (USE_THIS_SS_PIN);
  Ethernet.init (ETHERNET3_MAX_SOCK_NUM);

5. How to adjust sendContent_P() and send_P() buffer size

sendContent_P() and send_P() buffer size is set default at 4 Kbytes, and minimum is 256 bytes. If you need to change, just add a definition, e.g.:

#define SENDCONTENT_P_BUFFER_SZ     2048

Note that the buffer size must be larger than 256 bytes. See Sending GZIP HTML ~ 120kb+ (suggested enhancement).

6. How to use SPI2 for ESP32 using W5x00 and Ethernet_Generic Library

  • For Ethernet_Generic library only, simply use as follows to SPI2 for ESP32
#define USING_SPI2                          true


Usage

Init the CS/SS pin if use EthernetWrapper

EthernetInit();

Class Constructor

  EthernetWebServer server(80);

Creates the EthernetWebServer class object.

Parameters:

host port number: int port (default is the standard HTTP port 80)

Basic Operations

Starting the server

  void begin();

Handling incoming client requests

  void handleClient();

Disabling the server

  void close();
  void stop();

Both methods function the same

Client request handlers

  void on();
  void addHandler();
  void onNotFound();
  void onFileUpload();	

Example:

  server.on("/", handlerFunction);
  server.onNotFound(handlerFunction);   // called when handler is not assigned
  server.onFileUpload(handlerFunction); // handle file uploads

Sending responses to the client

  void send();
  void send_P();

Parameters:

code - HTTP response code, can be 200 or 404, etc.

content_type - HTTP content type, like "text/plain" or "image/png", etc.

content - actual content body

Advanced Options

Getting information about request arguments

  const String & arg();
  const String & argName();
  int args();
  bool hasArg();

Function usage:

arg - get request argument value, use arg("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();
  int headers();
  bool hasHeader();

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

  bool authenticate();
  void requestAuthentication();

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();
  }

Other Function Calls

  const String & uri(); // get the current uri
  HTTPMethod  method(); // get the current method 
  WiFiClient client(); // get the current client
  HTTPUpload & upload(); // get the current upload
  void setContentLength(); // set content length
  void sendHeader(); // send HTTP header
  void sendContent(); // send content
  void sendContent_P(); 
  void collectHeaders(); // set the request headers to collect
  void serveStatic();
  size_t streamFile();


Examples:

Original Examples

  1. AdvancedWebServer
  2. SimpleWebServer_NativeEthernet
  3. HelloServer
  4. HelloServer2
  5. HttpBasicAuth
  6. MQTTClient_Auth
  7. MQTTClient_Basic
  8. MQTT_ThingStream
  9. PostServer
  10. SimpleAuthentication
  11. UdpNTPClient
  12. UdpSendReceive
  13. WebClient
  14. WebClient_ESP
  15. WebClientRepeating
  16. WebClientRepeating_ESP
  17. WebServer
  18. WebServer_NativeEthernet
  19. ESP32_FS_EthernetWebServer.
  20. FS_EthernetWebServer.
  21. serveStatic.
  22. serveStaticLoadFile.
  23. AdvancedWebServer_Ptr. New

HTTP and WebSocket Client New Examples

  1. BasicAuthGet
  2. CustomHeader
  3. DweetGet
  4. DweetPost
  5. HueBlink
  6. node_test_server
  7. PostWithHeaders
  8. SimpleDelete
  9. SimpleGet
  10. SimpleHTTPExample
  11. SimplePost
  12. SimplePut
  13. SimpleWebSocket

New Examples for Teensy 4.1 QNEthernet

  1. AdvancedWebServer
  2. MQTTClient_Auth
  3. MQTTClient_Basic
  4. MQTT_ThingStream

New Examples for ESP32 and ESP8266 using with WebServer or ESP8266WebServer

  1. WiFi_Ethernet_Complex_ESP32
  2. WiFi_Ethernet_Complex_ESP8266

New Examples for ESP32 using SPI2

  1. AdvancedWebServer_ESP32_SPI2 New


https://github.com/khoih-prog/EthernetWebServer/blob/e5456c1d3e1cbd36b7a138381a884314626bff01/examples/AdvancedWebServer/AdvancedWebServer.ino#L44-L451


2. File defines.h

https://github.com/khoih-prog/EthernetWebServer/blob/e5456c1d3e1cbd36b7a138381a884314626bff01/examples/AdvancedWebServer/defines.h#L10-L474



Debug Terminal Output Samples

1. AdvancedWebServer on NRF52840_FEATHER_EXPRESS with ENC28J60 using EthernetENC Library

The following are debug terminal output and screen shot when running example AdvancedWebServer on Adafruit NRF52840_FEATHER_EXPRESS with ENC28J60 using EthernetENC Library

Starting AdvancedWebServer on NRF52840_FEATHER with ENC28J60 using EthernetENC Library
EthernetWebServer v2.1.1
[EWS] =========================
[EWS] Default SPI pinout:
[EWS] MOSI: 25
[EWS] MISO: 24
[EWS] SCK: 26
[EWS] SS: 5
[EWS] =========================
[EWS] Board : NRF52840_FEATHER , setCsPin: 10
=========================
Currently Used SPI pinout:
MOSI:25
MISO:24
SCK:26
SS:5
=========================
Using mac index = 11
Connected! IP address: 192.168.2.96
HTTP EthernetWebServer is @ IP : 192.168.2.96
EthernetWebServer::handleClient: New Client
method:  GET
url:  /
search:
headerName: Host
headerValue: 192.168.2.113
headerName: Connection
headerValue: keep-alive
headerName: DNT
headerValue: 1
headerName: Upgrade-Insecure-Requests
headerValue: 1
headerName: User-Agent
headerValue: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36
headerName: Accept
headerValue: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
headerName: Accept-Encoding
headerValue: gzip, deflate
headerName: Accept-Language
headerValue: en-GB,en-US;q=0.9,en;q=0.8
args:
args count:  0
args:
args count:  0
Request: /
Arguments: 
Final list of key/value pairs:
EthernetWebServer::_handleRequest handle
EthernetWebServer::send1: len =  347
content =  <html><head><meta http-equiv='refresh' content='5'/><title>NRF52840_FEATHER</title><style>body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }</style></head><body><h2>Hello from NRF52840_FEATHER</h2><h3>running EthernetWebServer</h3><p>Uptime: 0 d 00:00:11</p><img src="/test.svg" /></body></html>
EthernetWebServer::_prepareHeader sendHeader Conn close
EthernetWebServer::send1: write header =  HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 347
Connection: close


EthernetWebServer::sendContent: Client.write content:  <html><head><meta http-equiv='refresh' content='5'/><title>AdvancedWebServer NRF52840_FEATHER</title><style>body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }</style></head><body><h2>Hi from EthernetWebServer!</h2><h3>on NRF52840_FEATHER</h3><p>Uptime: 0 d 00:00:11</p><img src="/test.svg" /></body></html>
EthernetWebServer::_handleRequest OK
EthernetWebServer::handleClient: Client disconnected
EthernetWebServer::handleClient: Don't keepCurrentClient
EthernetWebServer::handleClient: Client disconnected
EthernetWebServer::handleClient: New Client
method:  GET
url:  /test.svg
search:
headerName: Host
headerValue: 192.168.2.113
headerName: Connection
headerValue: keep-alive
headerName: User-Agent
headerValue: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36
headerName: DNT
headerValue: 1
headerName: Accept
headerValue: image/webp,image/apng,image/*,*/*;q=0.8
headerName: Referer
headerValue: http://192.168.2.113/
headerName: Accept-Encoding
headerValue: gzip, deflate
headerName: Accept-Language
headerValue: en-GB,en-US;q=0.9,en;q=0.8
args:
args count:  0
args:
args count:  0
Request: /test.svg
Arguments: 
Final list of key/value pairs:
EthernetWebServer::_handleRequest handle
EthernetWebServer::send1: len =  1950
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="98" x2="20" y2="111" stroke-width="2" />
<line x1="20" y1="111" x2="30" y2="90" stroke-width="2" />
<line x1="30" y1="90" x2="40" y2="22" stroke-width="2" />
<line x1="40" y1="22" x2="50" y2="98" stroke-width="2" />
<line x1="50" y1="98" x2="60" y2="64" stroke-width="2" />
<line x1="60" y1="64" x2="70" y2="104" stroke-width="2" />
<line x1="70" y1="104" x2="80" y2="31" stroke-width="2" />
<line x1="80" y1="31" x2="90" y2="59" stroke-width="2" />
<line x1="90" y1="59" x2="100" y2="139" stroke-width="2" />
<line x1="100" y1="139" x2="110" y2="117" stroke-width="2" />
<line x1="110" y1="117" x2="120" y2="75" stroke-width="2" />
<line x1="120" y1="75" x2="130" y2="72" stroke-width="2" />
<line x1="130" y1="72" x2="140" y2="137" stroke-width="2" />
<line x1="140" y1="137" x2="150" y2="20" stroke-width="2" />
<line x1="150" y1="20" x2="160" y2="94" stroke-width="2" />
<line x1="160" y1="94" x2="170" y2="81" stroke-width="2" />
<line x1="170" y1="81" x2="180" y2="38" stroke-width="2" />
<line x1="180" y1="38" x2="190" y2="33" stroke-width="2" />
<line x1="190" y1="33" x2="200" y2="53" stroke-width="2" />
<line x1="200" y1="53" x2="210" y2="88" stroke-width="2" />
<line x1="210" y1="88" x2="220" y2="32" stroke-width="2" />
<line x1="220" y1="32" x2="230" y2="110" stroke-width="2" />
<line x1="230" y1="110" x2="240" y2="87" stroke-width="2" />
<line x1="240" y1="87" x2="250" y2="11" stroke-width="2" />
<line x1="250" y1="11" x2="260" y2="98" stroke-width="2" />
<line x1="260" y1="98" x2="270" y2="76" stroke-width="2" />
<line x1="270" y1="76" x2="280" y2="121" stroke-width="2" />
<line x1="280" y1="121" x2="290" y2="139" stroke-width="2" />
<line x1="290" y1="139" x2="300" y2="103" stroke-width="2" />
</g>
</svg>

EthernetWebServer::_prepareHeader sendHeader Conn close
EthernetWebServer::send1: write header =  HTTP/1.1 200 OK
Content-Type: image/svg+xml
Content-Length: 1950
Connection: close

2. ENC28J60_WM_Config on ESP32 with ENC28J60 using UIPEthernet Library

The terminal output of ESP32 running a ENC28J60_WM_Config example of BlynkEthernet_WM Library

Start ENC28J60_WM_Config on ESP32
[38] EEPROMsz:1024
[38] CCSum=0x29f2,RCSum=0x29f2
[38] CrCCsum=0,CrRCsum=0
[38] Hdr=ENC28J60,BName=ESP32-ENC28J60-WM
[38] Svr=account.duckdns.org,Tok=token
[45] Svr1=account.ddns.net,Tok1=token1
[51] Prt=8080,SIP=blank
[53] MAC:FE-80-D6-B4-FC-EE
ENC28J60_CONTROL_CS =13
SS =5
SPI_MOSI =23
SPI_MISO =19
SPI_SCK =18
[5332] IP:192.168.2.103
[5332] bg:ECon.TryB
[5332] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.6.1 on ESP32

[5343] BlynkArduinoClient.connect: Connecting to account.duckdns.org:8080
[6454] Ready (ping: 37ms).
[6522] Connected to Blynk Server = account.duckdns.org, Token = token
[6522] bg:EBCon
Conn2Blynk: server = account.duckdns.org, port = 8080
Token = token, IP = 192.168.2.103
BBBBBBBBBB BBBBBBBBBB BBBBBBBBBB

3. SimpleWebSocket on SAM DUE with W5x00 using Ethernet_Generic Library

The terminal output of SAM DUE with W5x00 using Ethernet_Generic Library running SimpleWebSocket example to demonstrate newly-added WebSocket Client feature.

Starting SimpleWebSocket on SAM DUE with W5x00 using Ethernet_Generic Library
EthernetWebServer v2.1.1
[EWS] =========== USE_ETHERNET_GENERIC ===========
[EWS] Default SPI pinout:
[EWS] MOSI: 75
[EWS] MISO: 74
[EWS] SCK: 76
[EWS] SS: 10
[EWS] =========================
[EWS] Board : SAM DUE , setCsPin: 10
_pinCS = 0
W5100 init, using SS_PIN_DEFAULT = 10, new ss_pin = 10, W5100Class::ss_pin = 10
W5100::init: W5100, SSIZE =4096
=========================
Currently Used SPI pinout:
MOSI:75
MISO:74
SCK:76
SS:10
=========================
Using mac index = 5
Connected! IP address: 192.168.2.81
starting WebSocket client
Connection failed
disconnected
starting WebSocket client
Connected
Sending Hello 0
Sending Hello 1
Received a message:
0 => Hello from SimpleWebSocket on SAM DUE, millis = 6906
Sending Hello 2
Received a message:
1 => Hello from SimpleWebSocket on SAM DUE, millis = 11907
Sending Hello 3
Received a message:
2 => Hello from SimpleWebSocket on SAM DUE, millis = 16909
Sending Hello 4
Received a message:
3 => Hello from SimpleWebSocket on SAM DUE, millis = 21911
Sending Hello 5
Received a message:
4 => Hello from SimpleWebSocket on SAM DUE, millis = 26913
Sending Hello 6
Received a message:
5 => Hello from SimpleWebSocket on SAM DUE, millis = 31915
Sending Hello 7
Received a message:
6 => Hello from SimpleWebSocket on SAM DUE, millis = 36917
Sending Hello 8
Received a message:
7 => Hello from SimpleWebSocket on SAM DUE, millis = 41919
Sending Hello 9
Received a message:
8 => Hello from SimpleWebSocket on SAM DUE, millis = 46921
Sending Hello 10
Received a message:
9 => Hello from SimpleWebSocket on SAM DUE, millis = 51923
Sending Hello 11
Received a message:
10 => Hello from SimpleWebSocket on SAM DUE, millis = 56925
Sending Hello 12
Received a message:
11 => Hello from SimpleWebSocket on SAM DUE, millis = 61927
Sending Hello 13
Received a message:
12 => Hello from SimpleWebSocket on SAM DUE, millis = 66929
Sending Hello 14
Received a message:
13 => Hello from SimpleWebSocket on SAM DUE, millis = 71931
Sending Hello 15
Received a message:
14 => Hello from SimpleWebSocket on SAM DUE, millis = 76933
Sending Hello 16
Received a message:
15 => Hello from SimpleWebSocket on SAM DUE, millis = 81935
Sending Hello 17
Received a message:
16 => Hello from SimpleWebSocket on SAM DUE, millis = 86937
Sending Hello 18
Received a message:
17 => Hello from SimpleWebSocket on SAM DUE, millis = 91939

4. DweetPost on NRF52840_FEATHER with W5x00 using Ethernet_Generic Library

The terminal output of NRF52840_FEATHER with W5x00 using Ethernet_Generic Library running DweetPost example to demonstrate newly-added high-level HTTP Client feature.

Starting DweetPost on NRF52840_FEATHER with W5x00 using Ethernet_Generic Library
EthernetWebServer v2.1.1
[EWS] =========== USE_ETHERNET_GENERIC ===========
[EWS] Default SPI pinout:
[EWS] MOSI: 25
[EWS] MISO: 24
[EWS] SCK: 26
[EWS] SS: 5
[EWS] =========================
[EWS] Board : NRF52840_FEATHER , setCsPin: 10
=========================
Currently Used SPI pinout:
MOSI:25
MISO:24
SCK:26
SS:5
SPI_CS:10
=========================
Using mac index = 17
Connected! IP address: 192.168.2.80
making POST request
Status code: 200
Response: {"this":"succeeded","by":"dweeting","the":"dweet","with":{"thing":"scandalous-cheese-hoarder","created":"2020-11-17T05:10:59.175Z","content":{"sensorValue":40},"transaction":"08ae7c04-f1e5-4411-ad05-eb4afe77a6b4"}}
Wait ten seconds

5. ESP32_FS_EthernetWebServer on ESP32 using LittleFS with W5x00 using Ethernet_Generic Library

The terminal output of ESP32 with W5x00 using Ethernet_Generic Library running ESP32_FS_EthernetWebServer example to demonstrate newly-added WebServer serving from LittleFS/SPIFFS

Starting ESP32_FS_EthernetWebServer on ESP32 using LittleFS
With W5x00 using Ethernet_Generic Library on SPI
EthernetWebServer v2.1.1
[EWS] =========== USE_ETHERNET_GENERIC ===========
[EWS] Default SPI pinout:
[EWS] MOSI: 23
[EWS] MISO: 19
[EWS] SCK: 18
[EWS] SS: 5
[EWS] =========================
[EWS] ESP32 setCsPin: 5
=========================
Currently Used SPI pinout:
MOSI:23
MISO:19
SCK:18
SS:5
=========================
Connected! IP address: 192.168.2.139
FS File: /CanadaFlag_1.png, size: 40.25KB
FS File: /CanadaFlag_2.png, size: 8.12KB
FS File: /CanadaFlag_3.jpg, size: 10.89KB
FS File: /edit.htm.gz, size: 4.02KB
FS File: /favicon.ico, size: 1.12KB
FS File: /graphs.js.gz, size: 1.92KB
FS File: /index.htm, size: 3.63KB

HTTP server started @192.168.2.139
Open http://192.168.2.139/edit to see the file browser
handleFileRead: /edit.htm
handleFileRead: /index.htm
handleFileRead: /favicon.ico

and the screen shot of the WebServer


6. FS_EthernetWebServer on ESP8266 using LittleFS with W5x00 using Ethernet_Generic Library

The terminal output of ESP8266 with W5x00 using Ethernet_Generic Library running FS_EthernetWebServer example to demonstrate newly-added WebServer serving from LittleFS/SPIFFS

Starting FS_EthernetWebServer on ESP8266 using LittleFS
With W5x00 using Ethernet_Generic Library
EthernetWebServer v2.1.1
[EWS] =========== USE_ETHERNET_GENERIC ===========
[EWS] Default SPI pinout:
[EWS] MOSI: 13
[EWS] MISO: 12
[EWS] SCK: 14
[EWS] SS: 15
[EWS] =========================
[EWS] ESP8266 setCsPin: 4
=========================
Currently Used SPI pinout:
MOSI:13
MISO:12
SCK:14
SS:15
=========================
Connected! IP address: 192.168.2.139
Opening / directory
FS File: CanadaFlag_1.png, size: 40.25KB
FS File: CanadaFlag_2.png, size: 8.12KB
FS File: CanadaFlag_3.jpg, size: 10.89KB
FS File: edit.htm.gz, size: 4.02KB
FS File: favicon.ico, size: 1.12KB
FS File: graphs.js.gz, size: 1.92KB
FS File: index.htm, size: 3.63KB
FS File: page1.html, size: 1.16KB
FS File: page1.htm, size: 1.16KB
FS File: page2.html, size: 1.16KB
FS File: page3.html, size: 1.16KB


HTTP server started @192.168.2.139
Open http://192.168.2.139/edit to see the file browser
handleFileRead: /edit.htm
handleFileRead: /index.htm
handleFileRead: /favicon.ico

and the screen shot of the WebServer


7. serveStatic on ESP8266 using LittleFS with W5x00 using Ethernet_Generic Library

The terminal output of ESP8266 with W5x00 using Ethernet_Generic Library running serveStatic example to demonstrate newly-added WebServer serving from LittleFS/SPIFFS

Starting serveStatic demoing 'serveStatic' function on ESP8266 using LittleFS
With W5x00 using Ethernet_Generic Library
EthernetWebServer v2.1.1
[EWS] =========== USE_ETHERNET_GENERIC ===========
[EWS] Default SPI pinout:
[EWS] MOSI: 13
[EWS] MISO: 12
[EWS] SCK: 14
[EWS] SS: 15
[EWS] =========================
[EWS] ESP8266 setCsPin: 4
=========================
Currently Used SPI pinout:
MOSI:13
MISO:12
SCK:14
SS:15
=========================
Connected! IP address: 192.168.2.133
HTTP server started

and the screen shot of the WebServer


8. SimpleWebServer_NativeEthernet on Teensy 4.1 with NativeEthernet library

The following are debug terminal output and screen shot when running example SimpleWebServer_NativeEthernet on Teensy 4.1 with NativeEthernet library

SimpleWebServer_NativeEthernet on Teensy 4.1 with NativeEthernet
EthernetWebServer v2.1.1
Debug Level = 3
Connected! IP address: 192.168.2.127
[EWS] <html><head><meta http-equiv='refresh' content='5'/><title>AdvancedWebServer Teensy 4.1 with NativeEthernet</title><style>body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }</style></head><body><h2>Hi from EthernetWebServer!</h2><h3>on Teensy 4.1 with NativeEthernet</h3><p>Uptime: 0 d 00:00:05</p></body></html>
========================================
[EWS] <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>

========================================

9. AdvancedWebServer on MBED RASPBERRY_PI_PICO with W5x00 using Ethernet_Generic Library

The following are debug terminal output and screen shot when running example AdvancedWebServer on RASPBERRY_PI_PICO with W5x00 using Ethernet_Generic Library and Arduino-mbed RP2040 core

Starting AdvancedWebServer on MBED RASPBERRY_PI_PICO with W5x00 using Ethernet_Generic Library
EthernetWebServer v2.1.1
[EWS] =========== USE_ETHERNET_GENERIC ===========
[EWS] Default SPI pinout:
[EWS] MOSI: 19
[EWS] MISO: 16
[EWS] SCK: 18
[EWS] SS: 17
[EWS] =========================
[EWS] RPIPICO setCsPin: 17
=========================
Currently Used SPI pinout:
MOSI:19
MISO:16
SCK:18
SS:17
=========================
Using mac index = 19
Connected! IP address: 192.168.2.95
HTTP EthernetWebServer is @ IP : 192.168.2.95
.[EWS] String Len = 0, extend to 2048
..

10. MQTTClient_Auth on MBED RASPBERRY_PI_PICO with W5x00 using Ethernet_Generic Library

The following are debug terminal output when running example MQTTClient_Auth on RASPBERRY_PI_PICO with W5x00 using Ethernet_Generic Library and Arduino-mbed RP2040 core

Start MQTTClient_Auth on MBED RASPBERRY_PI_PICO with W5x00 using Ethernet_Generic Library
EthernetWebServer v2.1.1
[EWS] =========== USE_ETHERNET_GENERIC ===========
[EWS] Default SPI pinout:
[EWS] MOSI: 19
[EWS] MISO: 16
[EWS] SCK: 18
[EWS] SS: 17
[EWS] =========================
[EWS] RPIPICO setCsPin: 17
=========================
Currently Used SPI pinout:
MOSI:19
MISO:16
SCK:18
SS:17
=========================
Using mac index = 10
Connected! IP address: 192.168.2.94
Attempting MQTT connection to broker.emqx.io...connected
Message Send : MQTT_Pub => Hello from MQTTClient_Auth on MBED RASPBERRY_PI_PICO with W5x00 using Ethernet_Generic Library
Message arrived [MQTT_Pub] Hello from MQTTClient_Auth on MBED RASPBERRY_PI_PICO with W5x00 using Ethernet_Generic Library

11. AdvancedWebServer on RASPBERRY_PI_PICO with W5x00 using Ethernet_Generic Library

The following are debug terminal output and screen shot when running example AdvancedWebServer on RASPBERRY_PI_PICO with W5x00 using Ethernet_Generic Library and Earle Philhower's arduino-pico core

Starting AdvancedWebServer on RASPBERRY_PI_PICO with W5x00 using Ethernet_Generic Library
EthernetWebServer v2.1.1
[EWS] =========== USE_ETHERNET_GENERIC ===========
[EWS] Default SPI pinout:
[EWS] MOSI: 19
[EWS] MISO: 16
[EWS] SCK: 18
[EWS] SS: 17
[EWS] =========================
[EWS] RPIPICO setCsPin: 17
=========================
Currently Used SPI pinout:
MOSI:19
MISO:16
SCK:18
SS:17
=========================
Using mac index = 7
Connected! IP address: 192.168.2.117
HTTP EthernetWebServer is @ IP : 192.168.2.117
.......... .......... .......... .......... .......... ..

12. UdpNTPClient on RASPBERRY_PI_PICO with W5x00 using Ethernet_Generic Library

The following are debug terminal output and screen shot when running example UdpNTPClient on RASPBERRY_PI_PICO with W5x00 using Ethernet_Generic Library and Earle Philhower's arduino-pico core

Start UdpNTPClient on RASPBERRY_PI_PICO with W5x00 using Ethernet_Generic Library
EthernetWebServer v2.1.1
[EWS] =========== USE_ETHERNET_GENERIC ===========
[EWS] Default SPI pinout:
[EWS] MOSI: 19
[EWS] MISO: 16
[EWS] SCK: 18
[EWS] SS: 17
[EWS] =========================
[EWS] RPIPICO setCsPin: 17
=========================
Currently Used SPI pinout:
MOSI:19
MISO:16
SCK:18
SS:17
=========================
Using mac index = 18
You're connected to the network, IP = 192.168.2.106
UDP Packet received, size 48
From 128.138.140.44, port 123
Seconds since Jan 1 1900 = 3830118654
Unix time = 1621129854
The UTC time is 1:50:54
UDP Packet received, size 48
From 128.138.140.44, port 123
Seconds since Jan 1 1900 = 3830118666
Unix time = 1621129866
The UTC time is 1:51:06

13. AdvancedWebServer on Teensy 4.1 using NativeEthernet Library

The following are debug terminal output and screen shot when running example AdvancedWebServer on Teensy 4.1 using NativeEthernet Library

Starting AdvancedWebServer on TEENSY 4.1 using QNEthernet
EthernetWebServer v2.1.1
[EWS] =========== USE_QN_ETHERNET ===========
Initialize Ethernet using static IP => IP Address = 192.168.2.222
HTTP EthernetWebServer is @ IP : 192.168.2.222
.[EWS] String Len = 0, extend to 2048
..........

14. AdvancedWebServer on Teensy 4.1 using QNEthernet Library

The following are debug terminal output and screen shot when running example AdvancedWebServer on Teensy 4.1 using QNEthernet Library

Starting AdvancedWebServer on TEENSY 4.1 using QNEthernet
EthernetWebServer v2.1.1
[EWS] =========== USE_QN_ETHERNET ===========
Initialize Ethernet using static IP => IP Address = 192.168.2.222
HTTP EthernetWebServer is @ IP : 192.168.2.222
.[EWS] String Len = 0, extend to 2048
......... .......... .......... .......... .......... .......... .......... ..........
.......... .......... ......

15. MQTTClient_Auth on TEENSY 4.1 using QNEthernet Library

The following is the debug terminal output when running example MQTTClient_Auth on Teensy 4.1 using QNEthernet Library

Start MQTTClient_Auth on TEENSY 4.1 using QNEthernet
EthernetWebServer v2.1.1
[EWS] =========== USE_QN_ETHERNET ===========
Initialize Ethernet using static IP => IP Address = 192.168.2.222
Attempting MQTT connection to broker.emqx.io...connected
Message Send : MQTT_Pub => Hello from MQTTClient_Auth on TEENSY 4.1 using QNEthernet
Message arrived [MQTT_Pub] Hello from MQTTClient_Auth on TEENSY 4.1 using QNEthernet
Message Send : MQTT_Pub => Hello from MQTTClient_Auth on TEENSY 4.1 using QNEthernet
Message arrived [MQTT_Pub] Hello from MQTTClient_Auth on TEENSY 4.1 using QNEthernet

16. AdvancedWebServer on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library

The following are debug terminal output and screen shot when running example AdvancedWebServer on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library

Starting AdvancedWebServer on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
EthernetWebServer v2.1.1
[EWS] ======== USE_PORTENTA_H7_ETHERNET ========
Using mac index = 6
Connected! IP address: 192.168.2.222
HTTP EthernetWebServer is @ IP : 192.168.2.222
.[EWS] String Len = 0, extend to 2048
.......... .......... .......... .......... .......... ..

17. SimpleWebSocket on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library

The following is the debug terminal output when running example MQTTClient_Auth on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library

17.1 Client
Starting SimpleWebSocket on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
EthernetWebServer v2.1.1
[EWS] ======== USE_PORTENTA_H7_ETHERNET ========
Using mac index = 4
Connected! IP address: 192.168.2.132
starting WebSocket client
Sending Hello 0
Sending Hello 1
Received a message:
0 => Hello from SimpleWebSocket on PORTENTA_H7_M7, millis = 5022
Sending Hello 2
Received a message:
1 => Hello from SimpleWebSocket on PORTENTA_H7_M7, millis = 10075
Sending Hello 3
Received a message:
2 => Hello from SimpleWebSocket on PORTENTA_H7_M7, millis = 15132
Sending Hello 4
Received a message:
3 => Hello from SimpleWebSocket on PORTENTA_H7_M7, millis = 20145
Sending Hello 5
Received a message:
4 => Hello from SimpleWebSocket on PORTENTA_H7_M7, millis = 25152
17.2 Server
kh@kh-Inspiron-3593:~/Downloads/Nodejs/simple-websocket-server$ ./WS_server.sh 
Wed Sep 08 2021 21:30:46 GMT-0400 (Eastern Daylight Time) Server is listening on port 8080
Wed Sep 08 2021 21:31:08 GMT-0400 (Eastern Daylight Time) Connection accepted.
Received Message: 0 => Hello from SimpleWebSocket on PORTENTA_H7_M7, millis = 5022
Received Message: 1 => Hello from SimpleWebSocket on PORTENTA_H7_M7, millis = 10075
Received Message: 2 => Hello from SimpleWebSocket on PORTENTA_H7_M7, millis = 15132
Received Message: 3 => Hello from SimpleWebSocket on PORTENTA_H7_M7, millis = 20145
Received Message: 4 => Hello from SimpleWebSocket on PORTENTA_H7_M7, millis = 25152
Received Message: 5 => Hello from SimpleWebSocket on PORTENTA_H7_M7, millis = 30248
Received Message: 6 => Hello from SimpleWebSocket on PORTENTA_H7_M7, millis = 35256

18. MQTTClient_Auth on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library

The following is the debug terminal output when running example MQTTClient_Auth on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library

Start MQTTClient_Auth on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
EthernetWebServer v2.1.1
[EWS] ======== USE_PORTENTA_H7_ETHERNET ========
Using mac index = 7
Connected! IP address: 192.168.2.132
Attempting MQTT connection to broker.emqx.io...connected
Message Send : MQTT_Pub => Hello from MQTTClient_Auth on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
Message arrived [MQTT_Pub] Hello from MQTTClient_Auth on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
Message Send : MQTT_Pub => Hello from MQTTClient_Auth on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
Message arrived [MQTT_Pub] Hello from MQTTClient_Auth on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
Message Send : MQTT_Pub => Hello from MQTTClient_Auth on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
Message arrived [MQTT_Pub] Hello from MQTTClient_Auth on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
Message Send : MQTT_Pub => Hello from MQTTClient_Auth on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
Message arrived [MQTT_Pub] Hello from MQTTClient_Auth on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
Message Send : MQTT_Pub => Hello from MQTTClient_Auth on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
Message arrived [MQTT_Pub] Hello from MQTTClient_Auth on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
Message Send : MQTT_Pub => Hello from MQTTClient_Auth on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
Message arrived [MQTT_Pub] Hello from MQTTClient_Auth on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library

19. WiFi_Ethernet_Complex_ESP32 on ESP32_DEV

The following are debug terminal output when running example WiFi_Ethernet_Complex_ESP32 on ESP32_DEV using both EthernetWebServer and WebServer Library simultaneously.

Starting WiFi_Ethernet_Complex_ESP32 on ESP32_DEV
Connecting to HueNet1
.......
WiFi connected
IP address: 
192.168.2.105
[EWS] ESP32 setCsPin: 22
_pinCS = 0
W5100 init, using SS_PIN_DEFAULT = 22, new ss_pin = 10, W5100Class::ss_pin = 22
W5100::init: W5500, SSIZE =8192
HTTP EthernetWebServer is @ IP : 192.168.2.114
HTTP WiFiWebServer is @ IP : 192.168.2.105

20. WiFi_Ethernet_Complex_ESP8266 on ESP8266_NODEMCU_ESP12E

The following are debug terminal output when running example WiFi_Ethernet_Complex_ESP8266 on ESP8266_NODEMCU_ESP12E using both EthernetWebServer and WebServer Library simultaneously.

Starting WiFi_Ethernet_Complex_ESP8266 on ESP8266_NODEMCU_ESP12E
Connecting to HueNet1
...........
WiFi connected
IP address: 
192.168.2.109
[EWS] ESP8266 setCsPin: 4
=========================
Currently Used SPI pinout:
MOSI:13
MISO:12
SCK:14
SS:15
HTTP EthernetWebServer is @ IP : 192.168.2.111
HTTP WiFiWebServer is @ IP : 192.168.2.109

21. AdvancedWebServer_ESP32_SPI2 on ESP32_DEV with W5x00 using Ethernet_Generic Library on SPI2

The following are debug terminal output and screen shot when running example AdvancedWebServer_ESP32_SPI2 on ESP32_DEV with W5500 using Ethernet_Generic Library on SPI2

Starting AdvancedWebServer_ESP32_SPI2 on ESP32_DEV with W5x00 using Ethernet_Generic Library on SPI2
EthernetWebServer v2.1.1
=========================
Currently Used SPI pinout:
MOSI:13
MISO:12
SCK:14
SS:5
=========================
Using mac index = 0
Connected! IP address: 192.168.2.102
Speed: 100 MB, Duplex: FULL DUPLEX, Link status: LINK
HTTP EthernetWebServer is @ IP : 192.168.2.102
.
[EWS] String Len = 0, extend to 2048


Debug

Debug is enabled by default on Serial. Debug Level from 0 to 4. To disable, change the ETHERNET_WEBSERVER_LOGLEVEL to 0

// Use this to output debug msgs to Serial
#define DEBUG_ETHERNET_WEBSERVER_PORT       Serial
// Use this to disable all output debug msgs
// Debug Level from 0 to 4
#define _ETHERNET_WEBSERVER_LOGLEVEL_       0

Troubleshooting

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.



Issues

Submit issues to: EthernetWebServer issues


TO DO

  1. Bug Searching and Killing
  2. Add Server support
  3. Support more types of boards using Ethernet shields.
  4. Support more non-compatible Ethernet Libraries such as Ethernet_Shield_W5200, EtherCard, EtherSia
  5. Add mDNS features.

DONE

  1. Add support to Arduino SAMD21 (ZERO, MKR, NANO_33_IOT, etc.)
  2. Add support to Adafruit SAMD21 (Itsy-Bitsy M0, Metro M0, Feather M0 Express, etc.).
  3. Add support to Adafruit SAMD51 (Itsy-Bitsy M4, Metro M4, Grand Central M4, Feather M4 Express, etc.).
  4. Add support to Adafruit nRF52 ( Feather nRF52832, nRF52840 Express, BlueFruit Sense, Itsy-Bitsy nRF52840 Express, Metro nRF52840 Express, NINA_B302_ublox, NINA_B112_ublox, etc..
  5. Add support to SAM DUE.
  6. Add support to Ethernet W5x00, using either Ethernet, Ethernet2, Ethernet3 or EthernetLarge library
  7. Add support to Ethernet ENC28J60, using UIPEthernet library
  8. Add support to ESP32 and ESP8266
  9. Add support to Seeeduino SAMD21/SAMD51: LoRaWAN, Zero, Femto M0, XIAO M0, Wio GPS Board, Wio Terminal, Grove UI Wireless
  10. Add support to EthernetENC
  11. Add support to PROGMEM-related commands, such as sendContent_P() and send_P()
  12. Add High-level HTTP (GET, POST, PUT, PATCH, DELETE) and WebSocket Client
  13. Add support to RP2040-based boards such as RASPBERRY_PI_PICO, using Arduino-mbed RP2040 core
  14. Add support to RP2040-based boards such as RASPBERRY_PI_PICO, using Earle Philhower's arduino-pico core v1.3.1+
  15. Add support to Teensy 4.1 built-in Ethernet using NativeEthernet library
  16. Add support to Teensy 4.1 built-in Ethernet using QNEthernet library
  17. Add support to Portenta_H7 boards, using Arduino-mbed mbed_portenta core.
  18. Reduce usage of Arduino String with std::string
  19. Optimize library code and examples by using reference-passing instead of value-passing.
  20. Make breaking changes in v2.0.0 to permit coexistence with ESP32 WebServer and ESP8266 ESP8266WebServer libraries
  21. Add support to SAMD21/SAMD51 boards using Fab_SAM_Arduino core
  22. Fix bug when using QNEthernet staticIP.
  23. Add staticIP option to NativeEthernet examples
  24. Use new Ethernet_Generic library as default for W5x00.
  25. Support SPI2 for ESP32


Contributions and Thanks

Many thanks for everyone for bug reporting, new feature suggesting, testing and contributing to the development of this library.

  1. Based on and modified from the good Ivan Grokhotkov's ESP8266WebServer and ESP32 WebServer libraries.
  2. jandrassy for EthernetENC and UIPEthernet library
  3. Thanks to good work of Miguel Alexandre Wisintainer for initiating, inspriring, working with, developing, debugging and testing. Without that, support to nRF52, especially U-Blox B302 running as nRF52840 and U-Blox B112 running as nRF52832, has never been started and finished. Also see ESP32-based U-BLOX NINA W102 running ENC28J60.
  4. Thanks to Vladimir to initiate the work on ESP32 and ESP8266 in Spiffs not work Issue #2
  5. Adrian McEwen for HttpClient Library on which the ArduinoHttpClient Library and this EthernetWebServer library are relied.
  6. Thanks to jimmie11 to report and suggest a fix in Compile Error on Teensy 4.1 #14 leading to the new version v1.2.0 to provide support to Teensy 4.1 using NativeEthernet Library
  7. Thanks to Sardar Azari to make PR in streamFile and serveStatic for ESP8266/ESP32 boards #22 leading to the new version v1.3.0 to add WebServer feature to serve static from LittleFS/SPIFFS for ESP32/ESP8266. The example serveStatic and serveStaticLoadFile are also contributed by Sardar Azari.
  8. Thanks to neardreams to report issue Something wrong in http response header #41, then make PR in fix for wrong http status header #42 leading to the new version v1.8.2 to fix wrong http status header bug.
  9. Thanks to dirkdickler to report issue server.authenticate problem #43 which was fixed in v1.8.2
  10. Thanks to Shahram to report issues
  1. RQnet to report issue Decoding Error. two times called urlDecode in Parsing-impl.h. #17 leading to version v2.0.1 to fix the decoding error bug when using special & in data fields.
igrr
⭐️ Ivan Grokhotkov

amcewen
⭐️ Adrian McEwen

jandrassy
⭐️ Juraj Andrássy

tcpipchip
⭐️ Miguel Wisintainer

Vladimir
Vladimir

jimmie11
jimmie11

gagulik
Sardar Azari

neardreams
neardreams

dirkdickler
dirkdickler

Nourbakhsh-Rad
Shahram

RQnet
RQnet


Contributing

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

License

  • The library is licensed under MIT

Copyright

Copyright 2020- Khoi Hoang

About

This is simple yet complete WebServer library for AVR, Portenta_H7, Teensy, SAM DUE, SAMD21/SAMD51, nRF52, STM32, RP2040-based, etc. boards running Ethernet shields. The functions are similar and compatible to ESP8266/ESP32 WebServer libraries to make life much easier to port sketches from ESP8266/ESP32. Coexisting now with `ESP32 WebServer` and…

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 71.6%
  • C 28.2%
  • Shell 0.2%