---
title: "WebSockets2_Generic"
url: "https://maker.wiznet.io/mayuri/projects/websockets2-generic/"
markdown_url: "https://maker.wiznet.io/mayuri/projects/websockets2-generic/md"
type: "UCC: User Created Content"
author: "khoih prog"
author_url: "https://github.com/khoih-prog/WebSockets2_Generic"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "khoih prog"
original_url: "https://github.com/khoih-prog/WebSockets2_Generic"
published: "2023-01-25"
language: "en"
hardware: ["WIZnet W5500", "WIZnet W5200"]
likes: 15
views: 429
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# WebSockets2_Generic

> WebSockets2_Generic Library

Original author: khoih prog (source: https://github.com/khoih-prog/WebSockets2_Generic)

## Components

- **WIZnet W5500** x 1 ([docs](https://docs.wiznet.io/Product/Chip/Ethernet/W5500))
- **WIZnet W5200** x 1 ([docs](https://docs.wiznet.io/Product/iEthernet/W5200/))

WIZnet parts: W5500 ([Datasheet](https://docs.wiznet.io/Product/Chip/Ethernet/W5500/datasheet?utm_source=maker&utm_medium=project&utm_campaign=w5500), [product hub](https://maker.wiznet.io/products/w5500/))

## Article

1. W5x00 using [`Ethernet_Generic`](https://github.com/khoih-prog/Ethernet_Generic) library

2. W5x00 using [`Ethernet`](https://www.arduino.cc/en/Reference/Ethernet), [`EthernetLarge`](https://github.com/OPEnSLab-OSU/EthernetLarge), [`Ethernet2`](https://github.com/adafruit/Ethernet2) or [`Ethernet3`](https://github.com/sstaub/Ethernet3) library

3. ENC28J60 using [`EthernetENC`](https://github.com/jandrassy/EthernetENC) or [`UIPEthernet`](https://github.com/UIPEthernet/UIPEthernet) library

4. LAN8720 Ethernet used in `WT32_ETH01` boards

5. `LAN8742A or LAN8720` using [`STM32Ethernet`](https://github.com/stm32duino/STM32Ethernet) and [`LwIP`](https://github.com/stm32duino/LwIP) libraries.

6. `Teensy 4.1` built-in Ethernet using [`NativeEthernet`](https://github.com/vjmuzik/NativeEthernet) library

7. `Teensy 4.1` built-in Ethernet using [`QNEthernet`](https://github.com/ssilverman/QNEthernet) library

8. Portenta_H7 using Ethernet from [Portenta Vision shields](https://store-usa.arduino.cc/products/arduino-portenta-vision-shield-ethernet)

[![](https://github.com/khoih-prog/WebSockets2_Generic/raw/master/pics/Portenta_Vision.jpg)](https://github.com/khoih-prog/WebSockets2_Generic/raw/master/pics/Portenta_Vision.jpg)

---

---

## Prerequisites

[`Arduino IDE 1.8.19+` for Arduino](https://github.com/arduino/Arduino). [![GitHub release](https://maker.wiznet.io/upload/mirror/body/381331e50972fdafe470.png)](https://github.com/arduino/Arduino/releases/latest)

[`Arduino AVR core 1.8.6+`](https://github.com/arduino/ArduinoCore-avr) for Arduino (Use Arduino Board Manager) AVR boards. [![GitHub release](https://maker.wiznet.io/upload/mirror/body/b253b6fc6e99dd8b4ff9.png)](https://github.com/arduino/ArduinoCore-avr/releases/latest)

[`Teensy core v1.57+`](https://github.com/PaulStoffregen/cores) for Teensy (4.1, 4.0, 3.6, 3.5, 3,2, 3.1, 3.0) boards. [![GitHub release](https://maker.wiznet.io/upload/mirror/body/66af5c6eaa833c8ee429.png)](https://github.com/PaulStoffregen/cores/releases/latest)

[`Arduino SAM DUE core v1.6.12+`](https://github.com/arduino/ArduinoCore-sam) for SAM DUE ARM Cortex-M3 boards.

[`Arduino SAMD core 1.8.13+`](https://github.com/arduino/ArduinoCore-samd) for SAMD ARM Cortex-M0+ boards. [![GitHub release](https://maker.wiznet.io/upload/mirror/body/46460c1a08f9d5934c89.png)](https://github.com/arduino/ArduinoCore-samd/releases/latest)

[`Adafruit SAMD core 1.7.11+`](https://github.com/adafruit/ArduinoCore-samd) for SAMD ARM Cortex-M0+ and M4 boards (Nano 33 IoT, etc.). [![GitHub release](https://maker.wiznet.io/upload/mirror/body/bdf112219b134f539f5a.png)](https://github.com/adafruit/ArduinoCore-samd/releases/latest)

[`Seeeduino SAMD core 1.8.3+`](https://github.com/Seeed-Studio/ArduinoCore-samd) for SAMD21/SAMD51 boards (XIAO M0, Wio Terminal, etc.). [![Latest release](https://maker.wiznet.io/upload/mirror/body/b6d5988db36bd51dfa4e.png)](https://github.com/Seeed-Studio/ArduinoCore-samd/releases/latest/)

[`Adafruit nRF52 v1.3.0+`](https://github.com/adafruit/Adafruit_nRF52_Arduino) 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](https://maker.wiznet.io/upload/mirror/body/636c69263e87cc065aa1.png)](https://github.com/adafruit/Adafruit_nRF52_Arduino/releases/latest)

[`ESP32 Core 2.0.5+`](https://github.com/espressif/arduino-esp32) for ESP32-based boards. [![Latest release](https://maker.wiznet.io/upload/mirror/body/5ce56eb824ddf2c00aff.png)](https://github.com/espressif/arduino-esp32/releases/latest/)

[`ESP8266 Core 3.0.2+`](https://github.com/esp8266/Arduino) for ESP8266-based boards. . To use ESP8266 core 2.7.1+ for LittleFS.

[`ArduinoCore-mbed mbed_rp2040, mbed_nano, mbed_portenta core 3.4.1+`](https://github.com/arduino/ArduinoCore-mbed) for Arduino (Use Arduino Board Manager) **Portenta_H7, RP2040-based boards, such as Nano_RP2040_Connect, RASPBERRY_PI_PICO**. [![GitHub release](https://maker.wiznet.io/upload/mirror/body/d784fce75074b89ea975.png)](https://github.com/arduino/ArduinoCore-mbed/releases/latest)

[`Earle Philhower's arduino-pico core v2.6.4+`](https://github.com/earlephilhower/arduino-pico) for RP2040-based boards such as **RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040**, etc. [![GitHub release](https://maker.wiznet.io/upload/mirror/body/2da2dab6f16cbd3239e6.png)](https://github.com/earlephilhower/arduino-pico/releases/latest)

[`Arduino Core for STM32 v2.3.0+`](https://github.com/stm32duino/Arduino_Core_STM32) for STM32F/L/H/G/WB/MP1 boards. [![GitHub release](https://maker.wiznet.io/upload/mirror/body/2e1f3d1dbd694753d4c6.png)](https://github.com/stm32duino/Arduino_Core_STM32/releases/latest). Use STM32 core `v2.2.0` for LAN8720 or compile error.

[`Arduino AmebaD core 3.1.4+`](https://github.com/ambiot/ambd_arduino) for Realtek RTL8720DN, RTL8722DM and RTL8722CSM. [![GitHub release](https://img.shields.io/github/release/ambiot/ambd_arduino.svg)](https://github.com/ambiot/ambd_arduino/releases/latest)

[`WiFiNINA_Generic library v1.8.15-1+`](https://github.com/khoih-prog/WiFiNINA_Generic) if for WiFiNINA. To install. check [![arduino-library-badge](https://www.ardu-badge.com/badge/WiFiNINA_Generic.svg?)](https://www.ardu-badge.com/WiFiNINA_Generic).

[`EthernetWebServer library v2.3.0+`](https://github.com/khoih-prog/EthernetWebServer) if necessary to use Ethernet modules/shields. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/EthernetWebServer.svg?)](https://www.ardu-badge.com/EthernetWebServer)

[`EthernetWebServer_STM32 library v1.5.0+`](https://github.com/khoih-prog/EthernetWebServer_STM32) if necessary to use Ethernet modules/shields. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/EthernetWebServer_STM32.svg?)](https://www.ardu-badge.com/EthernetWebServer_STM32)

[`WebServer_WT32_ETH01 library v1.5.1+`](https://github.com/khoih-prog/WebServer_WT32_ETH01) if necessary to use WT32_ETH01 boards. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/WebServer_WT32_ETH01.svg?)](https://www.ardu-badge.com/WebServer_WT32_ETH01)

Depending on which Ethernet card you're using:

- [`Ethernet_Generic library v2.7.1+`](https://github.com/khoih-prog/Ethernet_Generic) for W5100, W5200 and W5500/WIZ550io/WIZ850io/USR-ES1 with Wiznet W5500 chip. [![GitHub release](https://camo.githubusercontent.com/c9cb7d4002b260b3264112f8bf3d50d097d07c9865919eedb5473647aacba16a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6b686f69682d70726f672f45746865726e65745f47656e657269632e737667)](https://github.com/khoih-prog/Ethernet_Generic/releases/latest)

- [`EthernetENC library v2.0.3+`](https://github.com/jandrassy/EthernetENC) for ENC28J60. [![GitHub release](https://camo.githubusercontent.com/18635be685f6b77a4d0c9c0e81a296ed4a335c26702004b70c4c15223f1d9162/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6a616e6472617373792f45746865726e6574454e432e737667)](https://github.com/jandrassy/EthernetENC/releases/latest). **New and Better**

- [`UIPEthernet library v2.0.12+`](https://github.com/UIPEthernet/UIPEthernet) for ENC28J60. [![GitHub release](https://camo.githubusercontent.com/cbf1a7d161c4fc57dfa49ff66b993281fd61362f761fc5e0855fd76bcc43f641/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f55495045746865726e65742f55495045746865726e65742e737667)](https://github.com/UIPEthernet/UIPEthernet/releases/latest)

- [`STM32Ethernet library v1.3.0+`](https://github.com/stm32duino/STM32Ethernet) for built-in LAN8742A Ethernet on (Nucleo-144, Discovery). [![GitHub release](https://maker.wiznet.io/upload/mirror/body/b9ae44560ad4d18336bf.png)](https://github.com/stm32duino/STM32Ethernet/releases/latest). To be used with [`LwIP library v2.1.2+`](https://github.com/stm32duino/LwIP). [![GitHub release](https://camo.githubusercontent.com/7ee5d856276aa823a05026eb967f9b385b02d71a1b3dc75fbbbf760c8caa8c18/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f73746d33326475696e6f2f4c7749502e737667)](https://github.com/stm32duino/LwIP/releases/latest).

- [`NativeEthernet Library version stable111+`](https://github.com/vjmuzik/NativeEthernet) for Teensy 4.1 built-in Ethernet.

- [`QNEthernet Library version v0.17.0+`](https://github.com/ssilverman/QNEthernet) Teensy 4.1 built-in Ethernet. **New**

1. [`WiFiWebServer library v1.10.1+`](https://github.com/khoih-prog/WiFiWebServer) if necessary to use certain WiFi/WiFiNINA features. To install, check [![arduino-library-badge](https://camo.githubusercontent.com/d581758a5f7b241dde5293a479ed8f2bff6c72a1c58850c6dfb8a9f01bc75a80/68747470733a2f2f7777772e617264752d62616467652e636f6d2f62616467652f576946695765625365727665722e7376673f)](https://www.ardu-badge.com/WiFiWebServer)

2. [`FlashStorage_SAMD library v1.3.2+`](https://github.com/khoih-prog/FlashStorage_SAMD) for SAMD21 and SAMD51 boards (ZERO, MKR, NANO_33_IOT, M0, M0 Pro, AdaFruit Itsy-Bitsy M4, etc.) if necessary to use certain features. [![GitHub release](https://img.shields.io/github/release/khoih-prog/FlashStorage_SAMD.svg)](https://github.com/khoih-prog/FlashStorage_SAMD/releases/latest)

3. [`FlashStorage_STM32 library v1.2.0+`](https://github.com/khoih-prog/FlashStorage_STM32) for STM32F/L/H/G/WB/MP1 boards. [![GitHub release](https://img.shields.io/github/release/khoih-prog/FlashStorage_STM32.svg)](https://github.com/khoih-prog/FlashStorage_STM32/releases/latest) if necessary to use certain features.

4. [`DueFlashStorage library v1.0.0+`](https://github.com/sebnil/DueFlashStorage) for SAM DUE if necessary to use certain features. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/DueFlashStorage.svg?)](https://www.ardu-badge.com/DueFlashStorage).

5. [`Adafruit's LittleFS/InternalFS`](https://www.adafruit.com/) for nRF52. Already included if you already installed Adafruit **nRF52 board package** from Boards Manager.

6. [`DoubleResetDetector_Generic v1.8.1+`](https://github.com/khoih-prog/DoubleResetDetector_Generic) if necessary to use some examples. To install. check [![arduino-library-badge](https://www.ardu-badge.com/badge/DoubleResetDetector_Generic.svg?)](https://www.ardu-badge.com/DoubleResetDetector_Generic) if necessary to use certain features.

7. [`WiFi101_Generic Library v1.0.0+`](https://github.com/khoih-prog/WiFi101_Generic) to use SAMD MKR1000, etc. boards with WiFi101 to send large data. To install. check [![arduino-library-badge](https://maker.wiznet.io/upload/mirror/body/8fb62cb3ae5025318e14.png)](https://www.ardu-badge.com/WiFi101_Generic).

8. [`SinricPro_Generic v2.8.5+`](https://github.com/khoih-prog/SinricPro_Generic) if necessary to use some examples. To install. check [![arduino-library-badge](https://www.ardu-badge.com/badge/SinricPro_Generic.svg?)](https://www.ardu-badge.com/SinricPro_Generic) if necessary to use certain features.

---

---

## Installation

### Use Arduino Library Manager

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

### Manual Install

Another way to install is to:

1. Navigate to [**WebSockets2_Generic**](https://github.com/khoih-prog/WebSockets2_Generic) page.

2. Download the latest release `WebSockets2_Generic-master.zip`.

3. Extract the zip file to `WebSockets2_Generic-master` directory

4. Copy whole `WebSockets2_Generic-master` folder to Arduino libraries' directory such as `~/Arduino/libraries/`.

---

Source: https://maker.wiznet.io/mayuri/projects/websockets2-generic/
