Esp8266 control from anywhere

I am trying to bulid a iot app to control led through relay using esp8266.It work very well if app is connected to same network as esp is connected, if it out of range then it is not working. I need esp to work even with mobile network so any suggestion to make app to control esp with mobile network from anywhere.

Thnks for suggestion.

Read about MQTT. Here you have a very cool mqtt client extension for appinventor.

In addition, the mqtt library on ESP and will work whenever the phone and esp have internet access on any network. You still need an external server called mqtt broker. You will find free.



In order to connect ESP8266 with MIT app inventor and that too from anywhere, I would suggest you MQTT like Patryk_F has suggested. You can try this tutorial, which do the same thing that you need.

Control ESP8266 from anywhere using MQTT MIT app inventor

Hey there,

I have nodemcu v3 with esp8266 . I have uploaded the below code for turn off and on home appliances and make the react expo app and use axios and making http request to nodemcu ip for on off the appliances but when I build and install the apk so after installed the http api which I was using in axios is not accesible due to http security reasons. Can tell any what can I do in this situation or any other way that widly used for communication like these situations ?