Skip to content

Commit

Permalink
Recent versions of ESP8266 do not send OK anymore after reading the s…
Browse files Browse the repository at this point in the history
…tream after IPD
  • Loading branch information
janjongboom committed Aug 30, 2016
1 parent 29d63ae commit f1c3f75
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ESP8266/ESP8266.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ bool ESP8266::startup(int mode)
}

bool success = reset()
&& _parser.send("AT+CWMODE=%d", mode)
&& _parser.send("AT+CWMODE=%d", mode)
&& _parser.recv("OK")
&& _parser.send("AT+CIPMUX=1")
&& _parser.send("AT+CIPMUX=1")
&& _parser.recv("OK");

_parser.oob("+IPD", this, &ESP8266::_packet_handler);
Expand Down Expand Up @@ -148,8 +148,7 @@ void ESP8266::_packet_handler()
packet->len = amount;
packet->next = 0;

if (!(_parser.read((char*)(packet + 1), amount)
&& _parser.recv("OK"))) {
if (!(_parser.read((char*)(packet + 1), amount))) {
free(packet);
return;
}
Expand Down

0 comments on commit f1c3f75

Please sign in to comment.