1

I am new to ESP programming on Arduino, as before I was developing on eLua. There were some memory problems in Lua, so I decided to move to Arduino.

After looking at some examples, I found a library called AsyncTCP and I was very glad because it provides callbacks for events just like Lua. But I was very disappointed when I found no example of an async TCP server. Instead there is an AsyncWeb Server but I don't want to use an HTTP server: I want a simple telnet server. Does someone have a working example?

2

There are examples in the ESP8266 library

https://github.com/me-no-dev/ESPAsyncTCP/tree/master/examples

| improve this answer | |
1

If there are no examples provided with the library then you will have to make do with the example you have :(

If you think about what a web server does it is really just a glorified Telnet server without proper security. When the web server comes up it creates a waiting socket on port 80, you want port ?? (too long ago). It sits there waiting for text messages from clients, which is what you want to do. Every time it receives a message it sends it to a handler.

I don't know how experienced a programmer you are, but you should be able to pick up enough from the webserver code to write your own telnet server. However with you being new to Arduino you may be much better doing it as a synchronous application to start with.

Another approach is to find a the source for a telnet server and see if you can port that to the ESP.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.