# EC20鍏ㄧ綉閫氬紑鍙戞澘

鐩墠鍋氫簡鏈�2涓増鏈殑EC20锛屽彲浠ラ€夋嫨鑷繁鐔熸倝鐨勫崟鐗囨満鍘诲紑鍙�

|                    | EC20 ARDUINO MICRO鍐呮牳鐗堟湰             | EC20 STM32F103鍐呮牳鐗堟湰   |
| ------------------ | -------------------------------------- | ------------------------ |
| 鍏ㄧ綉閫氬唴鏍�         | EC20/EC200T                            | EC20/EC200T              |
| 鍔熻兘               | 鐢佃瘽/鐭俊/GPS/缃戠粶閫氳绛�               | 鐢佃瘽/鐭俊/GPS/缃戠粶閫氳绛� |
| 鏀寔SIM鍗�          | 绉诲姩/鑱旈€�/鐢典俊 micro灏哄               | 绉诲姩/鑱旈€�/鐢典俊 micro灏哄 |
| 鏉胯浇鍗曠墖鏈�         | ARDUINO MICRO鍐呮牳                      | STM32F103C8T6            |
| 鍗曠墖鏈篎LASH澶у皬    | 32KB銆怉Tmega32U4銆戯紙4K鐢ㄤ簬bootloader锛� | 64KB                     |
| 鍗曠墖鏈篟AM澶у皬      | 2.5 KB                                 | 20KB                     |
| 鍗曠墖鏈轰笅杞界▼搴忔柟寮� | 鏉胯浇USB鎺ュ彛                            | 鏉胯浇USB涓插彛鐢佃矾/SWD鎺ュ彛  |
| 棰勭暀IO鏁伴噺         | 17                                     | 34                       |
| 渚嬬▼浣跨敤寮€鍙戠幆澧�   | ARDUINO IDE                            | MDK                      |

### ARDUINO MICRO鍐呮牳鐗堟湰澶栬锛�

![](media/O1CN01IXhrEa1LbgbrzWdEi63891318.png)

娣樺疂鍟嗗搧閾炬帴锛歔https://item.taobao.com/item.htm?ft=t&id=616146312924](https://item.taobao.com/item.htm?ft=t&id=616146312924)

### STM32F103鍐呮牳鐗堟湰澶栬锛�

![](media/O1CN01USHqa91Lbgds9TaWt63891318.jpg)

娣樺疂鍟嗗搧閾炬帴锛歔https://item.taobao.com/item.htm?ft=t&id=616146312924](https://item.taobao.com/item.htm?ft=t&id=616146312924)

## 閰嶅璧勬枡涓嬭浇鍦板潃

