Using the new Arduino IDE for ESP8266 and found bugs, report them here

Moderator: igrr

User avatar
By HankPym
#60908 my esp8266 moudel established a softAP, and I can browser my webpage embeded in my arduino program on my laptop which connected to the softAP mentioned above.I write three webpage use html and javascript.The first small webpage shows well but the second one with the size of 6072 bytes can not compeletedlly received by browser. The i printed the return of "client.print(webpage);", it gives a result of 2920. Is there any way I can do to overcome the limit to send large webpage to my client?
User avatar
By martinayotte
#60973 This size looks exactly like 2 times the MTU size.
Code: Select all#define WIFICLIENT_MAX_PACKET_SIZE 1460

In this case, you should call client.print() several time with chunks and looping until you've send the whole page.
User avatar
By HankPym
#60992
martinayotte wrote:This size looks exactly like 2 times the MTU size.
Code: Select all#define WIFICLIENT_MAX_PACKET_SIZE 1460

In this case, you should call client.print() several time with chunks and looping until you've send the whole page.

I have add my code in the folder"D:\arduino-1.8.1\Portable\packages\esp8266\hardware\esp8266\2.2.0\libraries\ESP8266WiFi\src" ClientContex.h like this:
size_t room = tcp_sndbuf(_pcb);
if(size<room)
{
size_t will_send = (room < size) ? room : size;
err_t err = tcp_write(_pcb, data, will_send, 0);
if(err != ERR_OK) {
DEBUGV(":wr !ERR_OK\r\n");
return 0;
}

_size_sent = will_send;
DEBUGV(":wr\r\n");
tcp_output( _pcb );
_send_waiting = true;
delay(500); // max send timeout
_send_waiting = false;
DEBUGV(":ww\r\n");
return will_send - _size_sent;
}
else{
unsigned short let=0,left=size;
do
{
room = tcp_sndbuf(_pcb);
if(room>left){room=left;} err_t err = tcp_write(_pcb, data+let, room, 0);
if(err != ERR_OK) {
DEBUGV(":wr !ERR_OK\r\n");
return 0;
}

_size_sent = room;
DEBUGV(":wr\r\n");
tcp_output( _pcb );
_send_waiting = true;
delay(500); // max send timeout
_send_waiting = false;
DEBUGV(":ww\r\n");
let+=room;
left-=room;

}while(left);
return size;
}
forgive me for my of no knowledge of how to post screenshot of my arduino source file.
It has been tested well for sending htmls with size up to 10KB
User avatar
By HankPym
#61611 :shock:
Sorry to anounce that the code I posted to overcome the limt of html file size seems to more easilly initiate a WDT-Reset, especially when browser get updated. And I also tried to recall "client.print" several times to send the whole html. It still remains the same result