2015年8月21日星期五

ESP8266 Initial Test

The module I use:  ESP-8266 ESP-01

1) Wire Connection
Since the USB to UART TTL module may not provide sufficient power for ESP-01,
use external power supply is recommended.

3.3V <-> ESP8266 VCC
3.3V <-> ESP8266 CH_PD
USB to UART TTL module RX <-> ESP8266 TX
USB to UART TTL module TX <-> ESP8266 RX
GND <-> USB to UART TTL module GND <-> ESP8266 GND

*: GPIO0 should be connected to GND if we want to update the firmware. Reboot is required before update.
For general purpose, GPIO0 can be float.

==========================================

2) Testing

In Linux environment, CuteCOM is recommended for testing the communication.

Below is the setup procedures:

Device: /dev/ttyUSB0
Baud rate: 115200
Data bits: 8
Stop bits: 1
Parity: None
Handshake: uncheck both
linefeed: default should be set to CR LF (sometimes you need to switch to use HEX Input format e.g. send raw byte)

Open the COM port and listen the response.
reboot the ESP-01 module.
It should return [Ready] string.

P.S.:
Please update to the latest firmware before use:
The latest firmware uses 115200, 8N1, AT COMMAND LINE END - CR LF for communication.
Before update the firmware, we need to download the SDK and the FLASH PROGRAMMING TOOLS first.

More details can be found in SDK documentation.



In CuteCOM, enter the following commands.
Input AT
response OK means success.

Input AT+CWMODE=1
For STATION MODE only . (3=STATION MODE+ SOFTAP MODE)

Input AT+CWLAP
List available access point.

============================================

3) NTP Client Implementation

Get current time stamp using NTP

#RESET
AT+RST

#GET FIRMWARE VER
#AT+GMR

#SET TO STATION MODE
AT+CWMODE=1

#LIST AP
AT+CWLAP

#CONNECT ACCESS POINT
AT+CWJAP="SSID","Password"

#MAKE CONNECTION.
#參考自:https://github.com/sandeepmistry ... lient/NTPClient.ino
#Other NTP Server might not work...
AT+CIPSTART="UDP","129.6.15.28",123

#SEND NTP PACKET
AT+CIPSEND=48

IN CuteCOM, change to HEX input.
Input the following:
E30006EC0000000000000000314E31340000000000000000000000000000000000000000000000000000000000000000

It should return 48 bytes packet.

沒有留言:

發佈留言