- Mon Nov 09, 2020 4:12 pm
#89373
never used AT commands
so had to get a quick read of
https://www.espressif.com/sites/default/files/documentation/4b-esp8266_at_command_examples_en.pdfnot really sure I understood your setup and what you are doing
so this is just my guess, and I
may be wrongyou establish a UDP trasmission between the ESP and your APP
then
you can send data from the ESP to the APP
but you can also send data from the APP to the ESP
because using UDP the ESP and the APP are just peers, anyone can start sending data
when you establish a TCP connection between the ESP (client) and your APP (server)
you can send data from the ESP (client) to the APP (server)
but you cannot send data from the APP (server) to the ESP (client) cause the ESP "cannot grab a port"
this is because TCP is a connection-oriented protocol while UDP is connection-less
the server is not expected to send data to the client if not requested by the client itself
and the client is not expecting incoming information that it didn't request
if you want to move data from your APP to your ESP using TCP you have two options:
you keep your current setup: APP is the server and your ESP is a client, then the ESP asks for information to the APP
you change the setup: the ESP works as a server and the APP is the client and then the APP can send information to the APP (not sure if you can make the ESP work as a server using AT commands cause I never used them)
https://github.com/quackmore