As the title says... Chat on...

User avatar
By MK1888
#12135 Right, but it isn't registering a callback function.

Maybe I don't know enough about Lua, but the structure of your functionality doesn't appear to be standard. See the NodeMCU firmware wiki for creating a server and listening to ports.
User avatar
By dpwhittaker
#12156 UDP is a socketless protocol, so it doesn't have to listen for connections like TCP does... the code matches the UDP examples.

UDP also makes no transmission guarantees. It's possible TCP only works because under the hood your TCP stack is resending packets like crazy until one finally gets through.

I know you can't have two different TCP servers running at once... I wonder if starting up the first TCP server is interrupting or shutting down the UDP server?

Have you tried scaling the code back to just printing the message you received and running only that on the esp, and seeing how many packets get through without all the rest of the variables?