# Help With ESP32C3 when placed outside doesn't POST HTTP

**URL:** <https://forum.arduino.cc/t/help-with-esp32c3-when-placed-outside-doesnt-post-http/1407153>\
**Category:** General Guidance\
**Created:** [September 22, 2025, 12:22pm UTC](https://forum.arduino.cc/t/help-with-esp32c3-when-placed-outside-doesnt-post-http/1407153 "2025-09-22T12:22:40Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![intellimination\_dev](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/intellimination_dev/32/1238022_2.png) [@intellimination\_dev](https://forum.arduino.cc/u/intellimination_dev)\
**Post date:** [September 22, 2025, 12:22pm UTC](https://forum.arduino.cc/t/help-with-esp32c3-when-placed-outside-doesnt-post-http/1407153/1 "2025-09-22T12:22:40Z")

</div>

Hello! I need help with my ESP32C3, My ESP32C3 suddenly doesn't want to send json http POST to my homeserver when placed outside, I confirmed my Wi-Fi device list and it is still connected, I tried my ESP01 and it works outside, but my ESP32C3 doesn't want to send data, can someone help me out?

Code:

```arduino
#include <Wire.h>
#include <Adafruit_BME280.h>
#include <WiFi.h>
#include <HTTPClient.h>

#define SEALEVELPRESSURE_HPA (1013.25)

Adafruit_BME280 bme;
bool bmeConnected = false;
float latestTemp, latestPressure, latestHumidity;

const char* ssid = " ********";
const char* password = " ************";
const char* serverUrl = "http://192.168.1.19:4030/pwst/receive/PWSTDN";
const char* stationName = "PWSTDN";

void setup() {
  Serial.begin(115200);
  Wire.begin(8, 9); // SDA=8, SCL=9 for ESP32-C3

  // Initialize BME280 sensor
  if (!bme.begin(0x76)) {
    Serial.println(F("BME280 not found!"));
  } else {
    bmeConnected = true;
    bme.setSampling(Adafruit_BME280::MODE_NORMAL,
                    Adafruit_BME280::SAMPLING_X2, // Temperature
                    Adafruit_BME280::SAMPLING_X16, // Pressure
                    Adafruit_BME280::SAMPLING_X16, // Humidity
                    Adafruit_BME280::FILTER_X16,
                    Adafruit_BME280::STANDBY_MS_500);
  }

  // Connect to WiFi
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.println(F("Connecting to WiFi..."));
  }
  Serial.println(F("WiFi connected"));
}

void loop() {
  readBME280Data();
  sendSensorData();
  delay(60000); // Send data every 60 seconds
}

void readBME280Data() {
  if (bmeConnected) {
    latestTemp = bme.readTemperature();
    latestPressure = bme.readPressure() / 100.0F;
    latestHumidity = bme.readHumidity();
  } else {
    latestTemp = 0.0;
    latestPressure = 0.0;
    latestHumidity = 0.0;
  }
}

void sendSensorData() {
    const int maxRetries = 3; // Max attempts
    const int retryDelayMs = 3000; // Wait 3 seconds between retries

    if (WiFi.status() != WL_CONNECTED) {
        Serial.println(F("WiFi disconnected"));
        return;
    }

    String jsonPayload = "{";
    jsonPayload += "\"station\":\"" + String(stationName) + "\"";
    if (bmeConnected) {
        jsonPayload += ",\"temp\":" + String(latestTemp, 1);
        jsonPayload += ",\"pressure\":" + String(latestPressure, 1);
        jsonPayload += ",\"humidity\":" + String(latestHumidity, 1);
    } else {
        jsonPayload += ",\"temp\":null";
        jsonPayload += ",\"pressure\":null";
        jsonPayload += ",\"humidity\":null";
    }
    jsonPayload += "}";

    Serial.println(jsonPayload); // Print the JSON payload to Serial

    int attempt = 0;
    bool success = false;

    while (attempt < maxRetries && !success) {
        HTTPClient http;
        http.begin(serverUrl);
        http.addHeader("Content-Type", "application/json");
        http.setConnectTimeout(10000); // 10 seconds timeout

        int httpResponseCode = http.POST(jsonPayload);

        if (httpResponseCode > 0) {
            Serial.printf("HTTP Response code: %d\n", httpResponseCode);
            success = true;
        } else {
            Serial.printf("HTTP request failed, attempt %d/%d\n", attempt + 1, maxRetries);
            delay(retryDelayMs);
        }

        http.end();
        attempt++;
    }

    if (!success) {
        Serial.println(F("All HTTP request attempts failed"));
    }
}

```

I hid my wifi and password 🙂

Code that my ESP01 uses:

```arduino
void sendSensorData() {
  String jsonPayload = "{\"temp\":";
  jsonPayload += String(latestBmeTemp, 1);
  jsonPayload += ",\"pressure\":";
  jsonPayload += String(latestPressure, 1);
  jsonPayload += ",\"humidity\":";
  jsonPayload += String(latestHumidity, 1);
  jsonPayload += ",\"rain\":\"";
  jsonPayload += isRaining ? "Yes" : "No";
  jsonPayload += "\"}";

  String server = extractHost(serverUrl);
  String path = extractPath(serverUrl);
  
  Serial.println(F("Establishing TCP connection..."));
  String tcpCmd = "AT+CIPSTART=\"TCP\",\"" + server + "\",4030";
  
  // Retry TCP connection up to 3 times
  for (int i = 0; i < 3; i++) {
    String response = sendATCommand(tcpCmd, 5000);
    if (response.indexOf("OK") != -1) {
      Serial.println(F("TCP connected"));
      break;
    }
    if (response.indexOf("ALREADY CONNECTED") != -1) {
      Serial.println(F("Already connected, closing..."));
      sendATCommand("AT+CIPCLOSE", 1000);
      delay(500);
    }
    Serial.println(F("TCP failed, retrying..."));
    delay(1000);
    if (i == 2) {
      Serial.println(F("TCP connection failed after retries"));
      return;
    }
  }

  // Prepare HTTP request
  String httpRequest = "POST " + path + " HTTP/1.1\r\n";
  httpRequest += "Host: " + server + "\r\n";
  httpRequest += "User-Agent: Arduino/1.0\r\n";
  httpRequest += "Content-Type: application/json\r\n";
  httpRequest += "Content-Length: " + String(jsonPayload.length()) + "\r\n";
  httpRequest += "Connection: close\r\n\r\n";
  httpRequest += jsonPayload;

  Serial.println(F("Sending data..."));
  String response = sendATCommand("AT+CIPSEND=" + String(httpRequest.length()), 2000);
  
  // FIXED: Proper prompt detection
  if (response.indexOf('>') != 40) {
    sendATCommand(httpRequest, 5000);
    
    // FIXED: Wait for SEND OK confirmation
    unsigned long start = millis();
    String sendResponse = "";
    while (millis() - start < 5000) {
      while (espSerial.available()) {
        char c = espSerial.read();
        sendResponse += c;
        if (sendResponse.indexOf("SEND OK") != -1) break;
      }
      if (sendResponse.indexOf("SEND OK") != -1) break;
    }
    
    if (sendResponse.indexOf("SEND OK") != -1) {
      Serial.println(F("Data sent successfully"));
    } else {
      Serial.println(F("Send confirmation missing"));
      Serial.print(F("Response: "));
      Serial.println(sendResponse);
    }
  } else {
    Serial.println(F("Send prompt missing"));
  }

  // FIXED: Only close connection if still open
  delay(100);
  if (sendATCommand("AT+CIPSTATUS", 500).indexOf("CONNECT") != 5) {
    Serial.println(F("Closing connection..."));
    sendATCommand("AT+CIPCLOSE", 1000);
  }
}

```

---

<div class="post-metadata">

**Author:** ![gilshultz](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gilshultz](https://forum.arduino.cc/u/gilshultz)\
**Post date:** [September 22, 2025, 2:18pm UTC](https://forum.arduino.cc/t/help-with-esp32c3-when-placed-outside-doesnt-post-http/1407153/4 "2025-09-22T14:18:54Z")

</div>

Post an annotated schematic of your system. Show all connections, power, ground and power sources. Note any leads over 25cm/10”/

---

<div class="post-metadata">

**Author:** ![ua6em](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ua6em/32/930389_2.png) [@ua6em](https://forum.arduino.cc/u/ua6em)\
**Post date:** [September 22, 2025, 5:34pm UTC](https://forum.arduino.cc/t/help-with-esp32c3-when-placed-outside-doesnt-post-http/1407153/5 "2025-09-22T17:34:30Z")

</div>

These devices have a very poor antenna, real range in the open is about 10 to 15 meters.

---

<div class="post-metadata">

**Author:** ![kenb4](https://avatars.discourse-cdn.com/v4/letter/k/bb73d2/32.png) [@kenb4](https://forum.arduino.cc/u/kenb4)\
**Post date:** [September 22, 2025, 6:09pm UTC](https://forum.arduino.cc/t/help-with-esp32c3-when-placed-outside-doesnt-post-http/1407153/6 "2025-09-22T18:09:16Z")

</div>

For any kind of ESP32, set the Core Debug Level -- about half-way down the Tools menu -- to Debug or Verbose instead of None. This will print more messages about what's happening. Re-Upload.

Then compare the `Serial` output from when it is working to when it fails. When it is outside, the easiest way would be with a laptop (that doesn't need WiFi at that moment, but it is an extra data point to compare the connectivity at that spot outside).

ETA: here's a standard bit to print instead of just `"WiFi connected"` that includes the signal strength

```cpp
  Serial.printf("%s connected to %s at %d on %d as ", WiFi.macAddress().c_str(),
                WiFi.SSID(), WiFi.RSSI(), WiFi.channel());
  Serial.println(WiFi.localIP());

```

BTW, the `F()` macro is a no-op on ESP32.

---

<div class="post-metadata">

**Author:** ![Dave\_Lowther](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/dave_lowther/32/1092885_2.png) [@Dave\_Lowther](https://forum.arduino.cc/u/Dave_Lowther)\
**Post date:** [September 23, 2025, 7:08am UTC](https://forum.arduino.cc/t/help-with-esp32c3-when-placed-outside-doesnt-post-http/1407153/7 "2025-09-23T07:08:07Z")

</div>

> [@intellimination\_dev](#):
>
> I tried my ESP01 and it works outside, but my ESP32C3 doesn't want to send data, can someone help me out?

You could print the WiFi signal strength using WiFi.RSSI() for both types of processor to check that signal strength is the problem.

---

<div class="post-metadata">

**Author:** ![6v6gt](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/6v6gt/32/225488_2.png) [@6v6gt](https://forum.arduino.cc/u/6v6gt)\
**Post date:** [September 23, 2025, 8:18am UTC](https://forum.arduino.cc/t/help-with-esp32c3-when-placed-outside-doesnt-post-http/1407153/8 "2025-09-23T08:18:33Z")

</div>

Also look at this to see if you have a board with an antenna/crystal design error. This applies if your board is an ESP32-C3 supermini: [Some stores are selling broken ESP32-C3 Super Mini's - RoryHay.es](https://roryhay.es/blog/esp32-c3-super-mini-flaw)

---

<div class="post-metadata">

**Author:** ![intellimination\_dev](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/intellimination_dev/32/1238022_2.png) [@intellimination\_dev](https://forum.arduino.cc/u/intellimination_dev)\
**Post date:** [September 23, 2025, 3:32pm UTC](https://forum.arduino.cc/t/help-with-esp32c3-when-placed-outside-doesnt-post-http/1407153/9 "2025-09-23T15:32:39Z")

</div>

Thanks, I guess it was the Strength, I don't know why but it still connected, now I'm just gonna solder the antenna cause the ESP32 C3 I bought was actually the Sucky Version. ThX!

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [September 23, 2025, 5:15pm UTC](https://forum.arduino.cc/t/help-with-esp32c3-when-placed-outside-doesnt-post-http/1407153/10 "2025-09-23T17:15:04Z")

</div>

If you need to replace the board, the XIAO ESP32C3 has a socket for an external antenna. The small stick-on antenna sold with the XIAO is better than the built-in antenna on most boards, plus you can always attach a much higher gain antenna if you need more range.

---

<div class="post-metadata">

**Author:** ![6v6gt](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/6v6gt/32/225488_2.png) [@6v6gt](https://forum.arduino.cc/u/6v6gt)\
**Post date:** [September 23, 2025, 5:38pm UTC](https://forum.arduino.cc/t/help-with-esp32c3-when-placed-outside-doesnt-post-http/1407153/11 "2025-09-23T17:38:10Z")

</div>

> [@intellimination\_dev](#):
>
> the ESP32 C3 I bought was actually the Sucky Version.

Maybe you could include a picture (and even better a vendor link) of your board. That may help future users who encounter the same problem.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [March 22, 2026, 5:38pm UTC](https://forum.arduino.cc/t/help-with-esp32c3-when-placed-outside-doesnt-post-http/1407153/12 "2026-03-22T17:38:50Z")

</div>

Closed on March 22, 2026, 5:38pm UTC

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