This is a fork of the WIZnet Ethernet library. The code has been changed from the upstream library as listed below. Also, the directory structure has been changed in order to conform to the Arduino Library Specification.
This README.md file has been changed to add this Special Note section and to resolve issues flagged by markdownlint.
-
w5100.h
Change the the following lines from://#define W5200_ETHERNET_SHIELD #define W5500_ETHERNET_SHIELD
To:
#define W5200_ETHERNET_SHIELD //#define W5500_ETHERNET_SHIELD
That is, uncomment the W5200 definition, and comment out W5500
-
w5200.h
In lines 315-339, delete or comment out all the #ifdef structures and leave only the following as active code:
inline static void initSS() { pinMode(SS, OUTPUT); \ digitalWrite(SS, HIGH); }; inline static void setSS() { digitalWrite(SS, LOW); }; inline static void resetSS() { digitalWrite(SS, HIGH); };
-
w5200.cpp
-
Change the line:
#define SPI_CS 10
To:
#define SPI_CS 8 #define ARDUINO_ARCH_AVR
-
After the following lines:
#if defined(ARDUINO_ARCH_AVR) SPI.begin(); initSS();
Add this line
SPI.setClockDivider(SPI_CLOCK_DIV8);
-
In the second-to-last line of the file (right before the final #endif), add the following
#undef ARDUINO_ARCH_AVR
-
-
Ethernet.h
Add a constructor prototype in the public section:
EthernetClass(); -
Ethernet.cpp
Define the constructor, which initializes the
_dhcppointer to zero:EthernetClass::EthernetClass() { _dhcp = 0; }
In the two places where a new
DhcpClassobject is created, replace this:_dhcp = new DhcpClass();with this (to check if an object was already created):
if (_dhcp == 0) { _dhcp = new DhcpClass(); }
-
Added file
Udp.hfrom the standard Arduino Ethernet library. -
Filename changes to avoid ambiguity with built-in Ethernet library:
Ethernet.cpp->WIZ-Ethernet.cppEthernet.h->WIZ-Ethernet.hEthernetClient.cpp->WIZ-EthernetClient.cppEthernetClient.h->WIZ-EthernetClient.h
-
Updated
#includedirectives to use new file names:EthernetServer.cppEthernetUdp.cppWIZ-Ethernet.cppWIZ-Ethernet.hWIZ-EthernetClient.cpp
-
Deleted files
Twitter.handTwitter.cpp, since there were not used for my application and had an imcompatiblity with the GCC9.6 compiler due toprintln()method
The original README begins after the horizontal rule below.
WIZ Ethernet library is made for various Open Source Hardware Platform and support WIZnet's W5100, W5200 and W5500 chip. The Ethernet library lets you connect to the Internet or a local network
- ioShield, WIZ550io (using W5500)
- W5200 Ethernet Shield, WIZ820io (using W5200)
- Arduino Ethernet Shield (using W5100)
Download all files and overwrite onto the "\libraries\Ethernet" folder in your project in sketch.
Download all files and replace the "\libraries\Ethernet\src" folder in your Arduino IDE. This will update the "utility" folder also under "\libraries\Ethernet\src".
In the W5100.h file(\libraries\Ethernet\utility\w5100.h), uncomment the device(shield) you want to use.
#ifndef W5100_H_INCLUDED
#define W5100_H_INCLUDED
#include <avr/pgmspace.h>
#include <SPI.h>
typedef uint8_t SOCKET;
//#define W5100_ETHERNET_SHIELD
//#define W5200_ETHERNET_SHIELD
#define W5500_ETHERNET_SHIELDBy default, "WIZ550io_WITH_MACADDRESS" is commented and if you uncomment it, you can use the MAC address stored in the WIZ550io.
#if defined(W5500_ETHERNET_SHIELD)
//#define WIZ550io_WITH_MACADDRESS // Use assigned MAC address of WIZ550io
#include "w5500.h"
#endifAll other steps are the same as the steps from the Arduino Ethernet Shield. You can find examples in the Arduino IDE, go to Files->Examples->Ethernet, open any example, then copy it to your sketch file (gr_sketch.cpp) and change configuration values properly. After that, you can check if it is work well. For example, if you choose 'WebServer', you should change IP Address first and compile and download it. Then you can access web server page through your web browser of your PC or something.
- Initial Release : 14 August 2013
- Adding function to read / write W5500 PHY configuration register : 4 December 2013
- Support the Arduino Due (Arduino IDE 1.5.x). Now it support 42Mhz SPI clock ! (by Jinbuhm Kim): 28 Feb. 2014
- Separate the folder for Arduino IDE 1.0.x & Arduino IDE 1.5.x