Anything on the Internet

with the Wiznet 5100

This Python program shows how applications usually handle Internet Protocol sockets. On a personal computer running Windows, Linux, BSD, or Android, your program communicates over the Internet by:

  1. calling a socket library function to create a software socket object
  2. binding that socket object to an Ethernet interface provided by the O/S
  3. calling socket functions to send and receive messages through the interface.
It's no problem for a desktop or laptop computer, or these days, even a tablet computer to carry all this software; it's possible for a big ARM or MIPS chip to have these protocols programmed in; it's very difficult to shoehorn that ability into a small 8- or 16-bit embedded processor.

The W5100 has an Ethernet interface and four Internet sockets built in to the chip, and any microcontroller that can host an SPI interface can use them. As an example, I've created an Arduino sketch that hosts a server — a server to ROT-13 encode any messages it receives — on a LAN using the UDP protocol. Although the demo is written as a sketch, It's intended to be adapted into a C program to run on any of the usual 8- or 16-bit embedded processors. There are two files in the wiztalk demo sketch: wiztalk.pde which contains the logic for communication with the W5100, and wiz5100.h which defines all the symbols used in the communication.

The Python program mentioned at the beginning of this article is intended to work with the wiztalk server. The Python program joins up its command-line arguments into a string, sends the string to the server, and prints the encoded result.

The wiztalk Arduino sketch code is available as a .ZIP file.

I've found the WIZ811MJ board that I used in the demo at Sparkfun, or Saelig across the lake in New York, or Creatron if you're in Toronto and in a hurry.

Other links: