Go Down

Topic: New library TelnetSpy for ESP8266: Clone serial port via telnet (Read 1 time) previous topic - next topic



I'm working with an ESP8266-12F and use ArduinoOTA for a simple sketch update. But for debugging infos I still had to connect the serial port. To get rid of this I wrote TelnetSpy, which clones the data transferred via "Serial" also to a telnet connection. So I can now debug "over the air", too.

Because of a ring buffer you also get the data collected before WiFi and Telnet connection are established. Once connected you can also send data back which is handled as sent via serial port.

Its easy to use:
Add "#include <TelnetSpy.h>" to your sketch,
place "SerialAndTelnet.handle();" as first line into your loop function
and use "SerialAndTelnet" instead of "Serial".

Then you can use i.e. PuTTY for getting a copy of the serial data over the network. The serial port has still its functionality, so you can use both in parallel.

You can find the library here:

Please let me know, if you find bugs or have suggestions/improvements.
I hope this module is helpful (not only for me).



Thanks for your contribution to the Arduino community!

I notice that in your keywords.txt file the keyword/identifier separator used for all keywords except SerialAndTelnet is a space rather than tab. The current and all previous IDE versions require that the separator be a tab. However, Arduino IDE 1.8.6 and onward will allow space to be used as a separator. I still think it's a good idea to use tabs since many users tend to stick with whatever IDE version is working fine for them and only update to the latest version when they need a feature or bug fix that it provides. I often see beginners confused thinking something is wrong when the function names of a library are not colored as they expect and this may act as a "red herring" to distract them from the true cause of a problem they are having.

I'm happy to submit a pull request to fix this if you want. I decided it would be better to discuss it here first since it's now debatable whether that would be considered a bug now.


Thank you for your info. Its the first time I offer an Arduino IDE library and I still have to learn to do it right. I updated the file and find that I forgot an entry. Now its complete ....  :)

Go Up