Crashes on ESP8266 with secure connection were finally fixed. The solution works by replacing the status strings with new functions, that take a status ID int-value as input and return a string-value.
Other changes:
- Changed the names of variables to match the style of the C++ language, simplified work with the API key, units and functions. Look at example OWM_for_ESP_Test.ino and Notes.ino carefully to understand the new logic of the library.
- New functions: getIconCode(), getShortStatus(), getStatus(), getStatus16(), setApiKey() and setUnits(). See their usage in the example.
- New definitions: ENABLE_STRINGS, LANGUAGE, DEFAULT_UNITS. With ENABLE_STRINGS you can use cityName, countryCode and timezoneName strings. With LANGUAGE you can set your language for getShortStatus(), getStatus() and getStatus16(). With DEFAULT_UNITS you can set default units, which can be changed with setUnits().
- Accelerated getting time for ESP8266 secure connection.
- Logging is now provided through additional functions. It looks cleaner than before.
- Merged equivalent code segments for ESP8266 and ESP32.
- Some fixes and refactoring to improve code quality.
Version 2.0.0 confirmed the ease of use and fault tolerance. It is not planned to change the code structure or add new functions in the near future, so you can modify my library for yourself without fear that tomorrow all the code will be refactored and a lot of important features will appear.
More info about Out-of-memory crashes:
I followed the tips from this article, completely abandoned strings in favor of char[], abandoned structures in favor of regular variables, and even completely disabled the JSON_Decoder library. None of this helps: if your RAM is full of data, sooner or later client.connect() will crash the system. There is no solution to this problem, and its cause sits deep in the core.