Page 1 of 1

can espconn_send transmit expand 1024Byte?

Posted: Thu May 09, 2019 11:10 am
by kkinght1
i use API espconn_send transmit data is correct when data low than 1024.
and if i try to send data more than 1024 Byte (1200+), my ESP8266 module will reset , why ?
Who can give me some suggestion to solve the problem?

Re: can espconn_send transmit expand 1024Byte?

Posted: Thu May 09, 2019 5:00 pm
by Her Mary
Out of memory? Maybe you can check the free heap size, and the debug log.

Re: can espconn_send transmit expand 1024Byte?

Posted: Sat May 11, 2019 6:19 am
by AgentSmithers
Yeah, depending on how your write your Global Heap Var's they can be a burden on your memory so if you need to send Buffers of some sort via TCP, You normally want to do something like this

Char * MyFirstBuf
Char * MySecBuf

then in your function Malloc and free when needed. This is course better then defining this...

Char MyFirstBuf[1024]
Char MySecBuf[1024]

The first one at least one of the bufs you can hopefully free at a time to give you room to move around....

Basiclly in a nuttshell avoid [] definnitions for global vars if you have any and convert them to just raw pointers and Alloc and release as needed.. youll have rewrite and test your code to ensure you have the flow correct but I hope that helps.