Serial.print to TCP connection
Posted:
Thu Aug 20, 2015 5:32 am
by RogerClark
I'm just curious if there is any existing code to Print to a TCP connection.
i.e remote debugging (well debugging in terms of sending and receiving chars as if it was the serial port ?)
If not, I guess I'll need to write one myself, but it would be less work if someone had already done it
Re: Serial.print to TCP connection
Posted:
Thu Aug 20, 2015 8:55 am
by martinayotte
Hi Roger,
Maybe I've misunderstood your question ...
The WifiClient class is derived from more generic Client class, which is derived from Stream and Print class, a bit like any ther Arduino cores, so if you setup a WifiServer on port 23 for example, you can connect with telnet and have debugging over TCP. It is what I'm doing in my Sketch_Buffet (either my ESP version here, or the one I'm using on STM32).
Re: Serial.print to TCP connection
Posted:
Thu Aug 20, 2015 9:00 am
by kolban
Howdy Roger, in a project I am working upon, I have a need to do just what you suggest ... however, rather than make it appear like a "Serial" port, I was planning on implementing a Telnet server as that would allow an arbitrary telnet client to connect to the ESP8266. Let us see if anyone already has a Telnet server for the ESP8266 and, if not, maybe we can start a Github project to create such a library with an eventual view of submitting it for inclusion to @igrr for the Arduino project.
Neil
Re: Serial.print to TCP connection
Posted:
Thu Aug 20, 2015 9:12 am
by martinayotte
Hi Kolban, it is exactly what I've done in the Sketch_Buffet mentioned above. I've simply took the WifiServer example, change it to port 23, and create a small shell command parser to execute other stuff. Maybe I should lean it and add it to github as a TelnetShell example ...