diff --git a/.gitignore b/.gitignore index 9d2f753..8e2e182 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,6 @@ extras/docs/* .gcc-flags.json platformio.ini lib/readme.txt +.vscode/.browse.c_cpp.db* +.vscode/c_cpp_properties.json +.vscode/launch.json diff --git a/src/TinyGsmClientSIM800.h b/src/TinyGsmClientSIM800.h index 924275a..69e3c3b 100644 --- a/src/TinyGsmClientSIM800.h +++ b/src/TinyGsmClientSIM800.h @@ -144,6 +144,13 @@ public: continue; } // TODO: Read directly into user buffer? + // Workaround: sometimes SIM800 forgets to notify about data arrival. + // TODO: Currently we ping the module periodically, + // but maybe there's a better indicator that we need to poll + if (millis() - prev_check > 500) { + got_data = true; + prev_check = millis(); + } at->maintain(); if (sock_available > 0) { sock_available -= at->modemRead(TinyGsmMin((uint16_t)rx.free(), sock_available), mux);