telnet client example for esp-idf.
You can execute remote command via telnet.
I referred to this.
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.
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
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.
$ 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
You can see the standard output using a browser.
Unfortunately, Japanese characters are garbled.