Sending data from an Android app to the ESP32 over the IoT

Thread Starter


Joined Mar 19, 2022
I am still very new to working with MCUs and Android development so I am sorry if I am unclear with explaining things. I am currently working on a project where I am creating a simple Android application meant to send simple commands to the Esp32. I would like to be able to transfer that data over the IoT, but the research I have done so far suggests that the only way to do that is to set up the Esp as a web server and then have the phone connect manually to the ESP in its WiFi settings. Would there be a way for this to occur automatically? Like the phone is far away on a different WiFi network but then accesses the app and then the is able to send the data to the Esp? Ideally I would like a sort of "login page" that does the following:

1. When first opening the application, you are presented with a login page, but no credentials are needed. It will search for the Esp32 and connect.
2. After the application is connected to the Esp32, the interface will continue to the homepage where you can begin to select your options.

Thank you for any help.


Joined Apr 11, 2010
Your issue is one of understanding networking.

Your app and 8266 need to know each other’s address in order to connect. This is easy in your home where both devices are connected to the same WiFi router. Because they will be on the same network with the same Ethernet IP address properties.

But if you aren’t home, you’ll be on different networks. In your order to talk, both devices will need to have an address that can be routed through the Internet… This isn’t true of all IP addresses. And isn’t likely to be true of both of your devices WiFi connection.

There are ways around this issue, but requires a bit of knowledge. Like static versus dynamic IP addressing, port forwarding, DNS, firewall rules etc. It’s a lot but you don’t have to be an EXPERT in all of these. No CCNE required.

if you’re still interested, I’ll explain further. I’d do it now but I’d like to know your background. And I’m in a cafe eating lunch. First, describe your knowledge of networking and we’ll go from there.