Skip to content

EDIT: Adding a STRING Properties without Setting it's value at Setup() Crashes the ESP32 #137

Open
@jcherrabi

Description

@jcherrabi

Hello there,
i added the following line to the AsyncProperty.ino example
ThingProperty text2("text2", "", STRING, nullptr, textChanged);

and in the setup() i added this:
textDisplay.addProperty(&text2);

Compile and run.. next add the thing using the + on the gateway interface, everything is fine so far now remove the added thing and try to add again and voila the ESP crashes and reboots... if i change the newly added property to BOOLEAN for example then it doesn't crash.

decoding the stack reveals this:
`PC: 0x4015691f: String::buffer() const at C:\Users\xxxx\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\cores\esp32/WString.h line 318
EXCVADDR: 0x00000008

Decoding stack results
0x4015691f: String::buffer() const at C:\Users\xxxx\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\cores\esp32/WString.h line 318
0x400d43da: ArduinoJson6180_D1::VariantData::storeString (ArduinoJson6180_D1::ArduinoStringAdapter, ArduinoJson6180_D1::MemoryPool*, ArduinoJson6180_D1::storage_policies::store_by_copy) at C:\Users\xxxx\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\cores\esp32/WString.h line 230
0x400d443f: ArduinoJson6180_D1::Converter ::toJson(String const&, ArduinoJson6180_D1::VariantRef) at C:\Users\xxxx\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Variant/VariantData.hpp line 238
0x400d4a1d: ThingItem::serializeValue(ArduinoJson6180_D1::ObjectRef) at C:\Users\xxxx\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Variant/VariantRef.hpp line 88
0x400d7e63: WebThingAdapter::handleThingPropertyGet(AsyncWebServerRequest*, ThingItem*) at C:\Users\xxxx\Documents\Arduino\libraries\webthing-arduino/ESPWebThingAdapter.h line 403
0x401567c2: std::_Function_handler (WebThingAdapter*, std::_Placeholder1>, ThingProperty*)> >::_M_invoke(std::_Any_data const&, AsyncWebServerRequest*&&) at c:\users\xxxx\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-97-gc752ad5-5.2.0\xtensa-esp32-elf\include\c++\5.2.0/functional line 600
0x400de8a1: AsyncCallbackWebHandler::handleRequest(AsyncWebServerRequest*) at c:\users\xxxx\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-97-gc752ad5-5.2.0\xtensa-esp32-elf\include\c++\5.2.0/functional line 2271
0x400dc6ed: AsyncWebServerRequest::_parseLine() at C:\Users\xxxx\Documents\Arduino\libraries\ESPAsyncWebServer\src\WebRequest.cpp line 581
0x400dc7b1: AsyncWebServerRequest::_onData(void*, unsigned int) at C:\Users\xxxx\Documents\Arduino\libraries\ESPAsyncWebServer\src\WebRequest.cpp line 123
0x400dca01: std::_Function_handler >::_M_invoke(const std::_Any_data &, , , , ) at C:\Users\xxxx\Documents\Arduino\libraries\ESPAsyncWebServer\src\WebRequest.cpp line 76
0x400e06d1: AsyncClient::_recv(tcp_pcb*, pbuf*, signed char) at c:\users\xxxx\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-97-gc752ad5-5.2.0\xtensa-esp32-elf\include\c++\5.2.0/functional line 2271
0x400e0751: AsyncClient::_s_recv(void*, tcp_pcb*, pbuf*, signed char) at C:\Users\xxxx\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp line 1191
0x400e0d4e: _async_service_task(void*) at C:\Users\xxxx\Documents\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp line 159
0x40089792: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 143`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions