{"id":16239345,"url":"https://github.com/nopnop2002/esp8266_ethernet","last_synced_at":"2025-10-10T06:40:12.670Z","repository":{"id":108987915,"uuid":"267533060","full_name":"nopnop2002/esp8266_ethernet","owner":"nopnop2002","description":"Example of using SPI Ethernet module with esp8266","archived":false,"fork":false,"pushed_at":"2024-11-26T00:43:18.000Z","size":60,"stargazers_count":44,"open_issues_count":1,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T21:22:26.355Z","etag":null,"topics":["arduino","enc28j60","esp8266","ethernet","platformio","w5100","w5500"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nopnop2002.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-28T08:18:03.000Z","updated_at":"2024-12-30T19:27:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"51beb999-be76-4333-8f59-e7eed4f5f9e9","html_url":"https://github.com/nopnop2002/esp8266_ethernet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nopnop2002/esp8266_ethernet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp8266_ethernet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp8266_ethernet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp8266_ethernet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp8266_ethernet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nopnop2002","download_url":"https://codeload.github.com/nopnop2002/esp8266_ethernet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp8266_ethernet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002969,"owners_count":26083489,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","enc28j60","esp8266","ethernet","platformio","w5100","w5500"],"created_at":"2024-10-10T13:43:24.379Z","updated_at":"2025-10-10T06:40:12.656Z","avatar_url":"https://github.com/nopnop2002.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# esp8266_ethernet\nExample of using SPI Ethernet module with esp8266.   \nArduino core for ESP8266 uses [lwip](https://savannah.nongnu.org/projects/lwip/) for TCP/IP protocol stack.   \nThe hierarchy of programs that use WiFi is as follows:\n\n```\n+----------------+\n|  Application   |\n+----------------+\n| Network Object |\n+----------------+\n|      lwip      |\n+----------------+\n|   WiFi Driver  |\n+----------------+ \n```\n\nArduino Core for ESP8266 Ver3.0.2 officially supports SPI External Ethernet.   \n__You don't need any libraries.__   \nThe hierarchy of programs that use Ethernet is as follows:\n\n```\n+----------------+\n|  Application   |\n+----------------+\n| Network Object |\n+----------------+\n|      lwip      |\n+----------------+\n| Ethernet Driver|\n+----------------+\n```\n\n# Hardware requiment\nSPI Ethernet module using this chip.\n- ENC28J60\n- W5100\n- W5500\n\n# Software requiment\n- Arduino core for ESP8266 __V3.0.2__ or later  \n![](https://img.shields.io/badge/_IMPORTANT-important)  \nYou can check the Core version using ESP.getFullVersion() or ESP.getCoreVersion().   \nThis is mine:   \n```\nESP.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\nESP.getCoreVersion=3.0.2\n```\n\n\n# Wireing\n\n|SPI PHY|---|ESP8266|\n|:-:|:-:|:-:|\n|SCK|---|GPIO14(D5)|\n|MISO|---|GPIO12(D6)|\n|MOSI|---|GPIO13(D7)|\n|CS|---|GPIO16(D0)(*)|\n|RST|---|RESET|\n|3.3V|---|3.3V|\n|GND|---|GND|\n\n(*) You can change it to any GPIO.\n\n# Selecting the Ethernet module\n\n- Using W5500:\n```\n#include \u003cW5500lwIP.h\u003e\nWiznet5500lwIP eth(CSPIN);\n```\n![W5500](https://user-images.githubusercontent.com/6020549/83312712-524abd00-a24e-11ea-9c15-c5ad85022854.JPG)\n\n- Using W5100:\n```\n#include \u003cW5100lwIP.h\u003e\nWiznet5100lwIP eth(CSPIN);\n```\n![W5100](https://user-images.githubusercontent.com/6020549/83312708-4f4fcc80-a24e-11ea-923d-409ddeeee855.JPG)\n\n- Using ENC28J60:\n```\n#include \u003cENC28J60lwIP.h\u003e\nENC28J60lwIP eth(CSPIN);\n```\n![ENC28J60](https://user-images.githubusercontent.com/6020549/83312722-57a80780-a24e-11ea-8ae5-f878071a8a3d.JPG)\n\n\n# Using PlatformIO\n```\n$ git clone https://github.com/nopnop2002/esp8266_ethernet\n\n$ cd esp8266_ethernet/connectEthernet/\n\n$ pio init -b d1_mini\n\n$ cp connectEthernet.ino src/\n\n$ pio run -t upload \u0026\u0026 pio device monitor -b 115200\n\n==================================== [SUCCESS] Took 25.50 seconds ====================================\n--- Available filters and text transformations: colorize, debug, default, direct, esp8266_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time\n--- More details at https://bit.ly/pio-monitor-filters\n--- Miniterm on /dev/ttyUSB0  115200,8,N,1 ---\n--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---\n\nSDK:2.2.2-dev(38a443e)/Core:3.0.2=30002000/lwIP:STABLE-2_1_2_RELEASE/glue:1.2-48-g7421258/BearSSL:6105635\nconnecting ethernet..\nethernet ip address: 192.168.10.128\nethernet subnetMask: 255.255.255.0\nethernet gateway: 192.168.10.1\n```\n\n# How to convert from WiFi to Ethernet\n\n- WiFi\n```\n#include \u003cESP8266WiFi.h\u003e\n\nconst char* SSID = \"ssid_of_your_router\";\nconst char* PASSWORD = \"password_of_your_router\";\n\nvoid setup() {\n  delay(1000);\n  Serial.begin(115200);\n  Serial.println();\n  Serial.print(ESP.getFullVersion());\n  Serial.println();\n\n  Serial.print(\"connecting wifi\");\n  WiFi.mode(WIFI_STA);\n  WiFi.begin(SSID, PASSWORD);\n  while (1) {\n    uint8_t status = WiFi.status();\n    Serial.print(\"status=\");\n    Serial.println(status);\n    if (status == WL_CONNECTED) break;\n    Serial.print(\".\");\n    delay(500);\n  }\n  Serial.println();\n  Serial.print(\"WiFi ip address: \");\n  Serial.println(WiFi.localIP());\n  Serial.print(\"Wifi subnetMask: \");\n  Serial.println(WiFi.subnetMask());\n  Serial.print(\"WiFi.gatewayIP: \");\n  Serial.println(WiFi.gatewayIP());\n  Serial.print(\"WiFi.dnsIP: \");\n  Serial.println(WiFi.dnsIP());\n\n}\n\nvoid loop() {\n}\n```\n\n- Ethernet\n```\n#include \u003cSPI.h\u003e\n#include \u003cESP8266WiFi.h\u003e\n#include \u003cW5500lwIP.h\u003e\n//#include \u003cW5100lwIP.h\u003e\n//#include \u003cENC28J60lwIP.h\u003e\n\n#define CSPIN 16\n\nWiznet5500lwIP eth(CSPIN);\n//Wiznet5100lwIP eth(CSPIN);\n//ENC28J60lwIP eth(CSPIN);\nbyte mac[] = {0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02};\n\nvoid setup() {\n  delay(1000);\n  Serial.begin(115200);\n  Serial.println();\n  Serial.print(ESP.getFullVersion());\n  Serial.println();\n\n  SPI.begin();\n  SPI.setBitOrder(MSBFIRST);\n  SPI.setDataMode(SPI_MODE0);\n  SPI.setFrequency(4000000);\n\n  eth.setDefault(); // use ethernet for default route\n  int present = eth.begin(mac);\n  if (!present) {\n    Serial.println(\"no ethernet hardware present\");\n    while(1);\n  }\n  \n  Serial.print(\"connecting ethernet\");\n  while (!eth.connected()) {\n    Serial.print(\".\");\n    delay(1000);\n  }\n  Serial.println();\n  Serial.print(\"ethernet ip address: \");\n  Serial.println(eth.localIP());\n  Serial.print(\"ethernet subnetMask: \");\n  Serial.println(eth.subnetMask());\n  Serial.print(\"ethernet gateway: \");\n  Serial.println(eth.gatewayIP());\n}\n\nvoid loop() {\n}\n```\n\n# WiFi examples   \nhttps://github.com/esp8266/Arduino/tree/master/libraries/ESP8266WiFi/examples\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnopnop2002%2Fesp8266_ethernet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnopnop2002%2Fesp8266_ethernet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnopnop2002%2Fesp8266_ethernet/lists"}