WIZ Ethernet Library for Arduino IDE-1.6.4

ARM mbed
Download Arduino IDE-1.6.4

WIZ Ethernet Library

The Ethernet library lets you connect to the Internet or a local network.

  • Supported devices
    W5500 : ioShield, WIZ550io, W5500 Ethernet Shield, Arduino Ethernet Shield 2
    W5200 : W5200 Ethernet Shield, WIZ820io
    W5100 : Arduino Ethernet Shield

  • Software

  • Install WIZ Ethernet library IDE-1.6.4
  • Download all files
  • Overwrite “Ethernet” folder onto the “Arduino\libraries\Ethernet” folder in Arduino sketch.

  • Select device(shield)

  • Uncomment device(shiel) you want to use in $/Ethernet/src/utility/w5100.h
//#define W5100_ETHERNET_SHIELD // Arduino Ethenret Shield and Compatibles ...
//#define W5200_ETHERNET_SHIELD // WIZ820io, W5200 Ethernet Shield
#define W5500_ETHERNET_SHIELD // WIZ550io, ioShield series of WIZnet
  • If WIZ550io used, uncommnet “#define WIZ550io_WITH_MACAADDRESS” in $/Ethernet/src/utility/w5100.h
#if defined(W5500_ETHERNET_SHIELD)
//#define WIZ550io_WITH_MACADDRESS // Use assigned MAC address of WIZ550io
#include "w5500.h"
#endif
  • Using the WIZ Ethernet library and evaluate existing Ethernet example.
    All other steps are the same as the steps from the Arduino Ethernet Shield. You can use examples in ./Ethernet/examples folder for the Arduino IDE 1.6.4, go to Files->Examples->Ethernet, open any example, then copy it to your sketch file 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.

What is new ?

  • Added new functions
  • sockStatus(SOCKET s) = readSnSR(SOCKET s)
uint8_t socketStatus(SOCKET s)
{
SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
uint8_t status = W5100.readSnSR(s);
SPI.endTransaction();
return status;
}
  • reavAvalable(SOCKET s) = getRxReceiveSize(SOCKET s)
int16_t recvAvailable(SOCKET s)
{
SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
int16_t ret = W5100.getRXReceivedSize(s);
SPI.endTransaction();
return ret;
}
  • Added SPI Transaction APIs
    To solve conflicts that sometimes occur between multiple SPI devices when using SPI from interrupts and/or different SPI settings, SPI Transcation APIs use between between read and write SPI functions.
SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
W5100.setIPAddress(_dhcp->getLocalIp().raw_address());
W5100.setGatewayIp(_dhcp->getGatewayIp().raw_address());
W5100.setSubnetMask(_dhcp->getSubnetMask().raw_address());
SPI.endTransaction();
  • Removed Twitter.cpp / Twitter.h

Code on Github

Version History

  • Initial Release : 21 May. 2015
Advertisements

12 thoughts on “WIZ Ethernet Library for Arduino IDE-1.6.4

  1. Hi,
    Thank you for the WIZ Ethernet Library for Arduino IDE-1.6.4. I successfully downloaded and tested it with the Ethernet shield W5100. However, with the W5200 Ethernet shield (from Elecrow) I could compile the project but did not get any IP address (Arduino example DhcpAddressPrinter). Have you tested the library with all Ethernet shield?
    Best regards

    • Hi Rony,
      This problem has relevance to the timing of PHY link.
      I thought that DISCOVER packet in UDP could be send before PHY link_done.
      Unfortunaly, Ethernet library does not povides the API for PHY status.
      I added delay time of 3seconds and fixed arduion/libraries/Ethernet/src/utility/W5200.cpp is fixed as below,
      26 //#define W5500_ETHERNET_SHIELD // WIZ550io, ioShield series of WIZnet
      27 void W5200Class::init(void)
      28 {
      29 //delay(300);
      30 delay(3000);
      Then, DhcpAddressPrinter runs smoothly.
      Thanks,

      • Hi,
        Thank you for your help. I added the 3s break, but it did not work.


        //delay(300);
        delay(3000);

        I realized that in my “W5200.cpp” file row 26 is empty (no “//#define W5500_ …”), therefore I was wondering whether I have to latest library or not. Since I downloaded it from this site, however, it should be the latest.
        Any other ideas?

        Regards,
        Rony

      • Hi,
        I tested also other examples, e.g. DhcpChatServer. With the W5100 it works, but with the W5200 it doesn’t (no IP address retrieved from DHCP).
        To make sure that it is not a hardware defect, I tried a second W5200 board, without success.

        For clarification, when I switch between the two boards I only change the definition in the w5100.h file, correct?

        //#define W5100_ETHERNET_SHIELD // Arduino Ethenret Shield and Compatibles …
        #define W5200_ETHERNET_SHIELD // WIZ820io, W5200 Ethernet Shield
        //#define W5500_ETHERNET_SHIELD // WIZ550io, ioShield series of WIZnet

        Thanks

  2. Hi Rony,

    I have tested DhcpAddressPrinter and DhcpChatServer several times over (with W5200 Ethernet Shield: http://www.amazon.com/Wiznet-W5200-Ethernet-Shield-Arduino/dp/B00IY09MWK?tag=duckduckgo-d-20).
    However, I don’t find any problem.

    Please, check as below list,
    – Is dhcp server in your network ok ?
    – Set more than delay(3000) to avoid UDPsending before PHY link_done
    – Remove previous WIZ ehternet library and IDE to avoid conflicing with Library
    Thanks

  3. Hi embeddist,

    Thank you for your support.
    – DHCP server works fine.
    – I tried different delay times (1000…10000) but none of it worked.
    – I reinstalled Arduino and completely deleted all WIZ libraries. However, it still did not work with the W5200.

    I use the W5200 from elecrow (http://www.elecrow.com/w5200-ethernet-shield-p-367.html), but I will order the W5200 from Amazon and let you know if it solves the problem.

    Regards,
    Rony

    • HI embeddist,

      I just received and tested the W5200 from Amazon –> it works!
      Since you did not test the library with the W5200 from elecrow, I assume that it is not compatible with your library (I tested several boards from elecrow, also with other libraries, no success at all).

      Anyway, thanks a lot for your support!

      Regards,
      Rony

      • Hi, Rony,

        As far as I know, several ethernet shields product and specific library use bellow code under “void setup()”

        pinMode(SDCARD_CS,OUTPUT);
        digitalWrite(SDCARD_CS,HIGH);//Deselect the SD card

        i guess that certain ethernet shield needs to disable other spi device explicitly.

  4. And Hi, embeddist,

    I did not yet test the library for IDE 1.6.5 but I am sure it works. I think recent IPAddress library in recent IDE has been changed into using an union and it could make trouble when we use new library on new IDE but no trouble new library on old IDE.

    But unfortunately Wiznet Wiki site library url points only the library for old IDE and there is no link and no comments for new IDE like 1.6.5 that you have done.

    And I have a favor. Could you edit the wiki to add your work. The wiki URL is http://wizwiki.net/wiki/doku.php?id=osh:ioshield-a:updatelib

    Thank you.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s