Remote control of ESP8266 from anywhere

Hello,

I am working on a project that needs to use ESP8266 module to receive commands from (possibly) multiple users, meaning from website or mobile app. One ESP can receive commands from multiple clients, but not vice versa. I am having a hard time choosing the right option. Here are some of my proposed solutions and problems coming along with them:

  1. Should I use ESP as a web server, or would a better option be having a website?
    Main con that I see with ESP web server is that there would probably have to be port forwarding or other additional settings. This is strongly undesirable, as I want the project to be as much "plug and play" as possible.
    Speaking against remote website, I am not sure if it is possible to receive commands continuously, if the ESP is connected to a website as a client.

  2. Is MQTT protocol really a bad idea?
    I was thinking about integrating MQTT cloud and using ESP as a subscriber and client devices as publishers. However, the communication will almost always be one-to-one, at most 2 or 3 to one (meaning 2-3 client devices to 1 ESP), which makes the whole MQTT purpose kind of useless. Additionally, multiple client-ESP connections need to be separated from one another, which would probably cause more problems.

  3. Other alternatives?
    I know there are some other alternatives to port forwarding, in case I want to use ESP as a web server, for example long polling or UPnP, but I am not really sure, whether these are the right options (in terms of security, reliability, etc.). Anything else worth trying that I missed?

Personally, remote website seems like the better option to me, but obviously it is not the best to send server requests for commands from clients all the time. What do you think? Thanks a lot for every advice.

" but not vice versa."

Can you explain a little more what you are talking about there?

zoomkat:
" but not vice versa."

Can you explain a little more what you are talking about there?

Sure, I mean that one client sends commands to only one ESP.

veselva6:
Sure, I mean that one client sends commands to only one ESP.

I would think a client can make a request to any servers it is programmed to connect to. Maybe put the "client connect" in conditional statements that will determine which servers are connected to based on the condition.

zoomkat:
I would think a client can make a request to any servers it is programmed to connect to. Maybe put the "client connect" in conditional statements that will determine which servers are connected to based on the condition.

That is a good suggestion, thank you. Do you have some solution to the other problems, too?

veselva6:
That is a good suggestion, thank you. Do you have some solution to the other problems, too?

Specifically what problem(s)?

zoomkat:
Specifically what problem(s)?

Do you think it is possible to use remote website to send commands to ESP (where ESP would be a client)? If so, would I have to regularly send requests from ESP to website to check if there are any new commands, or is there any better solution?

veselva6:
Do you think it is possible to use remote website to send commands to ESP (where ESP would be a client)? If so, would I have to regularly send requests from ESP to website to check if there are any new commands, or is there any better solution?

Just to kind of get back to basics, typical “websites” are “servers” that respond to “client” request, and generally don’t send client request themselves. Transfer of data generally follows the client/server format. Getting data from a remote server will depend on how the server is setup, and typically requires a client request. If there is a need, both client and server code can be run at the same time on an arduino with appropriate network hardware.