Skip to content

Commit 44c955c

Browse files
Marcus ChangVeijo Pesonen
authored andcommitted
Disable echo
AT command echo interferes with OOB recognition.
1 parent 89ccbb7 commit 44c955c

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

ESP8266/ESP8266.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,16 @@ bool ESP8266::at_available()
9797
return ready;
9898
}
9999

100+
bool ESP8266::echo_off()
101+
{
102+
_smutex.lock();
103+
bool ready = _parser.send("ATE0")
104+
&& _parser.recv("OK\n");
105+
_smutex.unlock();
106+
107+
return ready;
108+
}
109+
100110
struct ESP8266::fw_sdk_version ESP8266::sdk_version()
101111
{
102112
int major;

ESP8266/ESP8266.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,13 @@ class ESP8266 {
9696
*/
9797
bool at_available(void);
9898

99+
/**
100+
* Disable echo - required for OOB processing to work
101+
*
102+
* @return true if echo was successfully disabled
103+
*/
104+
bool echo_off(void);
105+
99106
/**
100107
* Check sdk version from which firmware is created
101108
*

ESP8266Interface.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,9 @@ nsapi_error_t ESP8266Interface::_init(void)
315315
if (!_esp.reset()) {
316316
return NSAPI_ERROR_DEVICE_ERROR;
317317
}
318+
if (!_esp.echo_off()) {
319+
return NSAPI_ERROR_DEVICE_ERROR;
320+
}
318321
if (!_esp.start_uart_hw_flow_ctrl()) {
319322
return NSAPI_ERROR_DEVICE_ERROR;
320323
}

0 commit comments

Comments
 (0)