i have a XIAO ESP32C3 module. It powers up, connects to my wifi AP, then starts a primitive telnet server that periodically sends out a "1" to any client who connects to it. Then i run windows telnet on my laptop and connect to the ESP32. The telnet client is receiving the "1" every minute. ok.
But i want my laptop to record a timestamp every time it receives the "1" and can't figure out how to trigger a batch program from within windows telnet.
Any ideas? curl, telnet, putty, they can't do it.
try with teraterm terminal emulator
select File>New Connection then TCP/IP then telnet set up host IP etc
Select File>Log enter the filename and set enable timestamp
WOW teraterm is an awesome program but no it couldn't do a timestamp on every incoming byte. i'm also trying to run a batch script with each byte and i don't think there's a terminal program that can do that.
you may have to write your own program - I would use C++, C# or Java but Python is an alternative
you can probably find example telnet code online for various languages
i sure have but it's a lost cause. I'm not a software engineer and every time i find something on github and clone it to my computer, it won't compile. I spend hours looking for updated libraries, repositories that are still alive, invisible dependencies, on n on...
the problem is that telnet is essentially dead and SSH is too complicated. IDEs like Visual Studio always come back with a mountain of prerequisites that i can't figure out. There's always some parts that are too old and others that are too young, it never ends.
ok i found a possible solution using ftp. It don't get any easier than this. i found a 2-line python script that can retrieve a file from a server using the windows command line. So if i run an ftp server on the ESP32, then i should be able to retrieve a batch file from the ESP into a file on my PC and then execute the file, then i'm done.
i just gotta figure out how to compile the python script into an executable exe file....
[later] well it worked. I can request a file from an ftp server and execute a batch if i get one.
the python script is:
`import urllib.request
urllib.request.urlretrieve("ftp://ftp.whatever/welcome.msg", "file.txt")
`
i compiled the script into an executable and can periodically run the exe to check the ESP32 state.