Board crashing when synchronizing with Cloud IoT

Hello.
I have created a sketch that updates 195 variables : 16xString variables, 34xfloat, 52xint, 107xbool.
Notice : I'm using the IDE tool instead of the included Cloud IoT compile (because I have a pb with the Arduino Cloud Agent). This is the way I'm usually doing and it is OK for all the other sketchs I have created.

> Any idea why it crashes ? :exploding_head:

Information is following.

1) The sketch is very simple :

#define WIFI_SSID "freecd9b4box8"
#define WIFI_PASSWORD "xxxxxxxx"
#define SECRET_SSID "freecd9b4box8" // NE PAS MODIFIER
#define SECRET_OPTIONAL_PASS "xxxxxxxx" // NE PAS MODIFIER
#define SECRET_DEVICE_KEY "e!OnTc5aP89imOCWn@ewnhte6" //         <<<<<<<<< A RECOPIER de l'outil de dev Arduino Cloud

#include "thingProperties-Energie-Compute.h"
#include <WiFi.h>

void setup()
// ****************************************************************************************
{
  Serial.begin(115200);
  // This delay gives the chance to wait for a Serial Monitor without blocking if none is found
  delay(5000);
  Serial.println("Entree / setup...");
  initProperties();
  // Connect to Arduino IoT Cloud
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  // Mise en commentaire pour compilation IDE
  setDebugMessageLevel(4);
  ArduinoCloud.printDebugInfo();

  Serial.println("Arduino initialisé");
  Serial.println("Sortie / setup");
}

void loop()
// ****************************************************************************************
{
  ArduinoCloud.update();
} // fin de loop


void onSXXORDRECONFIGUREChange(int index_numero_de_capteur_a_traiter) 
// ****************************************************************************************
{
  Serial.println("Entrée onSXXORDRECONFIGUREChange pour capteur = " + String(index_numero_de_capteur_a_traiter + 1) + "]");
}

void onSXXTEMPMAXChange(int index_numero_de_capteur_a_traiter)
// ****************************************************************************************
{
}

void onSXXTEMPMINChange(int index_numero_de_capteur_a_traiter)
// ****************************************************************************************
{
}

//!!!!!!!   s01
void onS01ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 0;
    onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS01VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 0;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS01VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 0;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s02
void onS02ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 1;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS02VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 1;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS02VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 1;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s03
void onS03ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 2;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS03VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 2;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS03VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 2;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s04
void onS04ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 3;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS04VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 3;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS04VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 3;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s05
void onS05ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 4;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS05VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 4;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS05VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 4;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s06
void onS06ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 5;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS06VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 5;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS06VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 5;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s07
void onS07ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 6;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS07VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 6;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS07VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 6;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s08
void onS08ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 7;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS08VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 7;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS08VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 7;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s09
void onS09ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 8;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS09VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 8;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS09VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 8;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s10
void onS10ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 9;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS10VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 9;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS10VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 9;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s11
void onS11ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 10;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS11VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 10;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS11VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 10;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s12
void onS12ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 11;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS12VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 11;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS12VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 11;
  onSXXTEMPMINChange(index_ds_tableau);
}


//!!!!!!!   s13
void onS13ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 12;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS13VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 12;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS13VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 12;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s14
void onS14ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 13;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS14VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 13;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS14VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 13;
  onSXXTEMPMINChange(index_ds_tableau);
}

//!!!!!!!   s15
void onS15ORDRECONFIGUREChange() {
// ****************************************************************************************
  int index_ds_tableau = 14;
  onSXXORDRECONFIGUREChange(index_ds_tableau);
}
void onS15VALEURTEMPMAXChange() {
// ****************************************************************************************
  int index_ds_tableau = 14;
  onSXXTEMPMAXChange(index_ds_tableau);
}
void onS15VALEURTEMPMINChange() {
// ****************************************************************************************
  int index_ds_tableau = 14;
  onSXXTEMPMINChange(index_ds_tableau);
}

