Skip to content
  • Home
  • Aktuell
  • Tags
  • 0 Ungelesen 0
  • Kategorien
  • Unreplied
  • Beliebt
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Standard: (Kein Skin)
  • Kein Skin
Einklappen
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. English
  3. Cloud services
  4. Simple_api adapter syntax problem with esp32

NEWS

  • Weihnachtsangebot 2025! 🎄
    BluefoxB
    Bluefox
    22
    1
    1.1k

  • UPDATE 31.10.: Amazon Alexa - ioBroker Skill läuft aus ?
    apollon77A
    apollon77
    48
    3
    9.1k

  • Monatsrückblick – September 2025
    BluefoxB
    Bluefox
    14
    1
    2.4k

Simple_api adapter syntax problem with esp32

Geplant Angeheftet Gesperrt Verschoben Cloud services
2 Beiträge 1 Kommentatoren 642 Aufrufe 1 Watching
  • Älteste zuerst
  • Neuste zuerst
  • Meiste Stimmen
Antworten
  • In einem neuen Thema antworten
Anmelden zum Antworten
Dieses Thema wurde gelöscht. Nur Nutzer mit entsprechenden Rechten können es sehen.
  • kristfrizhK Offline
    kristfrizhK Offline
    kristfrizh
    schrieb am zuletzt editiert von kristfrizh
    #1

    Hii
    I have a project to send data using MQTT and restfull api using simple_api adapter.
    I have succed to send data using post via web browser

    simple api wiki

    Right now, i want to use esp32 with post and get http to sending and receive data.
    I want post the data the same like this in web browser via esp32

    192.168.0.120:8087/set/try_simple_api2?value=2
    

    I have build some code like this but still sent got nothing.

    anyone can help me?
    thank you very much regards

    #include <WiFi.h>
    #include <HTTPClient.h>
    
    const char* ssid = "asdasd";
    const char* password = "asdasd";
    
    const char* serverName = "http://192.168.0.120:8087/";
    unsigned long lastTime = 0;
    
    unsigned long timerDelay = 2000;
    
    void setup() {
      Serial.begin(115200);
    
      WiFi.begin(ssid, password);
      Serial.println("Connecting");
      while(WiFi.status() != WL_CONNECTED) {
        delay(500);
        Serial.print(".");
      }
      Serial.println("");
      Serial.print("Connected to WiFi network with IP Address: ");
      Serial.println(WiFi.localIP());
     
      Serial.println("Timer set to 5 seconds (timerDelay variable), it will take 5 seconds before publishing the first reading.");
    }
    
    void loop() {
    
      if ((millis() - lastTime) > timerDelay) {
    
        if(WiFi.status()== WL_CONNECTED){
          HTTPClient http;
    
          http.begin(serverName);
    
       http.addHeader("Content-Type", "text/plain");
          int httpResponseCode = http.POST("/set/try_simple_api2?value=7");
         
          Serial.print("HTTP Response code: ");
          Serial.println(httpResponseCode);
            
          // Free resources
          http.end();
        }
        else {
          Serial.println("WiFi Disconnected");
        }
        lastTime = millis();
      }
    }
    
    kristfrizhK 1 Antwort Letzte Antwort
    0
    • kristfrizhK kristfrizh

      Hii
      I have a project to send data using MQTT and restfull api using simple_api adapter.
      I have succed to send data using post via web browser

      simple api wiki

      Right now, i want to use esp32 with post and get http to sending and receive data.
      I want post the data the same like this in web browser via esp32

      192.168.0.120:8087/set/try_simple_api2?value=2
      

      I have build some code like this but still sent got nothing.

      anyone can help me?
      thank you very much regards

      #include <WiFi.h>
      #include <HTTPClient.h>
      
      const char* ssid = "asdasd";
      const char* password = "asdasd";
      
      const char* serverName = "http://192.168.0.120:8087/";
      unsigned long lastTime = 0;
      
      unsigned long timerDelay = 2000;
      
      void setup() {
        Serial.begin(115200);
      
        WiFi.begin(ssid, password);
        Serial.println("Connecting");
        while(WiFi.status() != WL_CONNECTED) {
          delay(500);
          Serial.print(".");
        }
        Serial.println("");
        Serial.print("Connected to WiFi network with IP Address: ");
        Serial.println(WiFi.localIP());
       
        Serial.println("Timer set to 5 seconds (timerDelay variable), it will take 5 seconds before publishing the first reading.");
      }
      
      void loop() {
      
        if ((millis() - lastTime) > timerDelay) {
      
          if(WiFi.status()== WL_CONNECTED){
            HTTPClient http;
      
            http.begin(serverName);
      
         http.addHeader("Content-Type", "text/plain");
            int httpResponseCode = http.POST("/set/try_simple_api2?value=7");
           
            Serial.print("HTTP Response code: ");
            Serial.println(httpResponseCode);
              
            // Free resources
            http.end();
          }
          else {
            Serial.println("WiFi Disconnected");
          }
          lastTime = millis();
        }
      }
      
      kristfrizhK Offline
      kristfrizhK Offline
      kristfrizh
      schrieb am zuletzt editiert von
      #2

      @kristfrizh Hii
      i just figured it out
      we don't use post at all with those syntax
      thank you

      1 Antwort Letzte Antwort
      0
      Antworten
      • In einem neuen Thema antworten
      Anmelden zum Antworten
      • Älteste zuerst
      • Neuste zuerst
      • Meiste Stimmen


      Support us

      ioBroker
      Community Adapters
      Donate

      939

      Online

      32.5k

      Benutzer

      81.6k

      Themen

      1.3m

      Beiträge
      Community
      Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
      ioBroker Community 2014-2025
      logo
      • Anmelden

      • Du hast noch kein Konto? Registrieren

      • Anmelden oder registrieren, um zu suchen
      • Erster Beitrag
        Letzter Beitrag
      0
      • Home
      • Aktuell
      • Tags
      • Ungelesen 0
      • Kategorien
      • Unreplied
      • Beliebt
      • GitHub
      • Docu
      • Hilfe