Telnet Client on ESP

Hi,
I’m looking for a way to send telnet commands via an ESP32 or ESP8266.

Background:
My Denon AVR acts as a telnet server. Via Putty or Raspberry Pi I can send telnet commands like “PWON” to switch on the AVR. My objective is to control the AVR by using an ESP (and Blynk app).

There are several examples which show how to use an ESP as telnet server. But there are no examples of how to use it as a client.
Is there any library for that purpose?

1 Like

I did a topic a year ago :shushing_face:

Thanks. Indeed I saw your topic. Unfortunately I believed it’s only about ther server side.
The problem is solved. Actually it was pretty easy:

//Telnet AVR
//*#####################################################################
IPAddress AVR(192,168,2,32);
WiFiClient client;
char lcdon[] = "DIM DAR";
char lcdoff[] = "DIM OFF";
int lcd;

BLYNK_WRITE(V50) {
  AVRlcd();
}

void AVRlcd()  {
  if (client.connect(AVR, 23)) {
    if (lcd == 1) {
      client.println(lcdoff);
      lcd = 0;
    } else {
      client.println(lcdon); 
      lcd = 1;
    }
  }
  client.stop();
  Blynk.virtualWrite(V50, lcd);
}
1 Like