Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UbiTCP causes repeated crashes after flashing with ESP32 IDF 2.0.10 and above #10

Open
hoadster opened this issue Dec 14, 2023 · 0 comments

Comments

@hoadster
Copy link

hoadster commented Dec 14, 2023

Arduino IDE 2.2.0, ESP IDF 2.0.14 and ESP32 board NodeMCU-32S.

When using UbiTcp classes I get the following looping crashes (rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) after flashing the ESP32:

image

This seems to be caused by the Ubidots global variable constructor line:

Ubidots ubidots(UBIDOTS_TOKEN, UBI_TCP);

Looking in the library class UbiTcp.cpp I can see in the constructor the method _syncronizeTime(); is being called before any WiFi connection is made. The _syncronizeTime(); method therefore seems to be failing with the below error message when trying to get the current time from the SNTP server as there is no WiFi connection:

Setting time using SNTP......[ERROR] Could not set time using remote SNTP to verify Cert

This was a silent failure for me because as per the supplied example ( https://github.com/ubidots/ubidots-esp32/blob/main/examples/GetValueTcp/GetValueTcp.ino ), the Ubidots variable is declared as a global variable and therefore the constructor runs before setup() is called and any WiFi connection is made.

Interestingly, this was not an issue for me with IDF version 2.0.9 but started crashing with IDF versions 2.0.10 and above.

Example code which can be used to re-produce the crash shown below:

`#include "Ubidots.h"

const char* UBIDOTS_TOKEN = "XXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

Ubidots ubidots(UBIDOTS_TOKEN, UBI_TCP); // <--- global variable constructor causes crashes

void setup() {
Serial.begin(115200);
}

void loop() {
}`

I'm very new to ESP32 and library usage so if this issue is due to my environment or setup in some way then please let me know.

@hoadster hoadster changed the title UbiTCP causes repeated crashes after flasing with ESP32 IDF 2.0.10 and above UbiTCP causes repeated crashes after flashing with ESP32 IDF 2.0.10 and above Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant