Arduino Ethernet W5100 TCP Setup

Hello All,

I am trying to get started with the Ethernet W5100.
I would like to use TCP IP communication to receive and send messages with VVVV or Python.

I have found examples for UDP data setup, but not a simple TCP setup.

I am not trying to get information from a website or anything kind of online server. I am just trying to send a string from a computer program to the arduino and have the arduino send back another string.

This post below was the most clear example I could find, although it does not seem to be TCP either.

Thank you in advance for the help! I tried to find existing information online before posting. I am quite surprised that the TCP functionality of the W5100 is not well documented.

Kind regards,

I am basically just looking for a "Hello World" like example for TCP IP.

Ok, I think I have this partially working now. I stripped down the code from the example in the link and got "Hello world" sending, receiving and printing.

If anyone has comments on how this could be improved, please advise.

 *  Print message received from TCP IP server in Serial Monitor ("Hello World" - TCP IP)
 *  (With parts borrowed/stolen from Nick Gammon & Michael E. Landon)
#include <Ethernet.h>

// Set values below to match your network needs:
byte mac[] = {0x54, 0x52, 0x49, 0x41, 0x44, 0x00};   // MAC Address
byte ip[] = {192, 168, 2, 99};                       // Network Address
byte gateway[] = {192, 168, 0, 1};                   // Gateway Address
byte subnet[] = {255, 255, 0, 0};                    // Subnet Mask
EthernetServer server(4444);                         // Set Server Port
EthernetClient client;                               // Define client

void setup() {
  // put your setup code here, to run once:
  Ethernet.begin(mac, ip, gateway, subnet);          // Start the Ethernet connection


void loop() {
  char inByte;                                      // Set up a character buffer to grab the input
  client = server.available();                      // Check for server availability
    client = server.available();                    // Read the character in the buffer

      inByte =;
      if (inByte == 13){                            //CarriageReturn
        Serial.print(inByte);                       //Print "Hello World" 

This does take a loooooonnnnnngggg time to start receiving messages... like ~20 seconds
I am not sure if this is a problem on the sending or receiving end.

I have the client setup and ready to send before I start the arduino.

After the delayed start, seems the data is always showing in the monitor much later than when sent.

I can slow down the sending so that the arduino catches up with its serial printing, but the starting connection still takes a long time for some reason.