I am using a custom build from http://nodemcu-build.com/ , and is running on ESP-01
NodeMCU custom build by frightanic.com
build built on: 2015-12-18 03:59
powered by Lua 5.1.4 on SDK 1.4.0
When I used it with an older 0.9.6 firmware I did not encounter this problem.
I inserted a UART write in the s_output(str) function for debugging and noticed that this function receives the contest string and the end-of-line character in two separate calls. This might be fine with default UART, but I think is quite unreasonable for redirected TCP communications??
Is this a problem with the nodeMCU net library or should I implement some sort of buffer and waiting mechanism for the telnet server myself??
My telnet code:
c:send(str, function() uart.write(0,"*sent\n") end)
-- re-direct output to function s_ouput.
--unregist redirect output function, output goes to serial
print("Welcome to NodeMCU world.")
print("Hello world 1")
print("Hello world 2")
print("Hello world 3")
And on my laptop I wrote a node.js script to show what is received (only the first line):
From Socket:192.168.0.105 : 23
Welcome to NodeMCU world.
The same issue is there for Win7 telnet and also an android telnet app.