Moderator: igrr
#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.
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
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