Telnet Style TCP Network Interface

Hi, I've been using web interfaces for sensor devices on Arduinos so far, but am wondering if a telnet type session would be more appropriate. Has anyone else done a network interface in their sketch where you can just go like "telnet arduino 1337" and have it echo out sensor readings and accept input that way? Any disadvantages from this technique? Thanks,

David

That is an easier way to implement what you want than actually serving a web page.

The code for that is simpler too. :slight_smile:

I've now implemented this method:

void telnetServer() {

  EthernetClient client = server.available();
 
  if (client) {
 
    String outputString = (String)freq1 + ", " + (String)freq2 + ", " + (String)tsl_sens + ", ";   
    
    client.print(outputString);
    client.println(w);

  }
  
}

This is just called in my main sensor reading loop after each time a sample is taken.

How can I add some code to make it look for a "start" command to start sending data and a "stop" command to make it stop sending data and drop the connection? At the moment it just starts spitting the data out after i send a line to it. Thanks,

David