Tutorial.ChatServer History

Hide minor edits - Show changes to output

September 01, 2015, at 04:04 PM by Simone Maiocchi -
Changed lines 1-6 from:
(:div class=breadcrumb:)
[[Tutorial.HomePage | Tutorials]] > [[Tutorial.Examples | Examples]] > Ethernet > ChatServer
(:divend:)

(:*toc:)
to:
(:html:)
<div class="subHeader row">
<div class="breadcrumb columns large-10 medium-10">
<p>
<a class="wikilink" href="/en/Tutorial/HomePage">Tutorials </a>
> <a class="wikilink" href="/en/Tutorial/LibraryExamples"> Examples from Libraries </a> > Ethernet > ChatServer
</p>
</div>
</div>
(:htmlend:)
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:
(:source http://arduino.cc/en/pub/code/master/libraries/Ethernet/examples/ChatServer/ChatServer.ino lang=arduino tabwidth=4:)
to:
(:source https://raw.githubusercontent.com/arduino/Arduino/master/libraries/Ethernet/examples/ChatServer/ChatServer.ino lang=arduino tabwidth=4:)
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:
''Examples > Ethernet Library''

!!!Chat Server


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.

(:div class=BOM :)
!!!Hardware Required
* [[Main/ArduinoEthernetShield | Arduino Ethernet Shield]]
* Shield-compatible Arduino board
to:
(:div class=breadcrumb:)
[[Tutorial.HomePage | Tutorials]] &gt; [[Tutorial.Examples | Examples]] &gt; Ethernet &gt; ChatServer
Added lines 5-17:
(:*toc:)

!!Chat Server


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.

(:div class=BOM :)
!!!Hardware Required
* [[Main/ArduinoEthernetShield | Arduino Ethernet Shield]]
* Shield-compatible Arduino or Genuino board
(:divend:)
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:
!!!See Also:

(:include EthernetSeeAlsoIncludes :)
to:
!!!See also
* [[Main/ArduinoEthernetShield | Arduino Ethernet Shield]] – Product description.
* [[Guide/ArduinoEthernetShield | Getting started with the Ethernet Shield]] – Get everything set up in minutes.
* [[Reference/Ethernet | Ethernet library]] – Your reference for the Ethernet Library.
* [[ChatServer]] - A simple server that distributes any incoming messages to all connected clients.
* [[ChatClient]] – A sketch to connect to a Telnet server
* [[WebClient]] – Query the web and get the answer through the serial monitor
* [[WebClientRepeating ]] - How to make repeated HTTP requests using the Ethernet shield.
* [[WebServer]] - A simple web server that shows the value of the analog input.
* [[DhcpAddressPrinter]] – Get a DHCP address and print it on serial monitor.
* [[DhcpChatServer]] – Connect to a Telnet server and print on serial monitor all the received messages; uses DHCP.
* [[TelnetClient]] - Connect to a Telnet server and print on serial monitor all the received messages
* [[BarometricPressureWebServer]] – Post data read from a pressure sensor using SPI.
* [[UDPSendReceiveString]] - Send and receive text strings via the UDP protocol (Universal Datagram Packet).
* [[UdpNtpClient]] - query a Network Time Protocol (NTP) server and get the information through serial monitor.
\\
''Last revision 2015/08/13 by SM''


November 28, 2011, at 04:31 PM by Scott Fitzgerald -
Changed line 37 from:
(:source http://arduino.cc/en/pub/code/0023/libraries/Ethernet/examples/ChatServer/ChatServer.pde lang=arduino tabwidth=4:)
to:
(:source http://arduino.cc/en/pub/code/master/libraries/Ethernet/examples/ChatServer/ChatServer.ino lang=arduino tabwidth=4:)
November 16, 2011, at 05:11 AM by Scott Fitzgerald -
Changed line 37 from:
(:source http://arduino.cc/en/pub/code/master/libraries/Ethernet/examples/ChatServer/ChatServer.ino lang=arduino tabwidth=4:)
to:
(:source http://arduino.cc/en/pub/code/0023/libraries/Ethernet/examples/ChatServer/ChatServer.pde lang=arduino tabwidth=4:)
November 16, 2011, at 04:27 AM by Scott Fitzgerald -
Changed line 37 from:
(:source http://arduino.cc/en/pub/code/master/libraries/Ethernet/examples/ChatServer/ChatServer.pde lang=arduino tabwidth=4:)
to:
(:source http://arduino.cc/en/pub/code/master/libraries/Ethernet/examples/ChatServer/ChatServer.ino lang=arduino tabwidth=4:)
September 23, 2010, at 05:06 AM by Christian Cerrito -
Changed lines 43-44 from:
(:include EthernetSeeAlsoIncludes :)
to:
(:include EthernetSeeAlsoIncludes :)
September 17, 2010, at 04:35 PM by Tom Igoe -
Changed lines 43-52 from:
* [[Main/ArduinoEthernetShield | Arduino Ethernet Shield]]
* [[Guide/ArduinoEthernetShield | Getting started with the ethernet shield]]
* [[Reference/Ethernet | Ethernet library]]
* [[ChatServer]]
* [[WebClient]]
* [[WebServer]]
* [[PachubeCient]]
* [[BarometricPressureWebServer]]
* [[UDPSendReceiveString]]
* [[UdpNtpClient]]
to:
(:include EthernetSeeAlsoIncludes :)
September 17, 2010, at 04:32 PM by Tom Igoe -
Changed lines 50-51 from:
* [[TwitterClient]]
*[[BarometricPressureWebServer]]
to:
* [[BarometricPressureWebServer]]
* [[UDPSendReceiveString]]
* [[UdpNtpClient]]
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 [[Main/ArduinoEthernetShield | 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:
(:div class=BOM :)
!!!Hardware Required
Added lines 11-41:
* Shield-compatible Arduino board
(:divend:)

!!!Circuit
(:div class=circuit :)

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.

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.

%height=300px%[[Attach:EthernetShield_bb.png | Attach:EthernetShieldF_bb.png]]

[-image developed using [[http://www.fritzing.org |Fritzing]]. For more circuit examples, see the [[http://fritzing.org/projects/|Fritzing project page]] -]

(:divend:)

!!!Schematic
(:div class=circuit :)
%height=300px%[[Attach:EthernetShield_sch.png | Attach:EthernetShield_sch.png]]
(:divend:)

Describe what's going on here

(:div class=code :)
(:source http://arduino.cc/en/pub/code/master/libraries/Ethernet/examples/ChatServer/ChatServer.pde lang=arduino tabwidth=4:)
(:divend:)


!!!See Also:

* [[Main/ArduinoEthernetShield | Arduino Ethernet Shield]]
August 13, 2010, at 03:35 PM by Tom Igoe -
Changed lines 47-53 from:
* [[Reference/Ethernet | Ethernet library]]
to:
* [[Reference/Ethernet | Ethernet library]]
* [[ChatServer]]
* [[WebClient]]
* [[WebServer]]
* [[PachubeCient]]
* [[TwitterClient]]
*[[BarometricPressureWebServer]]
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 [[Main/ArduinoEthernetShield | 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

* [[Main/ArduinoEthernetShield | Arduino Ethernet Shield]]
* [[Guide/ArduinoEthernetShield | Getting started with the ethernet shield]]
* [[Reference/Ethernet | Ethernet library]]

Share