Can someone help me please, I have attached the code I am trying use to POST some sensor data in emoncms.org. The code complies properly, runs ok and 200 is returned when post is made but no data is posted into the inputs. If I try the example code, paste into a browser that works. The print out of the http message from my code looks exactly like the sample string. Can some please tell me what is wrong with my code, it is basically copied from the emonESP code but greatly cut down.
// construct emon string
const char *post_path = "/input/post?";
const char *emoncms_path = "http://emoncms.org";
const char *emoncms_node = "testNode4";
const char *emoncms_apikey = "5e04fee2ddb486aab161f01fdxxxxx";
StaticJsonDocument<512> doc;
doc["sensor"] = "BME280";
doc["value1"] = 24.89;
doc["value2"] = 59.95;
doc["value3"] = 1004.18;
String json;
serializeJson(doc, json);
String url = emoncms_path;
url += post_path;
url += F("node=");
url += emoncms_node;
url += F("&fulljson=");
// url += urlencode(json); no diference, nothing in inputs. looks different to example of same format
url += json;
url += F("&apikey=");
url += emoncms_apikey;
int httpResponseCode = http.POST(url);
if (httpResponseCode > 0)
{
String response = http.getString();
Serial << "\nResponse code = " << (httpResponseCode) << "\n";
Serial << "Response string = " << (response) << '\n';
}
http.end();
}