ESP-12 (ESP8266) wireless WIFI transceiver (HCMODU0077)
Posted: Thu Feb 19, 2015 1:01 pm
Order yours here
This amazingly priced wireless module allows any microcontroller to connect to a 802.11b/g/n wireless network. This in turn provides your microcontroller project with the ability or request data from a server anywhere in the word via a suitable WiFI connection. Control of the module couldn't be simpler as it comes pre-flashed with a serial application allowing it to be controlled via simple 'AT' serial (9600 baud default) commands.
Please Note: This module operates at 3.3V only. If interfacing to a 5V microcontroller level shifters should be used.
SKU: HCMODU0077
Module: ESP-12
Device: ESP8266MOD
Frequency: (ISM): 2.4GHz
Power: +25dBm
Supported Wifi: 802.11 b/g/n
Operating voltage: 3.3V
Min Current (Sleep): 10mA
Max current (connected to 802.11b network): 215mA
VCC.........3.3V
GND........0V
CH_PD.....Power down pin. Connect to 3.3V for normal operation
Additionally to configure the module to accept AT commands you should connect the following pins to GND/VCC
GPIO0......VCC (HIGH)
GPIO2......VCC (HIGH)
GPIO15....GND (LOW)
AT Commands:
Default baud rate is 9600 baud. All commands must be terminated with both a cartridge return <CR> and line feed <LF>
Example website request:
Open up a serial terminal connection to the module with a baud rate of 9600 BAUD
Reset the module so that it is in a known status:
AT+RST
Response:
ü!¤§æÇ!Âÿ1ä)}ôÊõ
[Vendor:www.ai-thinker.com Version:0.9.2.4]
Set the mode to client:
AT+CWMODE=1
Response:
change
List available WiFi networks:
AT+CWLAP
Response:
+CWLAP:(4,"HCTest",-61,"xx:xx:xx:xx:xx:xx",1)
+CWLAP:(4,"HCWLS",-53,"xx:xx:xx:xx:xx:xx",8)
OK
Connect to your access point:
AT+CWJAP="YOURSSID","YOURPASSWORD"
Respose:
OK
Open a TCP connection to a website:
AT+CIPSTART="TCP","google.co.uk",80
Response:
OK
Linked
Request a page (number of bytes includes a CR & LF):
AT+CIPSEND=30
Response:
>
The '>' signifies that the module is now expecting 30 bytes of data including a CF & LF
Send a GET request for the page:
GET http://www.google.co.uk/
The module will now return the result of the request followed by an OK
Basic Server Example:
Open up a serial terminal connection to the module with a baud rate of 9600 BAUD
Reset the module so that it is in a known state:
AT+RST
Set the mode to both client and access point:
AT+CWMODE=3
The module should now be visible to any wifi client such as a PC, tablet or smart phone with a default SSID of 'ESP_9D66BF' as an open wifi network. Connect to this network with your WiFi client.
Allow multiple connections:
AT+CIPMUX=1
Enable as server accepting connections on port 80:
AT+CIPSERVER=1,80
The default address (gateway) of the module will be 192.168.4.1
Open a browser on your client and go to this address. You should now see your browsers request appear in the terminal window. To send a basic response:
Tell the module we are sending 26 bytes of data (including a CR+LF)
AT+CIPSEND=0,26
Module will responds with a '>'
Send the following:
<body>Hello World</body>
The text hello world should now appear in your clients browser.
Close the connection:
AT+CIPCLOSE=0