Every 3 seconds, i'm sending the below JSON where i change the value for the key 'deviceValue'
`{"GetValueResponse":{"deviceValue":"11","id":"asd"}}
it works at the start then it starts showing null values as shown below
15:43:09.372 -> {"GetValueResponse":{"value":"28","id":"asd"}} 15:43:19.512 ->
{"GetValueResponse":{"deviceValue":"20","id":"asd"}} 15:43:29.629 ->
{"GetValueResponse":{"deviceValue":"24","id":"asd"}} 15:43:39.738 ->
{"GetValueResponse":{"deviceValue":"26","id":null}} 15:43:49.875 ->
{"GetValueResponse":{"deviceValue":null,"id":null}} and the rest is as above
{"GetValueResponse":{"deviceValue":null,"id":null}}
this is the code that i'm using
`StaticJsonDocument<400> getValueJsonRequest;
JsonObject getObject = getValueJsonRequest.createNestedObject("GetValue");
void setup(){
getObject["value"] = String(random(0, 30));
getObject["id"] = id;
getValueJsonRequest.add(getObject);
}
void loop(){
getObject["value"] = String(random(0, 30));
Serial.println(getValueJsonRequest.as
delay(2000);
}`
it worked thanks @bblanchon for your help
You're welcome @HilalAH.
Thank you for using the library.
Don't forget to star the project to show you support ;-)