vshymanskyy / TinyGSM

A small Arduino library for GSM modules, that just works
GNU Lesser General Public License v3.0
1.93k stars 715 forks source link

Issue Sovled on Fail Data sended to server #510

Open Pabel15 opened 3 years ago

Pabel15 commented 3 years ago

Hi, Im not sure if this is the correct place to this topic (im not an expert o github) just to say that after a few trys on sending big amount of data via "PUT" I found a way to handle not accepted packages.

on file TinyGsmTCP.tpp, line 110 i've changed this function

size_t write(const uint8_t* buf, size_t size) override { TINY_GSM_YIELD(); at->maintain(); return at->modemSend(buf, size, mux); }

for this new, wich can handle "SEND FAIL" responses from server

size_t write(const uint8_t* buf, size_t size) override { TINY_GSM_YIELD(); at->maintain(); int intentos=0; int16_t rta; while((rta=at->modemSend(buf, size, mux))==0 and intentos<10){ intentos++; } return rta; }

im sure this is not the best way to do it but it works for me. Hope it helps