Is anyone else have issues with this bloody irritating error message from his library with recent changes he has made?
I was having major issues sending web pages until I doubled or quadrupled his timeouts in his various ::SendData(…) functions in EspDrv.cpp:
bool EspDrv::sendData(uint8_t sock, const uint8_t *data, uint16_t len)
{
LOGDEBUG2(F("> sendData:"), sock, len);
char cmdBuf[20];
sprintf_P(cmdBuf, PSTR("AT+CIPSEND=%d,%u"), sock, len);
espSerial->println(cmdBuf);
//int idx = readUntil(1000, (char *)">", false);
int idx = readUntil(4000, (char *)">", false);
if(idx!=NUMESPTAGS)
{
LOGERROR(F("Data packet send error (1)"));
return false;
}
espSerial->write(data, len);
//idx = readUntil(2000);
idx = readUntil(4000);
if(idx!=TAG_SENDOK)
{
LOGERROR(F("Data packet send error (2)"));
return false;
}
return true;
}
This seems to have reliably fixed my problem of this same error being thrown before I was able to send a complete web page.
But now I am also getting the same error when sending an email. My code was working just fine until the recent changes.
In attached SMTPClinet.cpp, my code gets as far as line 103 (that is trying to write the “From: …<…>” email field) and then WifiEsp throws the error:
[WiFiEsp] >>> TIMEOUT >>>
[WiFiEsp] Data packet send error (1)
[WiFiEsp] Failed to write to socket 1
Nothing I have tried in his library will stop this error. Doubling the timeouts again makes no difference.
Basically it is now impossible to send an email using his library, based on this example http://playground.arduino.cc/Code/Email, when it was possible with previous versions of the library.
SMTPClient.cpp (10.2 KB)
SMTPClient.h (1.49 KB)