esp-pcd-weather icon indicating copy to clipboard operation
esp-pcd-weather copied to clipboard

Nice work

Open pieman64 opened this issue 8 years ago • 2 comments

Liking the ESP weather work you have done @bbx10

I am able to pull the current weather conditions from wunderground but not the forecast data.

The json returned for the forecast is around 7000 characters as opposed to 3000 for current conditions. Tried changing static char respBuf[4096]; and StaticJsonBuffer<3*1024> jsonBuffer; but larger sizes seems to crash the ESP. We are using ESP's with 4M.

What is the relationship between the 4096 and 3*1024 and what is the maximum that the ESP's can handle?

pieman64 avatar May 18 '16 19:05 pieman64

4M refers to the size of Flash for program code and files. It usually split 1M for program storage and 3M for file storage.

respBuf and jsonBuffer are in RAM. There is about 81K of RAM of which about half is used by the system for WiFi, IP stack, etc. After each compile the IDE shows the used and available. For example,

Sketch uses 235,158 bytes (22%) of program storage space. Maximum is 1,044,464 bytes.
Global variables use 32,137 bytes (39%) of dynamic memory, leaving 49,783 bytes for local variables. Maximum is 81,920 bytes.

Any 8K buffer should not use up all available RAM. There is a problem with StaticJsonBuffer so try this instead.

DynamicJsonBuffer jsonBuffer;

bbx10 avatar May 19 '16 05:05 bbx10

Thanks @bbx10 that seems to have sorted it at this end.

pieman64 avatar May 19 '16 12:05 pieman64