Enthernet Code
Enthernet Code
DIIDevHeads IoT Integration Server
Created by Enthernet Code on 7/4/2024 in #edge-networking
Troubleshooting HTTP POST Error on ESP32 with ADXL335 Accelerometer
Hey guys @Middleware & OS @MCU, MPU & Firmware , I am attempting to set up an ESP32 to collect vibration data using an ADXL335 accelerometer and send it to a server for predictive maintenance analysis. The data should be transmitted over Wi-Fi, I have configured the ESP32 to connect to a Wi-Fi network, set up the ADXL335 accelerometer to read vibration data, wrote code to send the sensor data to a server using HTTP POST requests. But still getting the error
Error on sending POST: -1
Error on sending POST: -1
This is my code
#include <WiFi.h>
#include <HTTPClient.h>
// Wi-Fi credentials
const char* ssid = "TurboNet";
const char* password = "your_PASSWORD";
// Server URL
const char* serverName = "http://your-server.com/post-data";
// ADXL335 pins
const int xPin = A0;
const int yPin = A1;
const int zPin = A2;
void setup() {
    Serial.begin(115200);
    // Connect to Wi-Fi
    WiFi.begin(ssid, password);
    while (WiFi.status() != WL_CONNECTED) {
        delay(1000);
        Serial.println("Connecting to WiFi...");
    }
#include <WiFi.h>
#include <HTTPClient.h>
// Wi-Fi credentials
const char* ssid = "TurboNet";
const char* password = "your_PASSWORD";
// Server URL
const char* serverName = "http://your-server.com/post-data";
// ADXL335 pins
const int xPin = A0;
const int yPin = A1;
const int zPin = A2;
void setup() {
    Serial.begin(115200);
    // Connect to Wi-Fi
    WiFi.begin(ssid, password);
    while (WiFi.status() != WL_CONNECTED) {
        delay(1000);
        Serial.println("Connecting to WiFi...");
    }
6 replies