2017年3月20日 星期一

NodeMcu - ESP8266

總算拿到手了!
由外觀看起來chip是ESP8266MOD

接上USB後,因為CH340的USB chip, win10預設沒driver
直接選自動更新就可以取得driver,win10就是這一點好!

打開com port,發現下AT都沒反應 (115200)
按板子上的reset鍵發現是有資料出來的
如下:
??l????l,?@>?t? ?H>lt?E?@>l??? ?$?2b??? < >n ?KGaiZ CHX$?"E?? ??D?????l????l,?@:?t? ?@>?t?E?@>l??? ?$?2b??XY?
>n ?.? z h?,$? 6$`?D???{l? b??og?l'o??? # x??${l{$p?'? ? l c o?< l l??c??'o?` ? 'o $` g{???o ??l p?n? {????? c o?| ????c??g'?{??????l c g?| d?r? c??gn??$l` {l??n???gn?????{ 'og? d?c{sd?ldlg???? g??g ??ll??c ??llxc? c{???l 'd?p??d`cl d??g ?n???g$?| # l d` ;l?? ? ?o??;??g|? l l?? $??s?l?l ? l` ??{?d?l ? d` ??r?l ??ls?lb??o?? og? ?l?x l ? d??? ? ? ?d? $? '????c l ?cxsdrd
Ai-Thinker Technology Co. Ltd.

ready

後來把結尾字元改為"\r\n"就正常了

AT+GMR

AT version:1.2.0.0(Jul  1 2016 20:04:45)
SDK version:1.5.4.1(39cb9a32)
Ai-Thinker Technology Co. Ltd.
Dec  2 2016 14:21:16
OK

參考這邊的版本指令:
http://www.electrodragon.com/w/ESP8266_AT-Command_firmware

這邊有不少資源,但還未確認是否可用,真的很猛,連怎麼在WiFi的chip跑RTOS都有寫手冊
http://bbs.espressif.com/viewtopic.php?f=67&t=225

AT command手冊
http://www.espressif.com/sites/default/files/documentation/4a-esp8266_at_instruction_set_cn.pdf

看手冊使用了幾個指令都OK,代表買回來的東西是可以用的,GOOD!
AT+RST
結果:
OK

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 1856, room 16
tail 0
chksum 0x63
load 0x3ffe8000, len 776, room 8
tail 0
chksum 0x02
load 0x3ffe8310, len 552, room 8
tail 0
chksum 0x79
csum 0x79

2nd boot version : 1.5
  SPI Speed      : 40MHz
  SPI Mode       : DIO
  SPI Flash Size & Map: 32Mbit(512KB+512KB)
jump to run user1 @ 1000

?? ? ?'??{??n<? $ d?? l??;?$?d ? $` ??s?l?$ ? l` ??{?d ?? ld` ;l??;d????c d?#{| ?cp ?l?c d;?$c??g?? 'o? ?d?p $ ? l??? ? ? ?l? d? g????# $ ?cp;l{l
Ai-Thinker Technology Co. Ltd.

ready

WIFI STATION測試
AT+CWMODE_CUR=1
OK
AT+CWJAP_CUR="ABC","123456"
WIFI CONNECTED
WIFI GOT IP

OK

AT+CWLAP

+CWLAP:(3,"L.R-Foot-AA",-81,"78:44:76:97:70:80",1,16,0)
+CWLAP:(0,".1.Free Wi-Fi",-86,"70:62:b8:b7:d6:96",1,3,0)
+CWLAP:(0,"CHT Wi-Fi Auto",-88,"70:62:b8:b7:d6:90",1,3,0)
+CWLAP:(2,"P874",-80,"c8:6c:87:36:bc:79",1,-4,0)
+CWLAP:(0,"CHT Wi-Fi(HiNet)",-88,"70:62:b8:b7:d6:91",1,3,0)
+CWLAP:(0,"..YO! (Free)",-89,"70:62:b8:b7:d6:95",1,3,0)
+CWLAP:(2,"TOTOLINK N300RH",-85,"78:44:76:97:d0:74",1,20,0)
+CWLAP:(3,"8N5F2",-58,"cc:f3:a5:c6:9c:f6",11,20,0)
+CWLAP:(3,"MOTOROLA-A64B2",-63,"f8:35:dd:5d:9e:57",11,10,0)
+CWLAP:(4,"Hilda",-87,"1c:ab:c0:1d:78:f8",11,11,0)
+CWLAP:(4,"ASUS",-93,"c8:60:00:aa:c4:c0",7,28,0)
+CWLAP:(4,"D-Link_DIR-612",-91,"48:ee:0c:e4:fc:1d",11,21,0)
+CWLAP:(3,"6740C",-91,"cc:b2:55:ff:a8:39",11,3,0)

OK

AT+PING="8.8.8.8"

+56

OK
AT+PING="8.8.8.8"

+64

OK