telnet myrouter from arduino

I just got my Ethernet Shield and started off with the Ethernet Telnet example,
I need help ;D :wink:
I want to obtain information from my modem/router through telnet 192.168.1.1:23 (login: admin, password: admin)

I want to launch a command from arduino uno which allows me to obtain the status of my router with the command telnet ($show status) and display the result on a lcd display.
thank you so much :wink:

telnet.png

Did you try starting here? How far did you get? Post your code...,

thanks for your reply, i am new.
this is the first part of the code I made

#include <SPI.h>
#include <Ethernet.h>

EthernetClient host;                                   
String prompt;                                        

void setup () {                                        
  Serial.begin (9600);                                 
  byte mac[] = { 0xDE, 0xAD, 0xEF, 0xEF, 0xFE, 0xFD }; 
  IPAddress ip (192, 168, 1, 253);                     
  Ethernet.begin (mac, ip);                        
  loginhost();                                
}

void loginhost () {                              
  IPAddress hostip (192, 168, 1, 1);           
  if (host.connect (hostip, 23)) {                
    inquiry ();                                    
    host.write ("Admin");                           
    inquiry ();                                     
    host.write ("Admin");                          
    do inquiry ();                                   
    while (!prompt.endsWith ("# "));                   
    host.write ("show status");                    
    do inquiry ();                                  
    while (!prompt.endsWith ("$"));    
  }
//  Serial.println ("HOST READY");              
}

void inquiry () {                                    
  while (host.available () == 0) delay (1);        
  do {                                                
    parse ();                                       
    delay (200);                                   
  }
  while (host.available () > 0);                     
}

Where’s parse? What does...

 do inquiry ();

...do?

Start by modifying the example exactly as it stands, but remove the code that sends from the serial input. Instead send the fixed strings that you need to login to the router. Send one character at a time each time through loop. Do not send the entire command in one go. After sending each character, “wait” for 100ms but still looping round in loop() checking for responses from the telnet client.

You will need to check out the “wait without using delay” and “doing multiple things at once” examples in the tutorials sticky.

thank you so much, ;) ;D I'm starting right away

good evening everyone,
after several nights of testing, I manage to connect to my router through telnet and introduce the login and password using the “finder.find” function but the problem that I cannot display the result at " serial monitor “and execute a”$show status" command

--------result----------
Connection en cours…
192.168.1.11
Connection au modem…
connecté

#include <SPI.h>    
#include <Ethernet.h>
#include <TextFinder.h>

byte mac[] = {
 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,1,11);
IPAddress server(192,168,1,1);

EthernetClient client;
TextFinder finder( client);

const unsigned long requestInterval = 15000;  // delay between requests
unsigned long lastAttemptTime = 0;   // last time you connected to the server, in milliseconds

void setup()
{
 Ethernet.begin(mac, ip);
 Serial.begin(9600);
 Serial.println("Connection en cours...");  
 Serial.println(Ethernet.localIP());
 delay(2000);  
}

void loop()
{
 if (client.connected()) {
  // checke_page();
   if(finder.find("Username: ")){    
     client.println("admin");  
   }
   if(finder.find("Password: ")){    
     client.println("admin");      
   }
   checke_page();
 }
 else if (millis() - lastAttemptTime > requestInterval) {
   // if you're not connected, and two minutes have passed since
   // your last connection, then attempt to connect again:
connectToServer();
 }
}
void checke_page(){
  // from the server, read them and print them:
  if (client.available()) {
        if(finder.find("$")){    
     client.println("show status");      
   }
    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); 
    }
   }
}
void connectToServer() {
 // attempt to connect, and wait a millisecond:
 Serial.println("Connection au modem...");
 if (client.connect(server, 23)) {
   Serial.println("connecté");
    char c = client.read();
   Serial.print(c);
 }
 else {
     Serial.println("erreur de connexion");
 }
 // remettre le compteur a zero pour la prochaine connexion:
 lastAttemptTime = millis();
}

Good evening world of arduino, who can help me, I'm stuck :slightly_frowning_face: