Setting limit via API #602
Replies: 5 comments 1 reply
-
|
There was an error in the code snippet above that takes me a step forward: The |
Beta Was this translation helpful? Give feedback.
-
|
in Python this works: |
Beta Was this translation helpful? Give feedback.
-
|
my final solution for the ESP32 is: headers / .addHeader() was the missing link... |
Beta Was this translation helpful? Give feedback.
-
|
I had same problem by using curl. Got warning: {"type":"warning","message":"No values found!","code":1002}. #include <ESP8266WiFi.h> const char* ssid = "WLAN"; void setup() { while (WiFi.status() != WL_CONNECTED) { HTTPClient http; String payload = "data={"serial":"11218381xxxx", "limit_type":1, "limit_value":" + String(Limit) + "}"; Serial.println(payload); // for test purposes only if (httpResponseCode > 0) { http.end(); void loop() { |
Beta Was this translation helpful? Give feedback.
-
|
Thanks to Borchi013. It works! I just did this change using sprintf:, because This is workung fine: char payload[200]; // may be oversized |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everybody,
I'm trying to set the inverter limit with another ESP32 using HTTPClient class.
Reading works fine but I'm struggling while setting the inverter limit.
Testing the given cUrl command works fine:
~$ curl -u "admin:password" http://192.168.10.10/api/limit/config -d 'data={"serial":"11418180xxxx", "limit_type":1, "limit_value":50}'but
http.get()on ESP32 always gives '-5' (HTTPC_ERROR_CONNECTION_LOST) as respond in the following code - no matter which String is uncommented:Can anybody set me back on the track?
Thanks.
Edit: URL in
http.begin()correctedBeta Was this translation helpful? Give feedback.
All reactions