Closed BenJSKM closed 4 years ago
Hi @BenJSKM,
I was going to recommend the ReadBufferingStream
, but I see that you're already using it.
Did you notice an improvement when using the ReadBufferingStream
?
Did you try to increase the size of the buffer?
We need to know if the slowness comes from the Wifi connection or ArduinoJson.
Can you try to read the entire response and then call deserializeJson()
?
Make sure to measure the duration of each operation.
Best regards, Benoit
Hi Benoît, Thanks for your suggestion. First I read the entire reponse and then call deserialization. This solves the problem. The code I added is:
char json[100];
int i = 0;
while (client.available()) {
json[i] = client.read();
i++;
}
i++;
json[i] = '\0';
I don't know if this is the best way to do it, but it works. Best regards, Ben
Hi Ben,
You made me realize that ReadBufferingStream sometimes waits for a timeout when it shouldn't. I fixed it in this branch. It should now give a performance equivalent to the code above.
Please give it a try! I'm waiting for your feedback before merging the branch.
Best regards, Benoit
Hi Benoît, It works very good. Thank you, Best regards, Ben
Hello Benoît, Thank you very much for your great library and very good book! I'm trying to use the ESP8266 to control the ADF4351 (VCO with integrated PLL). The following code compiles without errors and works. But the deserialization is very slow, the steps before happen instantly. It takes about 4 seconds to deserialize. This is to slow because I like to process multiple requests per second. I can't figure out what I'm doing wrong. I hope you help with this issue. Best regards, Ben