is there a way to send data to esp8266 from client via websocket on local network then if not in local network connect to mqtt?
What is "client" in this context? The ESP8266? What is a local network? "Connect to MQTT" from the ESP8266?
esp8266 is websocket server then android app is client
local network is wifi router
another point I tried mDNS to avoid using ip address but android app not connected to esp8266 according to your experience is there any solution?
That's a question for the developer of the Android App, it's not an Arduino programming question?
Why not just always use MQTT? Then it will work regardless of which network the Android is using connected to.
in some places maybe not internet line so want to use local network but there is an issue with ip address maybe changed
Have a local WiFi network without internet access through the gateway is a pretty unusual circumstance.
in some places internet no good so want to just connect websocket without mqtt, so I can not connect android client with esp8266 server with mDNS I want to use mDNS instead of ip because maybe changed if router switched off & on
Do I understand that correctly? You want to build a device based on the ESP8266. You want to be able to request some data from it from your Android device by WiFi. That WiFi network isn't installed in a fixed location but moved around (as it sometimes has Internet access, sometimes it hasn't). I don't see at the moment at which situation MQTT should be used. Is it possible that the Android is moved to another network? In that case you have a problem because you don't have constant Internet access on the ESP8266.
May we ask what project we're talking about? Maybe we have a solution for the problem but we don't have a solution for the problems you construct by trying to solve it the wrong way.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.