Skip to content

Ethernet example using Ethernet drivers for lwIP on esp8266

Notifications You must be signed in to change notification settings

a71sa/esp8266_ethernet

 
 

Repository files navigation

esp8266_ethernet

Ethernet example using Ethernet drivers for lwIP on esp8266

Arduino core for ESP8266 uses lwip for TCP/IP protocol stack.

You can check the version of lwip with the following function: Serial.print(ESP.getFullVersion());

SDK:2.2.2-dev(38a443e)/Core:2.7.1=20701000/lwIP:STABLE-2_1_2_RELEASE/glue:1.2-30-g92add50/BearSSL:5c771be

The hierarchy of programs that use WiFi is as follows:

+----------------+
|  Application   |
+----------------+
| Network Object |
+----------------+
|      lwip      |
+----------------+
|   WiFi Driver  |
+----------------+ 

This driver replaces the WiFi driver with an Ethernet driver.
You can use Ethnernet with only a few changes.

+----------------+
|  Application   |
+----------------+
| Network Object |
+----------------+
|      lwip      |
+----------------+
| Ethernet Driver|
+----------------+

This repository is a example of using Ethernet drivers for lwIP on esp8266.
Thanks to d-a-v.

Hardware requiment

SPI Ethernet module using this chip.

  • ENC28J60
  • W5100
  • W5500

Software requiment

  • Latest of Arduino core for ESP8266.
    I tested 2.7.1.

  • Ethernet drivers for lwIP on esp8266.
    You can download from here.

Wireing

SPI PHY --- ESP8266
SCK --- D5
MISO --- D6
MOSI --- D7
CS --- D2(*)
RST --- RESET

(*) You can change.

Selecting the Ethernet module

By default the W5500 ethernet module is selected.

  • Using W5500:
#include <W5500lwIP.h>
Wiznet5500lwIP eth(SPI, CSPIN);

W5500

  • Using W5100:
#include <W5100lwIP.h>
Wiznet5100lwIP eth(SPI, CSPIN);

W5100

  • Using ENC28J60:
#include <ENC28J60lwIP.h>
ENC28J60lwIP eth(SPI, CSPIN);

ENC28J60

Limitations

UDP receive is currently not working.
This is probably not a driver issue, but a core library issue.

About

Ethernet example using Ethernet drivers for lwIP on esp8266

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%