ThingPulse / esp8266-weather-station

ESP8266 Weather Station library supporting OpenWeatherMap, Aeris and other sources
MIT License
1.07k stars 363 forks source link

esp8266 Huzzah crashed when city name contains special character #20

Closed spanDN closed 6 years ago

spanDN commented 8 years ago

When pull up condition for http://api.wunderground.com/api//conditions/q/UA/Dnipropetrovs'k.json response contains city: "Dnipropetrovs\u0027k" and esp8266 crashes. But if city does not contain character < ' > everything works.

response is { "response": { "version":"0.1", "termsofService":"http://www.wunderground.com/weather/api/d/terms.html", "features": { "conditions": 1 } } , "current_observation": { "image": { "url":"http://icons.wxug.com/graphics/wu2/logo_130x80.png", "title":"Weather Underground", "link":"http://www.wunderground.com" }, "display_location": { "full":"Dnipropetrovs\u0027k, Ukraine", "city":"Dnipropetrovs\u0027k", "state":"", "state_name":"Ukraine", "country":"UR", "country_iso3166":"UA", "zip":"00000", "magic":"1", "wmo":"34504", "latitude":"48.36999893", "longitude":"35.08000183", "elevation":"141.00000000" }, "observation_location": { "full":"Dnipropetrovs\u0027k, ", "city":"Dnipropetrovs\u0027k", "state":"",

esp8266 exception:

Decoding 40 results 0x40204f6e: ClientContext::read() at C:\Users\dell e5540\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WiFi\src/WiFiClient.cpp:150 (inlined by) WiFiClient::read() at C:\Users\dell e5540\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WiFi\src/WiFiClient.cpp:225 0x402046ce: WundergroundClient::doUpdate(String) at C:\Users\dell e5540\Documents\Arduino\libraries\esp8266-weather-station-master/WundergroundClient.cpp:76 0x40217d87: pp_attach at ??:? 0x40217dd2: pp_attach at ??:? 0x40217ec4: pp_attach at ??:? 0x40103f97: pp_post at ??:? 0x4021731c: ppTxPkt at ??:? 0x40224ac7: ieee80211_output_pbuf at ??:? 0x40217d87: pp_attach at ??:? 0x40217dd2: pp_attach at ??:? 0x40217ec4: pp_attach at ??:? 0x40217d87: pp_attach at ??:? 0x40217dd2: pp_attach at ??:? 0x40103f97: pp_post at ??:? 0x40103823: lmacRxDone at ??:? 0x40103f97: pp_post at ??:? 0x40104b81: trc_NeedRTS at ??:? 0x40104d10: trc_NeedRTS at ??:? 0x4010512a: wDev_ProcessFiq at ??:? 0x4020ff91: etharp_output_to_arp_index at /Users/igrokhotkov/projects/esp8266/esp_iot_sdk_v1.3.0_15_08_08/esp_iot_sdk_v1.3.0/app/lwip/netif/etharp.c:886 0x401015a9: ets_timer_disarm at ??:? 0x4000050c: ?? ??:0 0x402101ec: etharp_output at /Users/igrokhotkov/projects/esp8266/esp_iot_sdk_v1.3.0_15_08_08/esp_iot_sdk_v1.3.0/app/lwip/netif/etharp.c:991 0x4020136b: twi_write_bit at C:\Users\dell e5540\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\cores\esp8266/core_esp8266_si2c.c:74 0x4020136b: twi_write_bit at C:\Users\dell e5540\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\cores\esp8266/core_esp8266_si2c.c:74 0x4010695e: malloc at C:\Users\dell e5540\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\cores\esp8266/libcreplacements.c:212 0x40207e32: String::changeBuffer(unsigned int) at C:\Users\dell e5540\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\cores\esp8266/WString.cpp:162 0x40207e66: String::reserve(unsigned int) at C:\Users\dell e5540\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\cores\esp8266/WString.cpp:146 0x40208231: String::concat(char const, unsigned int) at C:\Users\dell e5540\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\cores\esp8266/WString.cpp:272 0x40106970: free at C:\Users\dell e5540\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\cores\esp8266/libcreplacements.c:212 0x402082b0: String::concat(char) at C:\Users\dell e5540\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\cores\esp8266/WString.cpp:290 0x40207fbc: String::String(String const&) at C:\Users\dell e5540\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\cores\esp8266/WString.cpp:46 0x40204786: WundergroundClient::updateConditions(String, String, String) at C:\Users\dell e5540\Documents\Arduino\libraries\esp8266-weather-station-master/WundergroundClient.cpp:38 0x40207f98: String::operator=(String const&) at C:\Users\dell e5540\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\cores\esp8266/WString.cpp:220 0x40202845: updateData(SSD1306) at C:\Arduino\My_projects\esp_wheather\MyWeatherStationDemo/MyWeatherStationDemo.ino:192 0x40230aac: aes_wrap at ??:? 0x402074c4: Print::println() at C:\Users\dell e5540\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\cores\esp8266/Print.cpp:131 0x40202abc: Ticker::attach(float, void (*)()) at C:\Users\dell

marcelstoer commented 6 years ago

0x40204f6e: ClientContext::read() at C:\Users\dell e5540\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WiFi\src/WiFiClient.cpp:150 (inlined by) WiFiClient::read() at C:\Users\dell e5540\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\libraries\ESP8266WiFi\src/WiFiClient.cpp:225

We can't fix issues in the ESP8266 Arduino core WiFiClient.cpp -> closing