WeatherDuino Forum

Full Version: 4Pro DB V6.3 b001
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Caneira,
I have upgraded my 4ProDB but it didn't compiled with libraries from package. (error on line 401 struct tm timeinfo; )
After updating time and DS3232 libraries it compiled well.
I don't know which one caused the problem.

I have a question about json:
i would like to have all extra sensors.
If I add ad-hoc lines of code at the end of send_JSON routine , do I have to extend the buffer as well?
Code:
void send_JSON()
  {  
    DynamicJsonDocument WeatherData(528);              
    char t_buffer[420];
Thanks
(02-05-2023, 17:08)laulau Wrote: [ -> ]Hi Caneira,
I have upgraded my 4ProDB but it didn't compiled with libraries from package. (error on line 401 struct tm timeinfo; )
After updating time and DS3232 libraries it compiled well.
I don't know which one caused the problem.

Hello Laurent hope you are going well.

For me it compiles fine with those libraries included in the package. I tried with ESP32 boards manager v2.0.6 and even with latest 2.0.8
To be sure, I just finish checking if the included libraries are equal to the ones I use, and they are exactly equal, so also don't know from where the compile error comes from.


(02-05-2023, 17:08)laulau Wrote: [ -> ]I have a question about json:
i would like to have all extra sensors.
If I add ad-hoc lines of code at the end of send_JSON routine , do I have to extend the buffer as well?
Code:
void send_JSON()
  {  
    DynamicJsonDocument WeatherData(528);              
    char t_buffer[420];
Thanks

Yes, that's it. Try to follow the same logic on the identifiers. This should add the last 3 extra sensors.

Code:
WeatherData["ES5T"]   = (int16_t)(((ExtraS_Data[4][0] * factor1) + factor2) * factor3);
WeatherData["ES5H"]   = (uint16_t)(ExtraS_Data[4][1]);
WeatherData["ES6T"]   = (int16_t)(((ExtraS_Data[5][0] * factor1) + factor2) * factor3);
WeatherData["ES6H"]   = (uint16_t)(ExtraS_Data[5][1]);
WeatherData["ES7T"]   = (int16_t)(((ExtraS_Data[6][0] * factor1) + factor2) * factor3);
WeatherData["ES7H"]   = (uint16_t)(ExtraS_Data[6][1]);


Be cautious, increasing the buffer size too much may cause problems. Let me know if it goes stable after your changes.
By the way, the size of the t_buffer should be equal to the DynamicJsonDocument, I already corrected that on the published release.

Thanks,

Regards
Werk_AG