Skip to content

nopnop2002/esp-idf-telnet-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

esp-idf-telnet-client

telnet client example for esp-idf.
You can execute remote command via telnet.
I referred to this.

Software requirement

ESP-IDF V4.4/V5.x.
ESP-IDF V5.0 is required when using ESP32-C2.
ESP-IDF V5.1 is required when using ESP32-C6.

Installation

git clone https://github.com/nopnop2002/esp-idf-telnet-client
cd esp-idf-telnet-client/
idf.py set-target {esp32/esp32s2/esp32s3/esp32c2/esp32c3/esp32c6}
idf.py menuconfig
idf.py flash monitor

Configure

You have to set this config value with menuconfig.

  • CONFIG_ESP_WIFI_SSID
    SSID of your wifi.
  • CONFIG_ESP_WIFI_PASSWORD
    PASSWORD of your wifi.
  • CONFIG_ESP_MAXIMUM_RETRY
    Maximum number of retries when connecting to wifi.
  • CONFIG_TELNET_SERVER
    Telnet Server host name or ip address.
  • CONFIG_TELNET_PORT
    Telnet Server ports.
  • CONFIG_TELNET_USER
    Telnet Login User name.
  • CONFIG_TELNET_PASSWORD
    Telnet Login Password.

config-main config-app

Command list

$ cat data/command.txt
#this is example list
>LANG=C
<2
>ls /tmp
<2
>uname -a
<2
>sleep 20
<25
>hogehoge
<2
#Execute exit without exit

Syntax:

#hoge   
 Comment line   
>hoge   
 Remote command   
<sec   
 Waiting time for the command to finish (seconds)   
 Wait this time and execute the next command   

STDOUT

You can see the standard output using a browser.
Unfortunately, Japanese characters are garbled.
stdout

Screen Shot

ScreenShot-1 ScreenShot-2

Task diagram

Telnet-Client