Connecting iot devices

I have a microcontroller I want to connect it to an application and send requests from the application. I found that it is possible to use http, but http needs the microcontroller and the application to be connected to the same network. This will not work in my project because they will not be connected to the same network at all.
Is there another solution or another way that works in this case?
Please I need the solution quickly.

  WiFiClient client = server.available();
  if (client) {
    Serial.println("New client");
    String request = "";
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        request += c;
        if (c == '\n') {
          if (request.indexOf("GET /") != -1 && request.indexOf("track") != -1) {
            client.println("HTTP/1.1 200 OK");
            client.println("Content-Type: text/html");
            client.println();
            client.println("<html><head><title>WiFi Server</title></head><body><h1>Tracking Request Received!</h1></body></html>");
          }
          break;
        }
      }
    }
    delay(1);
    client.stop();
    Serial.println("Client disconnected");
  }

oh boy. and where your computer seek for the google site or ever? is it hosted by your home internet box? :grin:

please give details about the "microcontroller" you use.

Please note I am not very skilled with http but I used it in an ESP32 to send data to a web app, wich transfer it to a google sheet. And I can swear the google sheet belong to another network than my home wifi!

The microcontroller is esp32.

I'll send the data to a mobile app and website.

may I propose to quote myself?
Here is a link for the project I was talking about. The code contains what I need to connect to the web app

OK thank you so much.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.