Various useful WIZnet TCP / IP Ethenet Controller Driver created and shared by Maker

Written by MC


Overview

WIZnet introduces improved and stabilized TCP / IP chip such like as W3100 (discontinued), W3150A+, W5100, W5200, W5300, and W5500, and they have receiving continuous attention from many developers and makers around the world

WIZnet recently released the W5100S, which has improved the performance of the greatly loved W5100 and lowered the price, and will soon release the W6100 supporting Dual TCP / IP Stack (IPv4 & IPv6) to cope with upcoming IPv6 IoT market.

Wiznets officially provides ioLibrary for integrated operation of W5xxx Series, which minimizes modification of user application and makes it easy to change to new chip.

And, io6Library for the W6100 will also be available on Github. If you are familiar with ioLibrary, io6Library is also expected to be easy to use.

In this article, I would like to introduce not only the official ioLibrary of Wiznets but also the useful and various libraries developed by Maker & developers from around the world and have been introduced at [WIZet Museum]((http://wiznetmuseum.com/).

The library to introduce is as follows.

Arduino Library

Official Arduino Library

Aurdino Library is the most loved and utilized Library for Maker around the world. Everyone has the advantage of being able to develop quickly and easily, but there is a limit to controlling the detailed functions provided by WIZnet chips, because they are a simple library structure.

Despite these disadvantages, the reason why it is continuously loved and used by makers around the world, is that it provides a variety of examples that can be easily operated and shared by github, and also it is a library made by makers from all over the world to support to operate at runtime regardless of W5100, W5200, W5500, W5100S, W6100, and, etc.

Multicasting Arduino Library

This library provides a library for implementing UDP Mutilcasting that is not supported by the Arduino Library. The authors have implemented UdpClass :: beginMulti() in udp.h and udp.c as well as the UdpClass::begin() function.

In my opinion, UdpMultiClass is inherited from UdpClass without modifying the original library, and adding beginMulti() seems to be good in terms of utilization.

[Refer to WIznet Museum]
[Download Library]
[How to Use]

Non-blocking Arduino Library

The Non-Blocking Arduino Library is a modification of some code to prevent the Arduino Board from blocking a Standard Library that does not perform any action for a few seconds because that is blocked during allocating the IP address is allocated from the DHCP Server or is request to the DNS server.
It is a library that can be helpful to those who have suffered the same problem as the author.

[Refer to WIznet Museum]
[Download Library]
[How to Use]

FreeRTOS Library

It is the WIZnet library of ATmega MCU that runs on FreeRTOS base and it is implemented as the initial ioLibrary version provided by WIZnet.

This library shows how the WIZnet Library can be used in RTOS-based applications.

The author also supports FreeRTOS based uIP Stack, which makes it easy to compare WIZnet’s Hardware TCP / IP stack with Software Stack.

n addition, this site also provides a library that implements the uIP stack by utilizing MACRAW SOCKET function of WIZnet Chip. Refer to here.

[Refer to WIznet Museum]
[Download Library]
[How to Use]

ATmega Library

ATmega Library is a simple library based on W5100. The author modified the library of ermicor.
This library has made very small ioLibrary by implementing only the necessary functions. The following code is the basic IO library for accessing WIZnet Chip.

[Refer to WIznet Museum]
[How to Use]

PSoC Library

PSoC Library works with Cypress’s PSoC4 & PSoC4 and is a library that integrates W5100, W5200 and W5500.
It will be a very useful library for PSoC users.

[Refer to WIznet Museum]
[Download Library]

Library for BASIC Language Users

This library is a library written in the Basic language, not a typical C library.

PIC and ATmega MCU are supported.

PIC Library

[Refer to WIznet Museum]
[Download Library]
[How to Use]

ATmega Library

[Refer to WIznet Museum]
[Download Library]
[How to Use]

BSD SOCKET

ioLibrary BSD Socket
socket() O O
bind() X O
listen() O O
accept() X O
send() & recv() O O
sendto() & recvfrom() O O
select() & poll() X O

WIZnet’s ioLibrary does not support bind() and accept() functions unlike BSD Socket.

In case of the BSD Socket Library, the source port is bound to the socket resource by bind(), as shown in the following figure.
It also waits for the client’s connection-request through accept(). If a client requests a connection, it creates a new socket, binds it to an arbitrary source port, and uses it as a data communication socket.

In the case ofioLibrary, the socket() and bind() functions of BSD Socket are integrated into one socket () function of ioLibrary.

Also, as shown in the following figure, Unlike BSD socket,
ioLibrary socket resource is not dynamically allocated, so accept() function is not necessary since hardwired socket already exists in chip.
That is, the listening socket of ioLibrary always waits for the client’s connection request, and immediately changes its role to the data communication socket when the client’s request is received.
To accept connection requests from multiple clients, create a listen socket for the number of clients.

Despite these differences, the WIZnet chip supports the BSD socket library as shown below.

BSD Socket by using ioLibrary

This Library is a library that included bind() and accept() functions in WIZnet’s ioLibrary .
This function is implemented as an empty function as below code. It just seems to be only compatibile with BSD socket.

The following code will be a more accurate implementation than the above.

[Refer to WIZnet Musuem]
[Download Library]

POSIX BSD Socket

It is the most similar library implemented with POSIX BSD Library and can easily port various applications implemented by BSD Socket Library.
The select(), poll(), and getsockopt() and setsockopt() functions are also implemented. The below code shows bind() as example.

[Refer to WIZnet Musuem]
[Download Library]
[How to Use]