Example of using SPI Ethernet module with esp8266.
Arduino core for ESP8266 uses lwip for TCP/IP protocol stack.
The hierarchy of programs that use WiFi is as follows:
+----------------+
| Application |
+----------------+
| Network Object |
+----------------+
| lwip |
+----------------+
| WiFi Driver |
+----------------+
The latest Arduino core supports SPI external Ethernet as standard.
You don't need any libraries.
The hierarchy of programs that use Ethernet is as follows:
+----------------+
| Application |
+----------------+
| Network Object |
+----------------+
| lwip |
+----------------+
| Ethernet Driver|
+----------------+
SPI Ethernet module using this chip.
- ENC28J60
- W5100
- W5500
- Arduino core for ESP8266 V3.0.2 or later
You can check the Core version using ESP.getFullVersion() or ESP.getCoreVersion().
This is mine:
ESP.getFullVersion=SDK:2.2.2-dev(38a443e)/Core:3.0.2=30002000/lwIP:STABLE-2_1_2_RELEASE/glue:1.2-48-g7421258/BearSSL:6105635
ESP.getCoreVersion=3.0.2
SPI PHY | --- | ESP8266 |
---|---|---|
SCK | --- | GPIO14 |
MISO | --- | GPIO12 |
MOSI | --- | GPIO13 |
CS | --- | GPIO16(*) |
RST | --- | RESET |
(*) You can change.
- Using W5500:
#include <W5500lwIP.h>
Wiznet5500lwIP eth(CSPIN);
- Using W5100:
#include <W5100lwIP.h>
Wiznet5100lwIP eth(CSPIN);
- Using ENC28J60:
#include <ENC28J60lwIP.h>
ENC28J60lwIP eth(CSPIN);
UDP receive is currently not working.
This is probably not a driver issue, but a core library issue.