Libreria basica para el manejo del ESP01
Dependents: Gateway_Cotosys Gateway_Cotosys_os5
Diff: ESP01.cpp
- Revision:
- 9:21290fc75c17
- Parent:
- 8:ef9014a530cf
--- a/ESP01.cpp Sun Sep 15 20:54:35 2019 +0000 +++ b/ESP01.cpp Mon Jan 06 04:39:26 2020 +0000 @@ -81,7 +81,7 @@ bool ESP01::GetIP(char *ip) { SendCMD("AT+CIFSR"); - return RcvReply(ip, 2000); + return RcvReply(ip, 3000); } //Defines wifi mode; Parameter: mode; 1= STA, 2= AP, 3=both @@ -188,14 +188,16 @@ { bool ended = 0; char c; + Timer t; strcpy(r, ""); + t.start(); while(!ended) { if(comm.readable()) { c = comm.getc(); AddChar(r, c); } - if(c == 0x0D) { + if((c==0x0D)||(t.read_ms() > 5000)) { ended = 1; } }