Tutorial.ChatServer History

Show minor edits - Show changes to markup

September 01, 2015, at 04:04 PM by Simone Maiocchi -
Changed lines 1-6 from:
to:
August 13, 2015, at 01:00 PM by Simone Maiocchi -
Added line 14:
  • Arduino or Genuino Board
Deleted line 15:
  • Shield-compatible Arduino or Genuino board
August 13, 2015, at 12:41 PM by Simone Maiocchi -
Deleted line 49:
  • ChatClient – A sketch to connect to a Telnet server
August 13, 2015, at 12:03 PM by Simone Maiocchi -
Changed line 41 from:
to:
August 13, 2015, at 11:50 AM by Simone Maiocchi -
Changed line 49 from:
  • ChatServer - A simple server that distributes any incoming messages to all connected clients.
to:
  • AdvancedChatServer - A server that distributes any incoming messages to all connected clients except the one sending it.
August 13, 2015, at 11:47 AM by Simone Maiocchi -
Changed lines 1-11 from:
to:
Added lines 5-17:
Changed lines 21-22 from:

The Ethernet shield allows you to connect a WizNet Ethernet controller to the Arduino via the SPI bus. It uses pins 10, 11, 12, and 13 for the SPI connection to the WizNet. Later models of the Ethernet shield also have an SD Card on board. Digital pin 4 is used to control the slave select pin on the SD card.

to:

The Ethernet shield allows you to connect a WizNet Ethernet controller to the Arduino or Genuino boards via the SPI bus. It uses pins 10, 11, 12, and 13 for the SPI connection to the WizNet. Later models of the Ethernet shield also have an SD Card on board. Digital pin 4 is used to control the slave select pin on the SD card.

Changed lines 29-30 from:

In the above image, the Arduino would be stacked below the Ethernet shield.

to:

In the above image, the Arduino or Genuino board would be stacked below the Ethernet shield.

Changed line 38 from:

Code:

to:

Code:

Changed lines 45-48 from:
to:

See also


Last revision 2015/08/13 by SM

November 28, 2011, at 04:31 PM by Scott Fitzgerald -
Changed line 37 from:
to:
November 16, 2011, at 05:11 AM by Scott Fitzgerald -
Changed line 37 from:
to:
November 16, 2011, at 04:27 AM by Scott Fitzgerald -
Changed line 37 from:
to:
September 23, 2010, at 05:06 AM by Christian Cerrito -
Changed lines 43-44 from:
to:
September 17, 2010, at 04:32 PM by Tom Igoe -
Changed lines 50-51 from:
to:
August 16, 2010, at 03:19 PM by Tom Igoe -
August 15, 2010, at 02:51 PM by Tom Igoe -
August 15, 2010, at 02:51 PM by Tom Igoe -
Changed line 29 from:

Schematic

to:

Schematic

August 15, 2010, at 03:53 AM by Christian Cerrito -
Changed lines 6-7 from:

A simple server that distributes any incoming messages to all connected clients. To use, open a terminal window, telnet to your devices IP address, and type away. Any incoming text will be sent to all connected clients (including the one typing). Additionally, you will be able to see the clients input in your serial monitor as well.

to:

A simple server that distributes any incoming messages to all connected clients. To use, open a terminal window, telnet to your devices IP address, and type away. Any incoming text will be sent to all connected clients (including the one typing). Additionally, you will be able to see the client's input in your serial monitor as well.

August 15, 2010, at 03:52 AM by Christian Cerrito -
Changed lines 6-7 from:

A simple server that distributes any incoming messages to all connected clients. To use, telnet to your devices IP address and type. Any incoming text will be sent to all connected clients (including the one typing). Additionally, you will be able to see the clients input in your serial monitor as well.

to:

A simple server that distributes any incoming messages to all connected clients. To use, open a terminal window, telnet to your devices IP address, and type away. Any incoming text will be sent to all connected clients (including the one typing). Additionally, you will be able to see the clients input in your serial monitor as well.

Changed line 34 from:

Describe what's going on here

to:

Code:

August 15, 2010, at 03:49 AM by Christian Cerrito -
Changed lines 6-7 from:

A simple server that distributes any incoming messages to all connected clients. To use telnet to 10.0.0.177 and type! Any incoming text will be sent to all connected clients (including the one typing).

to:

A simple server that distributes any incoming messages to all connected clients. To use, telnet to your devices IP address and type. Any incoming text will be sent to all connected clients (including the one typing). Additionally, you will be able to see the clients input in your serial monitor as well.

August 15, 2010, at 03:36 AM by Christian Cerrito -
Changed lines 25-26 from:

In the above image, the Arduino would be connected below the Ethernet shield.

to:

In the above image, the Arduino would be stacked below the Ethernet shield.

August 15, 2010, at 01:39 AM by Christian Cerrito -
Changed lines 25-26 from:

'In the above image, the Arduino would be connected below the Ethernet shield.''

to:

In the above image, the Arduino would be connected below the Ethernet shield.

August 15, 2010, at 01:38 AM by Christian Cerrito -
August 14, 2010, at 10:02 PM by Christian Cerrito -
Added lines 25-26:

'In the above image, the Arduino would be connected below the Ethernet shield.''

August 13, 2010, at 03:41 PM by Tom Igoe -
August 13, 2010, at 03:37 PM by Tom Igoe -
Changed lines 3-4 from:

Chat Server

to:

Chat Server

Changed lines 8-45 from:

Circuit

An Arduino board with a Arduino Ethernet Shield. The shield should be connected to a network with an ethernet cable. You will need to change the network settings in the program to correspond to your network.

Code

#include <Ethernet.h>

// network configuration.  gateway and subnet are optional.
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 10, 0, 0, 177 };
byte gateway[] = { 10, 0, 0, 1 };
byte subnet[] = { 255, 255, 0, 0 };

// telnet defaults to port 23
Server server(23);

void setup()
{
  // initialize the ethernet device
  Ethernet.begin(mac, ip, gateway, subnet);

  // start listening for clients
  server.begin();
}

void loop()
{
  Client client = server.available();
  if (client) {
    server.write(client.read());
  }
}

See also

to:
Added lines 11-41:
August 13, 2010, at 03:35 PM by Tom Igoe -
Changed lines 47-53 from:
to:
November 01, 2008, at 02:42 PM by David A. Mellis -
Added lines 1-47:

Examples > Ethernet Library

Chat Server

A simple server that distributes any incoming messages to all connected clients. To use telnet to 10.0.0.177 and type! Any incoming text will be sent to all connected clients (including the one typing).

Circuit

An Arduino board with a Arduino Ethernet Shield. The shield should be connected to a network with an ethernet cable. You will need to change the network settings in the program to correspond to your network.

Code

#include <Ethernet.h>

// network configuration.  gateway and subnet are optional.
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 10, 0, 0, 177 };
byte gateway[] = { 10, 0, 0, 1 };
byte subnet[] = { 255, 255, 0, 0 };

// telnet defaults to port 23
Server server(23);

void setup()
{
  // initialize the ethernet device
  Ethernet.begin(mac, ip, gateway, subnet);

  // start listening for clients
  server.begin();
}

void loop()
{
  Client client = server.available();
  if (client) {
    server.write(client.read());
  }
}

See also

Share