https://alselectro.wordpress.com/2015/05/13/wi-fi-module-esp8266-3-connect-to-android-mobile/
Wi Fi Module ESP8266 – 3. Connect to Android Mobile
Check out my previous posts on WIFI ESP8266 1.AT COMMANDS , 2. TCP CLIENT/SERVER
In this post we shall see how to connect ESP module with an ANDROID Mobile device & communicate.
On ESP side following are the AT commands to configure :
AT+CWLAP – Lists all surrounding Access Points
AT+CWJAP = “SSID”,”password” – Join with your preferred AP
AT+CWMODE=1 ESP on STATION Mode
AT+CIPMUX=1 Allow multiple connections
AT+CIPSERVER=1,80 start the SERVER on port 80
AT+CIFSR to get the STATION IP Address
On your Android Mobile open SETTINGS & switch ON WI FI
Surrounding Access Points will be listed automatically.Select the one to which the ESP module has joined already.Here it is MBLAZE , which is a secured one.
Open the preferred WIFI access point & connect to it by providing the Password.
Now , my Mobile has connected to the Access point where ESP is already connected with.
From the Market , install a TELNET client on your Mobile
Open the TELNET Client
TELNET waits to get the Local Host IP & the Port number.
Enter the IP as 192.168.1.2 & Port as 80 .
This IP is the one we got from AT+CIFSR previously & we’ve started a Server on port 80 already with ESP.
Touch on Connect to Server
Now the TELNET Client is connected to the ESP server on port 80.
Type in some characters & touch Enter
The characters are received by the ESP Module
To send data to TELNET ,use the AT command
AT+CIPSEND=0,15
This command is to send 15 characters on channel 0
The message is received by the TELNET screen.
沒有留言:
張貼留言