ESP8266 WiFi Module Web Server library
Diff: ESP8266_WebServer.cpp
- Revision:
- 7:f6172ba3e807
- Parent:
- 6:34d93ea4d519
- Child:
- 8:5573f6f70a82
diff -r 34d93ea4d519 -r f6172ba3e807 ESP8266_WebServer.cpp --- a/ESP8266_WebServer.cpp Sun Jan 04 12:11:33 2015 +0000 +++ b/ESP8266_WebServer.cpp Mon Jan 05 19:22:25 2015 +0000 @@ -94,13 +94,7 @@ return 0; } -void ESP8266_WebServer::Initialize(void) { - readBuffer(); - serial->printf("AT+RST\r\n"); - wait_ms(1000); - while( string_waiting("\r\nready\r\n") == 0 ) { - wait_ms(100); - } +void ESP8266_WebServer::ResetModule(void) { readBuffer(); serial->printf("ATE0\r\n"); while( data_waiting() == 0 ) { @@ -108,15 +102,22 @@ } readBuffer(); - if( debugSerial != NULL ) { - debugSerial->printf("Done\r\nSetting operating mode..."); + readBuffer(); + serial->printf("AT+RST\r\n"); + wait_ms(1000); + while( string_waiting("\r\nready\r\n") == 0 ) { + wait_ms(100); } - serial->printf("AT+CWMODE=3\r\n"); + + readBuffer(); + serial->printf("ATE0\r\n"); while( data_waiting() == 0 ) { wait_ms(10); } readBuffer(); +} +void ESP8266_WebServer::Initialize(void) { if( debugSerial != NULL ) { debugSerial->printf("Done\r\nAccept Multiple connections..."); }