ESP-12F Wi-Fi Module Configration

Editor

ESP-12F Wi-Fi Module Configration

ESP-12F Wi-Fi Modül Konfigürasyonu
ESP-12F, Arduino veya başka  bir mikrodenetleyici sistemle kullanmak istediğimizde; UART modunda çalıştırmak için resimdeki  bağlantı kurulur. Pin bağlantıları yapıldığında, mikrodenetleyici sistemden gönderilen "AT" komutları ile TCP/IP ayarları yapılabilir.
Resim1-Bağlantı
"AT" karakterleri ile başlayan komutlar, mikrodenetleyici sistem tarafınfan hex kodlarına çevrilerek Wi-Fi modülüne gönderilir. Wi-fi Modüle data gönderimi, Wi-Fi Modülün "RX" pininden yapılır.  Not: ESP-12F Wi-Fi modülü 0-3 Volt (Mantık 0, Mantık 1) seviyelerinde çalışır.
Bazı örnek "AT " komutları aşağıda:
1. Set WiFi mode.
AT+CWMODE=3 // softAP+station mode
Response:
OK

2. Connect to a router.
AT+CWJAP="SSID","password" // SSID and password of router
Response:
OK

3. Query the ESP8266 device's IP address.
AT+CIFSR
Response:
+CIFSR:APIP,"192.168.4.1"
+CIFSR:APMAC,"1a:fe:34:a5:8d:c6"
+CIFSR:STAIP,"192.168.3.133"
+CIFSR:STAMAC,"18:fe:34:a5:8d:c6"
OK

4. Connect PC to the same router that ESP8266 is connected to. Using a network tool on
the computer to create a server.
- For example, the TCP server on PC is 192.168.3.116, port 8080.

5. ESP8266 connects to the server as a TCP client.
AT+CIPSTART="TCP","192.168.3.116",8080 //protocol, server IP and port
Response:
OK

6. ESP8266 sends data to the server.
AT+CIPSEND=4 // set date length which will be sent, such as 4 bytes
>test // enter the data, no CR
Response:
Recv 4 bytes
SEND OK

7. End the TCP connection.
AT+CIPCLOSE
Response:
CLOSED
OK

Popular Articles