[https://pan.baidu.com/s/1zXxJKVSQtvLmbIYAl8fD1w](https://pan.baidu.com/s/1zXxJKVSQtvLmbIYAl8fD1w ) 鎻愬彇鐮侊細3333 銆愬鏋滅櫨搴︿簯鐩樹笅杞藉湴鍧€鏃犳晥锛岃鑱旂郴[鏈簵閾篯(https://ilovemcu.taobao.com/)瀹㈡湇鏇存敼銆�

## 瑙嗛鏁欑▼浼犻€侀棬

## 纭欢璁茶В鍜岀數鑴戠洿鎺ヨ皟璇�

[ARDUINO鍐呮牳鐗堟湰纭欢璁茶В](https://www.bilibili.com/video/BV1Tt4y127XW)

[STM32F103鍐呮牳鐗堟湰纭欢璁茶В](https://www.bilibili.com/video/BV1CK4y1h7VC)

[AT璋冭瘯绡�--鎵撶數璇濄€佹帴鍚數璇濄€佸彂閫佹帴鏀惰嫳鏂囩煭淇★紝鍙戦€佹帴鏀朵腑鏂囩煭淇″姛鑳藉疄鐜癩(https://www.bilibili.com/video/BV1PV411d7QC)

[AT璋冭瘯绡�--TCP閫氳鏀跺彂娴嬭瘯锛屾湇鍔″櫒鏀跺彂閫氳](https://www.bilibili.com/video/BV1vi4y1t7Gx)

[AT璋冭瘯绡�--GPS瀹氫綅鍔熻兘娴嬭瘯](https://www.bilibili.com/video/BV1Z54y1Q7sp)


## STM32鍐呮牳渚嬬▼瑙嗛鏁欑▼
[1.鎵撶數璇濆姛鑳絔(https://www.bilibili.com/video/BV18D4y1d7Xg)

[2.鍙戦€佽嫳鏂囩煭淇(https://www.bilibili.com/video/BV1Sa411w7ew)

[3.鍙戦€佷腑鏂囩煭淇(https://www.bilibili.com/video/BV1ca411A7cs)

[4.鐭俊鎺у埗LED寮€鍏砞(https://www.bilibili.com/video/BV1vK4y1h76G)

[5.TCP閫氫俊](https://www.bilibili.com/video/BV1uv411k7Eb)

[6.涓婁紶鏁版嵁鍒颁腑鍥界Щ鍔╫nenet鐗╄仈缃戞湇鍔″櫒](https://www.bilibili.com/video/BV1jf4y1B7kp)

[7.GPS鏁版嵁瑙f瀽](https://www.bilibili.com/video/BV1ri4y1j7Vt)

[8.璺緞鏄剧ず鍔熻兘浠g爜](https://www.bilibili.com/video/BV1ey4y1C71E)


## ARDUINO鍐呮牳渚嬬▼瑙嗛鏁欑▼
[1.鎵撶數璇濆姛鑳絔(https://www.bilibili.com/video/BV1uA411t78c)

[2.鍙戦€佽嫳鏂囩煭淇(https://www.bilibili.com/video/BV1454y1X7Wr)

[3.鍙戦€佷腑鏂囩煭淇(https://www.bilibili.com/video/BV12g4y1q7Re)

[4.鐭俊鎺у埗LED寮€鍏砞(https://www.bilibili.com/video/BV1sC4y1H7YB)

[5.TCP閫氫俊](https://www.bilibili.com/video/BV1tk4y167nC)

[6.涓婁紶鏁版嵁鍒颁腑鍥界Щ鍔╫nenet鐗╄仈缃戞湇鍔″櫒](https://www.bilibili.com/video/BV1WA411t7SQ)

[7.GPS鏁版嵁瑙f瀽](https://www.bilibili.com/video/BV1he411W7Rt)

[8.璺緞鏄剧ず鍔熻兘浠g爜](https://www.bilibili.com/video/BV1ap4y1Q7Da)

## PC鐩存帴璋冭瘯EC20鏂规硶

鍥犱负閮ㄥ垎鍐呭鍜屽崟鐗囨満娌′粈涔堝叧绯伙紝鏄洿鎺ヨ皟璇旹C20锛屾墍浠ヤ笉鍚岀増鏈殑璋冭瘯鏂规硶鏄竴鏍风殑锛岄兘鍙互鍙傝€冭繖涓珷鑺�

### 鎻掑崱鏂瑰悜
鏈紑鍙戞澘鏄叏缃戦€氬紑鍙戞澘锛屾敮鎸佺Щ鍔�/鑱旈€�/鐢典俊鍗�
SIM鍗′娇鐢ㄥ昂瀵告槸涓崱锛宮icro灏哄
鎻掑叆鏂瑰紡涓€瀹氳娉ㄦ剰缂哄彛鏂瑰悜濡傚浘锛屽啀鏂數鐨勭姸鎬佷笅鎻掑叆

![](media/O1CN012pfHls1LbgbjxOezw63891318.jpg)

### 澶╃嚎鎻掑叆

![](media/O1CN01H43Oiy1LbgbpygJDb63891318.jpg)


### 妯″潡渚涚數
涓轰繚璇丒C20妯″潡绋冲畾杩愯锛屼篃涓轰簡淇濇姢鐢佃剳涓绘澘涓嶅彈鎹熷潖銆�
鏈ā鍧椾娇鐢ㄧ數婧愰€傞厤鍣ㄤ緵鐢碉紝鏍囬厤浼氭彁渚涚數婧愰€傞厤鍣ㄣ€�
鏉垮瓙涓婄殑鎵€鏈塙SB鎺ュ彛涓嶅鏉垮瓙渚涚數锛岃繖鏍锋澘瀛愮殑鐢垫祦涔熶笉浼氶€氳繃USB杩涘叆鐢佃剳锛屼繚璇佷簡鐢佃剳鐨勫畨鍏ㄦ€с€�
鐢垫簮鎻掑湪宸︿笂瑙掔殑DC鎺ュ彛锛岀劧鍚庢墦寮€鎷ㄥ姩寮€鍏虫墦寮€鐢垫簮

![](media/O1CN01LCruUk1LbgbrSvDxk63891318.jpg)

## 妯″潡鐢ㄧ數鑴戣皟璇�

![](media/O1CN01O6jD301LbgbrSutAk63891318.jpg)

### 璋冭瘯鏂规硶1锛�

濡傛灉浣犳湁USB-TTL妯″潡鎺ユā鍧楀幓璋冭瘯,濡傛灉娌℃湁灏辩敤鏂规硶2

鎺ョ嚎鏂瑰紡

```
usb-ttl          鍏ㄧ綉閫氭ā鍧�
5V	   --->			V_IO
GND    --->			GND
RXD    --->			TX
TXD	   --->			RX
```

杩欑鏂规硶鏄洿鎺ヨ皟璇曚覆鍙g殑TTL鎺ュ彛銆傛澘瀛愬凡缁忓仛浜嗙數骞宠浆鎹紝杩欑粍涓插彛宸茬粡鍋氫簡鐢靛钩杞崲锛�

涔熷氨鏄鍙互鍏煎5v鎴栬€�3.3v鍗曠墖鏈猴紝濡傛灉浣犳兂澶栫疆鍗曠墖鏈哄幓鎺у埗浠栵紝涔熷彲浠ユ帴杩欏嚑涓紩鑴氥€�

鍏朵腑V_IO鏄繀椤绘帴鐨勶紝濡傛灉浣犵敤5v鍗曠墖鏈哄氨鎺�5v锛屽鏋滅敤3.3v鍗曠墖鏈哄氨鎺�3.3v



濡傛灉鐢║SB-TTL妯″潡鏂规硶鍋欰T鎸囦护璋冭瘯锛屾尝鐗圭巼榛樿鏄�115200锛屼竴瀹氳璁颁綇銆�

浠ュ悗鎴戜滑鐨勫崟鐗囨満鎺у埗杩欎釜妯″潡涔熸槸鐢�115200娉㈢壒鐜�



![](media/O1CN01uzxeGk1LbgbuBL88R63891318.png)





### 璋冭瘯鏂规硶2锛�

鍙互閫氳繃鍙充笅瑙掔殑USB鎺ュ彛鐩存帴鎺ョ數鑴戣皟璇曪紝杩欎釜姣旇緝鏂逛究锛屾帹鑽愪娇鐢ㄨ繖涓柟娉曞涔燗T鎸囦护娴佺▼

## 妯″潡椹卞姩瀹夎

鍥犱负鐢ㄥ埌鍏ㄧ綉閫氭ā鍧楃殑鍙充笅瑙抲sb锛屽氨闇€瑕佸畨瑁呴┍鍔ㄣ€�

椹卞姩鏂囦欢鍦ㄨ祫鏂欏寘鍐咃紝瀹夎濂藉悗

鍦ㄧ數鑴戜笂浼氬舰鎴�3涓狢OM


![](media/O1CN01EuyeN11LbgbofPC0K63891318.png)


涓€涓狝T涓插彛鐢ㄤ簬AT鎸囦护

涓€涓狣M涓插彛鐢ㄤ簬璋冨埗瑙h皟鍣ㄦ嫧鍙�

涓€涓狽EMA涓插彛鐢ㄤ簬GPS鏁版嵁杈撳嚭

鑰屼笖鍦ㄧ數鑴戝彸涓嬭鐨勭綉缁滀細澶氬嚭鏉ヤ竴涓墜鏈虹綉缁滐紝杩欐牱鐢佃剳鍙互閫氳繃杩欎釜妯″潡鐩存帴涓婄綉銆�

鍙浣犵殑SIM鍗℃祦閲忚冻澶�(*^鈻絕*)锛岃繖涓嚜宸卞幓灏濊瘯鍚с€備笉鏄垜浠暀绋嬬殑閲嶇偣


![](media/O1CN01l1cL5e1LbgbpdIOs063891318.png)


閲嶇偣鏄敤AT璋冭瘯锛岃繖閲屾垜浠氨鐢ㄥ埌杩欎釜AT鐨勪覆鍙o紝璁板綍濂紺OM鍙凤紝鐢ㄤ覆鍙e姪鎵嬫墦寮€


![](media/O1CN01IBboFw1LbgbpzZQRl63891318.png)


鎵撳紑瀵瑰簲涓插彛锛岃緭鍏ユ杈撳叆AT锛屽嬀閫夊彂閫佹柊琛岋紝鐒跺悗鐐瑰彂閫侊紝鑳藉洖澶岮T OK璇存槑鍩虹娴嬭瘯鐜鎼缓瀹屾垚

杩欓噷娉㈢壒鐜囨槸鑷€傚簲鐨勶紝鍙互閫�9600鎴栬€�115200绛夌瓑

## 鍩虹璋冭瘯

鍏堟祴璇曟槸鍚﹁瘑鍒崱锛屽崱淇″彿澶氬皯锛屾槸鍚︽湁鏈嶅姟

鐢ㄥ埌

AT+CPIN?

AT+CSQ

AT+CREG?

涓夋潯鎸囦护锛�

鍏朵腑CPIN濡傛灉鏄疪EADY璇存槑鏈夊崱锛屽鏋滄槸ERROR璇存槑鍗℃病鎻掑锛岀湅涓婇潰鎻掑崱璇存槑锛屾柇鐢甸噸鏂版彃鍗★紝鍐嶅紑鏈烘祴璇曘€傚叧闂數婧愬墠璁板緱鍏堝叧闂覆鍙o紝瑕佷笉寮傚父鏂紑涓插彛闇€瑕佺敤浠诲姟绠$悊鍣ㄥ叧闂璖SCOM杞欢

CSQ鐢ㄦ潵娴嬭瘯淇″彿寮哄害锛屼竴鑸澶т簬18浠ヤ笂鎵嶅彲浠�

CREG鐢ㄦ潵鐪嬪崱鏈夋病鏈夋湇鍔★紝涓€鑸槸杩斿洖0,1鎴栬€�0,5鎵嶅彲浠ワ紝濡傛灉鏄叾瀹冪殑锛屽氨鏄崱杩樻病鑾峰彇鏈嶅姟銆傜瓑寰呬細鍎垮啀娴嬭瘯锛屼竴鐩寸湅鏄�0,1鎴栬€�0,5鍚庢墠鑳藉仛鍚庨潰鐨勫姛鑳借皟璇�


![](media/O1CN01nt06t81LbgbtLDL9o63891318.png)


## 鎷ㄦ墦鍜屾帴鍚數璇�

ATD 鎸囦护鐢ㄤ簬鍛煎彨鏌愪竴鍙风爜

涓句緥鎷ㄦ墦10086鐨勭數璇濓紝璁板緱鎸囦护鍚庨潰鏈変釜鑻辨枃鏍囩偣鐨勫垎鍙�,鐢ㄤ覆鍙e彂閫�

```
ATD10086;
```

濡傛灉鎷ㄦ墦鏌愪釜鎵嬫満鍙凤紝灏辩洿鎺ユ敼涓婇潰鐨勫彿鐮佸氨鍙互

濡傛灉鎯虫寕鏂娇鐢ˋTH鎸囦护鎸傛柇


![](media/O1CN01yhjUwS1LbgbtvOq6W63891318.png)


鎺ュ惉鐢佃瘽鏇寸畝鍗曪紝褰撲綘鎷ㄦ墦妯″潡涓婄殑鍗$殑鐢佃瘽锛屼覆鍙d細杩斿洖RING锛岃繖涓椂鍊欏彲浠ラ€氳繃ATH鎸傛柇

鎴栬€呴€氳繃ATA鎺ラ€氱數璇�

![](media/TB2K0Llhf6H8KJjSspmXXb2WXXa-63891318.png)

褰撶劧杩欐椂鍊欎篃鍙互鐢ˋTH鎸囦护鎸傛柇
鍙﹀鎯崇湡鐨勫疄鐜拌闊冲彲浠ヤ娇鐢ㄥ垎绂诲紡鑰虫満楹﹀厠鎻掑叆寮€鍙戞澘鐨凪IC鍜孍AR鎺ュ彛杩涜閫氳瘽銆�

## 鎺ユ敹鑻辨枃鐭俊娴佺▼

鐢ㄤ覆鍙e彂閫佺粰EC20濡備笅鍑犳潯璁剧疆鎸囦护

```
AT+CMGF=1
```

```
AT+CSCS="GSM"
```

娉ㄦ剰浠ヤ笂寮曞彿閮芥槸鑻辨枃杈撳叆鐘舵€佷笅鐨勬爣鐐�

```
AT+CNMI=2,1
```

EC20鍥炲濡備笅

![](media/TB2_Ozqhh6I8KJjy0FgXXXXzVXa-63891318.png)


鐢ㄦ墜鏈虹粰EC20鍙戦€佷竴鏉℃祴璇曠煭淇★紝鍐呭姣斿鈥渋lovemcu.taobao.com鈥�
EC20妯″潡浼氳繑鍥�+CMTI: "SM",37
  鏈€鍚庣殑杩欎釜37鐨勬暟瀛楁槸鍦ㄧ煭淇$涓殑浣嶇疆锛屼篃鍙互鐞嗚В鎴愮鍑犳潯鐭俊

  ![](media/TB2niDqhh6I8KJjy0FgXXXXzVXa-63891318.png)


鐒跺悗鍙戦€佸涓嬫寚浠わ紝璁板緱鍚庨潰鐨勬暟瀛楀氨鏄綘瑕佽鍙栫殑鐭俊鍙凤紝鎴戣繖閲屾槸37

```
AT+CMGR=37
```


![](media/TB2X_iAhdbJ8KJjy1zjXXaqapXa-63891318.png)


## 鍙戦€佽嫳鏂囩煭淇℃祦绋�

鐢ㄤ覆鍙e彂閫佺粰EC20濡備笅鍑犳潯璁剧疆鎸囦护

```
AT+CMGF=1
```

```
AT+CSCS="GSM"
```

娉ㄦ剰浠ヤ笂寮曞彿閮芥槸鑻辨枃杈撳叆鐘舵€佷笅鐨勬爣鐐�
EC20鍥炲濡備笅

![](media/TB2x7PNbQfb_uJjSsD4XXaqiFXa-63891318.png)


鍋囧瑕佺粰鏌愪釜鎵嬫満鍙蜂负173xxxxxxx1鐨勭數璇濆彂閫佺煭淇�
鍙戦€佸涓嬫寚浠�

```
AT+CMGS="173XXXXXXX1"
```

绛夋ā鍧楄繑鍥炰竴涓�  >  鍚庯紝鍙互鍙戦€佺煭淇″唴瀹逛簡
姣斿鎴戜滑杩樻槸鍙戦€佸唴瀹规槸鈥渋lovemcu.taobao.com鈥�
鍙戦€佽繖鏍风殑鍐呭锛岃寰楄繖閲屾渶濂芥槸鍘绘帀鍙戦€佹柊琛岋紝鍘诲彂閫佸唴瀹�

![](media/TB2W7SIhdfJ8KJjy0FeXXXKEXXa-63891318.png)


鐒跺悗鍒颁簡鏈€閲嶈鐨勪竴姝ワ紝
涓婇潰鍙槸鎶婄煭淇″唴瀹瑰彂閫佺粰EC20妯″潡锛屽苟娌℃湁鎶婄煭淇″彂閫佸嚭鍘汇€�
  鑰岀幇鍦ㄨ繖涓楠ゅ氨鏄浉褰撲簬鎵嬫満涓婄殑鍙戦€佹寜閿紝鐐硅繃涔嬪悗鐭俊灏卞彂閫佸嚭鍘讳簡銆�
  闇€瑕佸湪HEX妯″紡涓嬪彂閫�1A锛屽涓嬪浘

![](media/TB268EHcvjM8KJjSZFNXXbQjFXa-63891318.png)


绋嶇瓑鐗囧埢锛屾偍鐨勬墜鏈哄氨搴旇鎺ユ敹鍒拌繖鏉$煭淇′簡

## 鎺ユ敹璇诲彇甯︿腑鏂囩煭淇℃祦绋�

鐢ㄤ覆鍙e彂閫佺粰EC20濡備笅鍑犳潯璁剧疆鎸囦护

```
AT+CMGF=1
```

```
AT+CSCS="GSM"
```

娉ㄦ剰浠ヤ笂寮曞彿閮芥槸鑻辨枃杈撳叆鐘舵€佷笅鐨勬爣鐐�

```
AT+CNMI=2,1
```

EC20鍥炲濡備笅

![](media/TB2H1vDhcLJ8KJjy0FnXXcFDpXa-63891318.png)


鐢ㄦ墜鏈虹粰EC20鍙戦€佷竴鏉℃祴璇曠煭淇★紝鍐呭姣斿鈥滃ぇ瀛︾敓鐢靛瓙鍟嗛摵鈥�
EC20妯″潡浼氳繑鍥�+CMTI: "SM",40
  鏈€鍚庣殑杩欎釜40鐨勬暟瀛楁槸鍦ㄧ煭淇$涓殑浣嶇疆锛屼篃鍙互鐞嗚В鎴愮鍑犳潯鐭俊

![](media/TB28xDKbQfb_uJkSne1XXbE4XXa-63891318.png)




鐒跺悗鍙戦€佸涓嬫寚浠わ紝璁板緱鍚庨潰鐨勬暟瀛楀氨鏄綘瑕佽鍙栫殑鐭俊鍙凤紝鎴戣繖閲屾槸40

```
AT+CMGR=40
```

![](media/TB20BMweOqAXuNjy1XdXXaYcVXa-63891318.png)


涓婇潰鐨勫嚑姝ラ兘鍜岃鍙栬嫳鏂囩煭淇℃病鍖哄埆锛屽叧閿槸濡備綍瑙f瀽鍑烘潵涓枃鐭俊锛�
杩欓噷鎴戜滑鍙互浣跨敤Unicode鐨勪竴浜涘伐鍏凤紝姣斿璧勬枡鍖呭唴鐨剈nicode杞崲鍣�

![](media/TB2.OGthlDH8KJjSszcXXbDTFXa-63891318.png)


杩欐牱灏辫兘鐪嬪埌鎺ユ敹鍒扮殑涓枃鐭俊鍐呭浜�

## 鍙戦€佷腑鏂囩煭淇℃祦绋�

杩欓噷鎴戣瑙d竴绉嶆渶绠€鍗曟柟渚跨殑鍙戦€佷腑鏂囩殑鍔炴硶锛屽綋鐒惰繕鏈夊叾瀹冪殑鍔炴硶锛屾瘮濡侾DU妯″紡鍙戦€佷腑鏂囷紝姣旇緝绻佺悙锛屾兂瀛︿範鐨勫彲浠ュ崟鐙櫨搴﹀涔犮€�

鐢ㄤ覆鍙e彂閫佺粰EC20濡備笅鍑犳潯璁剧疆鎸囦护

```
AT+CMGF=1
```

```
AT+CSCS="UCS2"
```

娉ㄦ剰浠ヤ笂寮曞彿閮芥槸鑻辨枃杈撳叆鐘舵€佷笅鐨勬爣鐐�

```
AT+CSMP=17,167,0,8
```

EC20鍥炲濡備笅

![](media/TB245I6f63z9KJjy0FmXXXiwXXa-63891318.png)

2. 鍋囧瑕佺粰鏌愪釜鎵嬫満鍙蜂负173xxxxxxx1鐨勭數璇濆彂閫佺煭淇★紝鎴戜滑鍏堣幏鍙栬繖涓墜鏈哄彿鐨刄nicode缂栫爜锛�
   杩樻槸鐢ㄤ笂涓€璁茬敤鍒扮殑宸ュ叿

![](media/TB2VUaFhdzJ8KJjSspkXXbF7VXa-63891318.png)

     鍚屾牱鐨勬柟娉曪紝鍐嶈浆鎹笅鐭俊鍐呭锛屾瘮濡傝繕鏄彂閫佲€滃ぇ瀛︾敓鐢靛瓙鍟嗛摵鈥�

![](media/TB2iXPjhf2H8KJjy1zkXXXr7pXa-63891318.png)

     鍜屽彂閫佽嫳鏂囩煭淇′竴鏍凤紝浣跨敤AT+CMGS鎸囦护鍙戦€侊紝鍙笉杩囪繖閲岄渶瑕佹妸鐢佃瘽鍙风爜杞崲鍚庢斁杩涘幓,
     鍚屾牱鍙戦€佺煭淇″唴瀹规椂鍊欎笉鍕鹃€夊彂閫佹柊琛�

![](media/TB2syM6f63z9KJjy0FmXXXiwXXa-63891318.png)

     鐒跺悗鍚屾牱鐨勫彂閫佹柟娉曪紝閫夋嫨HEX锛屽悗鍙戦€�1A锛屾妸鐭俊鍙戦€佸嚭鍘伙紝褰撴敹鍒癘K鏃跺€欙紝绋嶇瓑灏辫兘鏀跺埌鐭俊浜�

![](media/TB2clGAhmYH8KJjSspdXXcRgVXa-63891318.png)

## 娴嬭瘯TCP閫氳鍔熻兘鐨勫繀瑕佸熀纭€

杩欓噷鏈変釜寰堝父瑙侀棶棰樺氨鏄€滃叕缃慖P鈥濓紝鐜板湪澶у鏁板甯﹂兘鏄病鏈夊叕缃慖P鐨勶紝鎵€浠ユ槸涓嶅叿澶囪GPRS璁块棶鍜屽彂閫佹暟鎹殑銆�
杩欎釜鈥滃叕缃慖P鈥濈殑闂锛屽湪鍏朵粬鐨勬暀绋嬩腑涔熸湁璁茶В锛岃繖閲屼笉鍐嶈缁嗚鏄庛€�
涓€鑸鐞嗗姙娉曪紝灏辨槸鍗曠嫭鎵惧甯﹀畼鏂规媺甯﹀叕缃慖P鐨勭綉缁滐紝涓€鑸叕鍙稿彲浠ュ姙鍒般€�

鎴栬€呰嚜宸变拱闃块噷浜戞湇鍔″櫒涓€鑸兘甯﹀叕缃慖P

涓汉娴嬭瘯鐨勮瘽灏辩敤鈥滆姳鐢熷3鈥濆幓鍐呯綉鏄犲皠灏辫浜嗐€傚彲鑳借鑺变竴浜涜垂鐢紝浣嗘槸鎬讳綋姣旇緝浣庯紝鎴戝彧鏄紑閫氫簡鏈€鍩虹鐨勫唴缃戞槧灏勶紝8鍏冿紝褰撶劧姣忎釜鏃堕棿鍙兘杩欎釜杞欢鏀惰垂涓嶅悓锛屼篃鍙兘鍏嶈垂銆�
鍏蜂綋鏂扮増鏈殑鑺辩敓澹虫€庝箞浣跨敤

鍙互鍙傝€冨畼鏂圭殑鏁欑▼锛�
http://service.oray.com/question/1664.html

褰撴偍宸茬粡鑳藉湪鑷繁鐨勭數鑴戝缓绔嬩竴涓鎴风锛屼竴涓湇鍔″櫒锛岃€屼笖鑳芥甯哥殑鍙戦€佹暟鎹氦浜掓椂鍊欙紝灏卞彲浠ュ幓鐢℅PRS妯″潡鍘昏繛鎺ユ偍鐨勬湇鍔″櫒閫氳娴嬭瘯浜嗐€�

![](media/TB2kYPnhf6H8KJjSspmXXb2WXXa-63891318.png)


## TCP娴佺▼娴嬭瘯
濂戒簡锛屾甯稿紑濮婫PRS娴嬭瘯锛孍C20鐨凣PRS鎸囦护鍜屼竴鑸殑SIMCOM鐨勬瘮濡係IM800C鐨勪笉澶竴鏍凤紝璇锋寜鐓т笅闈㈡祦绋嬫祴璇�

鐢ㄤ覆鍙e彂閫佺粰EC20濡備笅鍑犳潯璁剧疆鎸囦护

```
AT+CGREG?
```

鑳界湅鍒拌繑鍥�+CGREG: 0,1璇存槑宸茬粡娉ㄥ唽涓婄綉缁滀簡锛屽彲浠ョ敤

璁剧疆濂戒簡鍙互锛岃繛鎺ユ湇鍔″櫒鍙戦€佹暟鎹簡
鏌ョ湅涓嬭嚜宸辩殑鐨勫煙鍚嶅搴旂殑IP

![](media/O1CN01USaMA91Lbgbvg01n363891318.png)

  鐢ㄤ覆鍙e彂閫佺粰EC20,浣跨敤鐩磋繛妯″紡杩炴帴鏈嶅姟鍣↖P鍜岀鍙f寚浠わ紝杩欓噷瑕佸啓鑷繁鐨処P鍜岀鍙o紝鍏跺畠鐨勪笉瑕佷慨鏀�

```
AT+QIOPEN=1,0,"TCP","103.46.128.49",42773,0,1
```

鏄剧ずOK锛屽氨璇存槑杩炴帴涓婃湇鍔″櫒浜嗭紝鍙互鍙戦€佹暟鎹簡

```
AT+QISEND=0
```

AT+QISEND=0鎸囦护鍙戦€佹暟鎹紝绛夊緟鏄剧ず  >  鍚庯紝灏卞彲浠ュ彂閫佹暟鎹簡锛�
杩欓噷鎴戜滑杩樻槸鍙戦€佷竴涓祴璇曞唴瀹光€淚LOVEMCU.TAOBAO.COM鈥�
鐒跺悗閫夋嫨HEX鍙戦€侊紝鍙戦€�1A锛屾妸杩欎釜鍐呭鍙戦€佸嚭鍘伙紝杩欎釜鎿嶄綔绫诲悓鍙戦€佺煭淇$殑鎿嶄綔銆�
鏈€鍚庢垜浠氨鍙互鍦ㄦ湇鍔″櫒鐣岄潰鐪嬪埌鏁版嵁浜嗭紝鐒跺悗鎴戜滑鏈嶅姟鍣ㄥ彲浠ュ洖澶嶆暟鎹€渟erver ACK鈥濓紝
杩欐牱鎴戜滑鍦‥C20鐨勪覆鍙e氨鐪嬪埌鐨勫弽棣堟暟鎹�

![](media/O1CN01tJF7oV1LbgbpjVPmr63891318.png)

杩炴帴IP鍚庢垜浠彲浠ュ娆″彂閫佹暟鎹紝涓嶉渶瑕佹柇寮€銆�
濡傛灉涓嶆兂杩炴帴IP瑕佹柇寮€锛岄渶瑕佷互涓嬫寚浠�

```
AT+QICLOSE
```

![](media/O1CN01pfTsol1Lbgbq6vwMm63891318.png)
濡傛灉杩樻兂杩炴帴鍏朵粬IP鎴栬€呰繕鏄繖涓狪P灏遍噸澶嶄互涓婃祦绋嬪氨琛屼簡

## GPS瀹氫綅銆愬彧鏈夎喘涔板甫GPS鐨勭増鏈墠鏈夎繖涓姛鑳姐€�

棣栧厛瑕佹妸GPS澶╃嚎鎺ヤ笂锛屽鍐呮病鏈夊崼鏄熶俊鍙凤紝GPS澶╃嚎闇€瑕佹斁瀹ゅ锛屾槸蹇呴』鐨勶紒锛侊紒

![](media/O1CN01KABfU51Lbgc8Pnty963891318.png)

鍏堢敤AT鐨勪覆鍙o紝鍙戦€佸惎鍔℅PS鐨勬寚浠�

```
AT+QGPS=1
```

![](media/O1CN01cWbda81Lbgc52xTGF63891318.png)

娴嬭瘯鏂规硶1锛氱劧鍚庨噸鏂版墦寮€涓覆鍙e姪鎵嬶紝鍒囨崲鍒癗MEA鐨勫搴旂殑COM锛屽彲浠ョ洿鎺ョ湅NMEA杈撳嚭

![](media/O1CN01dWiWjd1Lbgc5Bn9nm63891318.png)

鏈畾浣嶇殑鐘舵€佸涓嬪浘

![](media/O1CN01YlEHZQ1Lbgc1OOJct63891318.png)

绋嶇瓑鍑犲垎閽熷畾浣嶅ソ鐨勭姸鎬�

![](media/O1CN0195HbAa1Lbgc2KcClf63891318.png)

鍏蜂綋NMEA鍗忚鍙互鍙傝€僋MEA鍗忚璇存槑杩欓噷涓嶅啀璁茶В锛屽彲浠ュ弬鑰冩垜浠崟鐙殑GPS妯″潡鐨勮瑙o紝鍗忚NEMA鏄€氱敤鐨�

鍗忚鍐呭涓嬭浇鍦板潃锛� 閾炬帴锛歨ttps://pan.baidu.com/s/13jChtLPagwbg12P2KLVVHw 鎻愬彇鐮侊細4321

璧勬枡鍖呭唴鎻愪緵鏈夊緢澶氭祴璇曡蒋浠讹紝姣斿GNSS_Viewer杞欢鍙互鐩磋鐪嬪崼鏄熺殑鐘舵€�

![](media/O1CN01TfNOWG1Lbgc2j7SXb63891318.png)

杞欢 GPS缁忕含搴︽祴璇曞伐鍏� 鍙互鎶奊PS鐨勫潗鏍囪浆鎹㈡垚鐧惧害鍦板浘鐨勭偣鏍囪銆傜敤浜庢祴璇�

![image-20230302100004601](media/image-20230302100004601.png)

娴嬭瘯鏂规硶2锛氶€氳繃AT鎸囦护鑾峰彇GPS淇℃伅

```
AT+QGPSLOC?
```

![image-20230302100021794](media/image-20230302100021794.png)

浣跨敤涓嬮潰鎸囦护鍙互鍗曠嫭璇诲彇鏌愪竴甯ф暟鎹紝姣斿GPRMC鐨勫彲浠ョ敤

```
AT+QGPSGNMEA="RMC"
```

![image-20230302100036126](media/image-20230302100036126.png)

![](https://img.alicdn.com/imgextra/i3/63891318/O1CN01JO1F6m1Lbgc1OnUed63891318.png)

鏈変簡杩欎簺鍗曠嫭AT鎸囦护锛屽氨鍙互寰堝鏄撶敤AT鍙e幓璇诲彇GPS鏁版嵁浜�
鍏跺畠鏇村鐨勬寚浠や娇鐢ㄥ拰鍔熻兘锛岃澶у鍙傝€冨畼鏂圭殑鍚勭鍔熻兘瀵瑰簲鐨勬枃妗