Array Concatenation for esp8266

I am concatenating three arrays , the size of resultant array becomes 88. but when I concatenate them, the esp8266 restarts. I used strcat(), it works good for resultant array having size up to 20 but for greater than 20 esp restarts. please help me.
thanks in advance.

Post your program.

My approach would be to create all the arrays to the maximum size needed when writing the program. There is no advantage to being frugal with memory when there is only one program on the chip.

…R

Did you allocate memory for 88 bytes?

Pieter

Good chance you can see a stack trace in the Serial console.

Use the ESP Exception Decode to get a clue of what's going on, and about where in your code it crashes.

Posting your sketch here may also go a long way (please use code tags!)

Hmmm… I’ll place my bet on… an infinite loop causing a watchdog timeout.

If your code is long, please try to reproduce the same problem in a short test sketch. Often, simply trying to make a short test sketch to reproduce the error can reveal the original cause.

Not sure, but I read that a yield(); could be needed in strategic places if code takes too long to execute.
I think a delay(0); does the same.
Leo..

PaulRB:
Hmmm... I'll place my bet on... an infinite loop causing a watchdog timeout.

That will also be shown in the Serial console, if it happens. Common culprits are also long running for and while loops - no need for it to be an infinite loop per se.

Wawa:
Not sure, but I read that a yield(); could be needed in strategic places if code takes too long to execute.
I think a delay(0); does the same.

Correct.
The ]yield() and delay(0) are equivalent - the first may even be an alias of the second, not sure how it goes inside the compiler. This command gives control to the underlying OS (for lack of a better word), to run the http stack. This must be done every 250 ms iirc, or you get this wdt timeout. It's basically cooperative multitasking.
There is an option to disable the wdt but I don't think it's a good idea unless you're very sure that's what you want to do :slight_smile:
Any delay() will give control to the http stack, so you can safely do delay(1000) without wdt timeout errors.
The delayMicrosecons() however is fully blocking, and does NOT relinquish control.

That said, it seems that loop() also automatically calls the http process. You can do lots of things without the need of any yield() or delay().