One simple thing is to use it as a debugger console.
Many of us use the serialprintln command as a way to display debug information during the development of a basic program; this reaches the limits when the serial port is required to interface with some piece of HW.
One simple idea is to use the UDP to "print" the messages on the network recovering them with a simple utility.
I developed for that a little utility available here https://github.com/cicciocb/UDP_tester/ ... e?raw=true
This is a picture of the utility running on my PC
As you can see, the local IP of my computer is 192.168.1.69 and is listening on the port 5001 (localport)
So, to send a message to my PC from the ESP the command is
udpwrite "192.168.1.69", 5001, "message"
for example this simple ESPBasic program :
for i = 1 to 1000
udpwrite "192.168.1.69", 5001, str(i)
next i
gives this result on the utility
If you want also be able to modify "dynamically" the value of a variable, your program will become :
'listening port
udpbegin 5001
ret = ""
'where the program will branch on UDP message reception
udpbranch [udp]
for i = 1 to 10000
udpwrite "192.168.1.69", 5001, str(i)
serialprintln ret
next i
end
[udp]
ret = udpread()
if ret = "stop" then end
return
This example runs for 10000 cycles printing the value of the var 'ret' that is initially empty.
We can use now the Utility to send a message toward the ESP.
To do that, we can simply write the message in "Message to Send" and click 'Send'; the message will be printed on the serial port.
As the address is automatically configured as broadcast, you don't need to put the exact IP of the ESP module.
As you may have noted, typing 'stop' will interrupt the basic program; this is very useful when the program fall into an endless loop obliging to reset the module.
Hoping this will be useful to someone.
CiccioCB