void onGFEdonneeMAJINChange() {
  Serial.println("Entrée onGFEdonneeMAJINChange");
}
void onGFEdonnee1INChange()  {
Serial.println("Entrée onGFEdonnee1INChange");
}
void onGFEdonnee2INChange()  {
Serial.println("Entrée onGFEdonnee2INChange");
}
void onGFEcapteurIDINChange()  {
Serial.println("Entrée GFEcapteurIDINChange");
}
void onGFDdonnee1INChange()  {
}
void onGFDdonnee2INChange()  {
}
void onGFDcapteurIDINChange()  {
}
void onGFDdonneeMAJINChange()  {
}

2) The compilation is OK. Here is the result :slight_smile:

Le croquis utilise 1184669 octets (90%) de l'espace de stockage de programmes. Le maximum est de 1310720 octets.
Les variables globales utilisent 49060 octets (16%) de mémoire dynamique, ce qui laisse 245852 octets pour les variables locales. Le maximum est de 294912 octets.
esptool.py v4.6
Serial port COM13
Connecting.....
Chip is ESP32-PICO-D4 (revision v1.1)
Features: WiFi, BT, Dual Core, 240MHz, Embedded Flash, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 10:06:1c:31:01:08
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00006fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x00132fff...
Compressed 23376 bytes to 15314...
Writing at 0x00001000... (100 %)
Wrote 23376 bytes (15314 compressed) at 0x00001000 in 0.4 seconds (effective 426.2 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 146...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.0 seconds (effective 594.0 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 772.9 kbit/s)...
Hash of data verified.
Compressed 1191248 bytes to 780549...
Writing at 0x00010000... (2 %)
Writing at 0x000183ac... (4 %)
Writing at 0x0001d0df... (6 %)
Writing at 0x000224d1... (8 %)
Writing at 0x000293f8... (10 %)
Writing at 0x00034cb9... (12 %)
Writing at 0x0003baef... (14 %)
Writing at 0x00041dd7... (16 %)
Writing at 0x0004a782... (18 %)
Writing at 0x0005b774... (20 %)
Writing at 0x000610c8... (22 %)
Writing at 0x0006896f... (25 %)
Writing at 0x0006e058... (27 %)
Writing at 0x0007356e... (29 %)
Writing at 0x00078d5a... (31 %)
Writing at 0x0007deaf... (33 %)
Writing at 0x000835d8... (35 %)
Writing at 0x00088558... (37 %)
Writing at 0x0008d730... (39 %)
Writing at 0x00092b2d... (41 %)
Writing at 0x00097f6c... (43 %)
Writing at 0x0009d6d9... (45 %)
Writing at 0x000a2e5f... (47 %)
Writing at 0x000a7e70... (50 %)
Writing at 0x000ace84... (52 %)
Writing at 0x000b2345... (54 %)
Writing at 0x000b74fe... (56 %)
Writing at 0x000bc510... (58 %)
Writing at 0x000c1ca8... (60 %)
Writing at 0x000c786d... (62 %)
Writing at 0x000cceb0... (64 %)
Writing at 0x000d2016... (66 %)
Writing at 0x000d7624... (68 %)
Writing at 0x000dc8eb... (70 %)
Writing at 0x000e1e31... (72 %)
Writing at 0x000e70e7... (75 %)
Writing at 0x000ec7ee... (77 %)
Writing at 0x000f1e51... (79 %)
Writing at 0x000f7808... (81 %)
Writing at 0x000fd369... (83 %)
Writing at 0x00102bda... (85 %)
Writing at 0x00109536... (87 %)
Writing at 0x00111d62... (89 %)
Writing at 0x00119f5d... (91 %)
Writing at 0x0011f0e7... (93 %)
Writing at 0x00124553... (95 %)
Writing at 0x00129d1a... (97 %)
Writing at 0x0012f1ee... (100 %)
Wrote 1191248 bytes (780549 compressed) at 0x00010000 in 10.7 seconds (effective 892.4 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

3) Running phase : when synchronising with the Arduino Cloud (ArduinoCloud.update()), the sketch crashes.
When I remove that synchronisation command, it doesn't crashes.

18:06:48.877 -> Guru Meditation Error: Core  1 panic'ed (Unhandled debug exception). 
18:06:48.877 -> Debug exception reason: Stack canary watchpoint triggered (loopTask) 
18:06:48.909 -> Core  1 register dump:
18:06:48.909 -> PC      : 0x40084198  PS      : 0x00060736  A0      : 0x3ffb03d0  A1      : 0x3ffb0310  
18:06:48.909 -> A2      : 0x3ffb9d14  A3      : 0x00000000  A4      : 0x0000001a  A5      : 0x00000000  
18:06:48.909 -> A6      : 0x00000017  A7      : 0x00000000  A8      : 0x00001ab7  A9      : 0x3ffd7741  
18:06:48.909 -> A10     : 0x00000000  A11     : 0x00000000  A12     : 0x0000001a  A13     : 0x00000000  
18:06:48.947 -> A14     : 0x00000017  A15     : 0xb33fffff  SAR     : 0x0000000a  EXCCAUSE: 0x00000001  
18:06:48.947 -> EXCVADDR: 0x00000000  LBEG    : 0x4008499d  LEND    : 0x400849a5  LCOUNT  : 0x00000027  
18:06:48.947 -> 
18:06:48.947 -> 
18:06:48.947 -> Backtrace: 0x40084195:0x3ffb0310 0x3ffb03cd:0x3ffb03f0 |<-CORRUPTED
18:06:48.947 -> 
18:06:48.947 -> 
18:06:48.947 -> 
18:06:48.947 -> 
18:06:48.947 -> ELF file SHA256: 286b7ae02d7f8073
18:06:48.947 -> 
18:06:49.097 -> Guru Meditation Error: Core  1 panic'ed (Unhandled debug exception). 
18:06:49.097 -> Debug exception reason: BREAK instr 
18:06:49.097 -> Core  1 register dump:
18:06:49.097 -> PC      : 0x40083ee8  PS      : 0x00000016  A0      : 0x40080306  A1      : 0x3ffc6b30  
18:06:49.097 -> A2      : 0x00000000  A3      : 0x70000005  A4      : 0x00000000  A5      : 0x00000000  
18:06:49.097 -> A6      : 0x00000000  A7      : 0x00000000  A8      : 0x00004000  A9      : 0x3ffb0130  
18:06:49.131 -> A10     : 0x00000000  A11     : 0x44175165  A12     : 0x44175165  A13     : 0x00060e24  
18:06:49.131 -> A14     : 0xfffbfff0  A15     : 0x00000046  SAR     : 0x00000000  EXCCAUSE: 0x00000001  
18:06:49.131 -> EXCVADDR: 0x00000000  LBEG    : 0x40089a70  LEND    : 0x40089a86  LCOUNT  : 0xffffffff  
18:06:49.131 -> 
18:06:49.131 -> 
18:06:49.131 -> Backtrace: 0x40083ee5:0x3ffc6b30 0x40080303:0x3ffc6b60 0x65a5a5a2:0xa5a5a5a5 |<-CORRUPTED
18:06:49.131 -> 
18:06:49.165 -> 
18:06:49.165 -> 
18:06:49.165 -> 
18:06:49.165 -> ELF file SHA256: 286b7ae02d7f8073
18:06:49.165 -> 
18:06:49.165 -> Re-entered core dump! Exception happened during core dump!
18:06:49.165 -> Re-entered core dump! Exception happened during core dump!

4) Hardware I'm using : TTGO LoRa32-OLED

**5) When removing the (ArduinoCloud.update()) command, it works fine :slight_smile:

18:30:16.907 -> Entree / setup...
18:30:17.141 -> ***** Arduino IoT Cloud - configuration info *****
18:30:17.141 -> Device ID: 7751cba4-9904-4afe-8d6e-0fce67c07b2e
18:30:17.141 -> MQTT Broker: iot.arduino.cc:8884
18:30:17.141 -> Arduino initialisé
18:30:17.141 -> Sortie / setup

Hello All.... No answer ?

Win, Mac, *nix. What is the problem with the agent?

Hi Edison. Thanks for your reply but... what is your question ?
If you look at the section 3) Running phase, it shows that the board crashes :

18:06:48.877 -> Guru Meditation Error: Core  1 panic'ed (Unhandled debug exception). 
18:06:48.877 -> Debug exception reason: Stack canary watchpoint triggered (loopTask) 

Dos it help ?