How is the TelnetClient example different from the WebClient example? I don't see where telnet comes into place in the TelnetClient example. I have all other ethernet examples working. I believe I'm stuck figuring out this line of code:

// Initialize the EthernetClient library with the IP address and port of the server // that you want to connect to// port 23 is default for telnet; if you're using Processing's ChatServer, use port 10002):

In the comments it appears to be 2 separate statements. We either initialize client to connect to google on port 80 OR

This sketch connects to a a telnet server (http://www.google.com) using an Arduino Wiznet Ethernet shield. You'll need a telnet server to test this with. Processing's ChatServer example (part of the network library) works well, running on port 10002. It can be found as part of the examples in the Processing application, available at http://processing.org/

// Initialize the EthernetClient library with the IP address and port of the server // that you want to connect to// port 23 is default for telnet; if you're using Processing's ChatServer, use port 10002):EthernetServer telnetServer(23); // I ADDEDEthernetClient client; // I ADDED

// Open serial communications and wait for port to open: Serial.begin(9600);

// give the Ethernet shield a second to initialize: delay(1000); Serial.println("connecting...");

// if you get a connection, report back via serial: if (client.connect(server, 80)) { Serial.println("connected"); } else { // if you didn't get a connection to the server: Serial.println("connection failed"); }}

void loop(){ // if there are incoming bytes available // from the server, read them and print them: if (client.available()) { char c = client.read(); Serial.print(c); }

// as long as there are bytes in the serial queue, // read them and send them out the socket if it's open: while (Serial.available() > 0) { char inChar = Serial.read(); if (client.connected()) { client.print(inChar); } }

You want to establish a telnet session with Google? Does that really make sense?

You appear to be mixing code for a telnet server with code for a web server. Why?

What are you really trying to do?

What is the given TelnetClient example trying to do? I just want to run the example with the least changes, such as providing my mac address, ip, and server ip. Maybe there is something more that needs to be added after EthernetClient client; ??

// Initialize the Ethernet client library// with the IP address and port of the server // that you want to connect to (port 23 is default for telnet;// if you're using Processing's ChatServer, use port 10002):EthernetClient client;

This sketch connects to a a telnet server (http://www.google.com) using an Arduino Wiznet Ethernet shield. You'll need a telnet server to test this with. Processing's ChatServer example (part of the network library) works well, running on port 10002. It can be found as part of the examples in the Processing application, available at http://processing.org/

// Initialize the Ethernet client library// with the IP address and port of the server // that you want to connect to (port 23 is default for telnet;// if you're using Processing's ChatServer, use port 10002):EthernetClient client;

// give the Ethernet shield a second to initialize: delay(1000); Serial.println("connecting...");

// if you get a connection, report back via serial: if (client.connect(server, 10002)) { Serial.println("connected"); } else { // if you didn't get a connection to the server: Serial.println("connection failed"); }}

void loop(){ // if there are incoming bytes available // from the server, read them and print them: if (client.available()) { char c = client.read(); Serial.print(c); }

// as long as there are bytes in the serial queue, // read them and send them out the socket if it's open: while (Serial.available() > 0) { char inChar = Serial.read(); if (client.connected()) { client.print(inChar); } }

I'm trying to educate myself, not just brush things off as not important and overlook such examples. I know what telnet is. What is meant by telnet server? Like I mentioned I got thru all other ethernet examples. Why isn't this example using port 23 anywhere in the code? Why does this example have me specify both ip address and server address? Please provide example for both.

Before I move on, please describe a real-world scenario for this TelnetClient example. how does one get into telnet server running daemon? I take it the server(,,,) in the code would be the ip of the telnet server?

Would I be correct to say that if I want to control devices remotely I would need a telnet server? The PC with ArduPower would be the client and the PC used to control from remote location would be the server?

Would I be correct to say that if I want to control devices remotely I would need a telnet server? The PC with ArduPower would be the client and the PC used to control from remote location would be the server?

No. There are other ways to have two computers talk to each other. telnetd monitors one port. httpd monitors a different port. snmpd and popd monitor other ports. Each of these daemons supports different protocols. Which protocol to use depends on the kind of information you want to exchange.

Telnet's only advantage is that is doesn't impose a protocol. That it doesn't is also it's biggest security risk. If a client can tell the server to do anything, security just flew out the window.