This is a very simple library for ESP8266 module from Ai-Thinker
- Quite stable now -> You really need external 3.3v current source than FTDI USB-to-Serial board.
- Dependent on AltSoftSerial library. I had to patch AltSoftSerial library to modify peek function and increase RX buffer somewhat.
- You'd better to use 115200 for HW Serial to don't become bottleneck for SoftSerial (I tested with 115200 usually)
- AltSoftSerial (connected to ESP8266) works as 9600bps
- External 3.3v power supply
- My ESP8266 module looks like ESP-07
- ESP8266 GPIO0 -> VCC
- ESP8266 GPIO2 -> HIGH
- ESP8266 GPIO15 -> GND
- ESP8266 CH_PD -> HIGH
- ESP8266 TXD -> Pro Mini D8 or Mega D48
- ESP8266 RXD -> Pro Mini D9 or Mega D46
- Download SDK from Espressif page : http://bbs.espressif.com/viewtopic.php?f=5&t=154
- Download Flash program for Espressif page : http://bbs.espressif.com/viewtopic.php?f=7&t=25&p=70&hilit=FLASH_DOWNLOAD_TOOLS_v0.9.3.1_141118#p70
- Flash by "new firmware" instruction at esp_iot_sdk_v0.9.5_15_01_23/esp_iot_sdk_v0.9.5/bin/at/readme.txt
- Run the following AT commands with FTDI connection to ESP8266
AT+CWMODE=1
AT+CWAUTOCONN=0
AT+RST
AT+CWJAP="leekwon2G","x"
AT+CIUPDATE
AT+UART=9600,8,1,0,0
- Firmware version is very important. I tried with older version and moved to newer version, and the AT response is quite different.
- There is timing issue due to limited UART RX buffer. For example, you should handle the scan entry as fast as possible to prevent RX buffer overflow.
Arduino Pro Mini 3.3V and Arduino Mega
ESP8266mod module from Ai-Thinker (http://forum.hobbycomponents.com/viewtopic.php?f=74&t=1777)
Firmware version : AT version:0.21.0.0 SDK version:0.9.5
- AP connection
- TCP connection (single)
- AP Scan
detailed HW configuration guide (reference)mark this done for now :)more stable connection- corner-case handling
add modified AltSoftSerial library patchScan functionalityAp connectionTCP connection (single)
##Reference
- on the module itself and HW configuration : http://forum.hobbycomponents.com/viewtopic.php?f=74&t=1777
- Espressif page : https://espressif.com/
ESP8266ClientClass();
wl_status_t begin(char * ssid = NULL, char * password = NULL, byte * mac = NULL);
wl_status_t status(void);
bool connect(char * host, unsigned int port);
bool isConnected(void);
void disconnect(void);
void print(char * buffer);
void print(const __FlashStringHelper *ifsh);
void readLoop(void);
void setTimeout(long timeout);
byte readBytes(char* buffer, byte buffer_size);
bool startScan(void);
bool scanEntry(char * ssid, char * rssi, byte *security);
void getMac(byte mac[6]);