logo资料库

SIM7020_Series_HTTP_Application_Note_V1.02.pdf

第1页 / 共11页
第2页 / 共11页
第3页 / 共11页
第4页 / 共11页
第5页 / 共11页
第6页 / 共11页
第7页 / 共11页
第8页 / 共11页
资料共11页,剩余部分请下载后查看
About Document
Document Information
Revision History
Related Documents
Contents
1 Purpose of this document
2 Bearer Configuration
2.1 PDN Auto-activation
2.2 APN Manual configuration
3 HTTP GET service
4 HTTP POST service
5 Long command multi-package to create an HTTP instance
6 Long command multi-package to http post
Contact
Application Simplify Communication SIM7020 Series_HTTP_Application Note Version: 1.02 Release Date: May 10, 2019 Simplify Communication www.simcom.com SIMCom Confidential File
Simplify Communication About Document Document Information Document Title Version SIM7020 Series_HTTP_Application Note 1.02 Document Type Application Note Document Status Released/Confidential Revision History Revision Date 1.00 April 10, 2018 Owner Jin Zhang Status / Comments First Release. 1.01 1.02 June 7, 2018 Albert Meng Revised May.10, 2019 Jin Zhang Add chapter 5 and 6 Related Documents [1] SIM7020 Series_AT Command Manual_V1.03 This document applies to the following products: Comments Name Size (mm) Type NB1 NB1 NB2 17.6*15.7 17.6*15.7 17.6*15.7 Band 1/3/5/8 Band 1/3/5/8/20/28 Band 1/2/3/4/5/8/12/13/17/18/19/20/25/26/28/66/70/71/85 NB2+GNSS 24*24 Band 1/2/3/4/5/8/12/13/17/18/19/20/25/26/28/66/70/71/85 SIM7020C SIM7020E SIM7020G SIM7060G Copyrights This document contains proprietary technical information which is the property of SIMCom Wireless Solutions Co.,Ltd. Copying of this document and giving it to others and the using or communication of the contents thereof, are forbidden without express authority. Offenders are liable to the payment of damages. All rights reserved in the event of grant of a patent or the registration of a utility model or design. All specification supplied herein are subject to change without notice at any time. SIM7020 Series HTTP Application Note Page 2 / 11 SIMCom Confidential File
Simplify Communication Contents About Document ................................................................................................................... 2 Document Information .............................................................................................................. 2 Revision History ......................................................................................................................... 2 Related Documents ................................................................................................................... 2 Contents ................................................................................................................................ 3 1 2 3 4 5 6 Purpose of this document ............................................................................................... 4 Bearer Configuration ...................................................................................................... 4 2.1 2.2 PDN Auto-activation ...................................................................................................... 4 APN Manual configuration ............................................................................................ 4 HTTP GET service ............................................................................................................ 5 HTTP POST service .......................................................................................................... 6 Long command multi-package to create an HTTP instance ................................................ 6 Long command multi-package to http post ...................................................................... 9 Contact ................................................................................................................................ 11 SIM7020 Series_HTTP_Application Note Page 3 / 11 SIMCom Confidential File
Simplify Communication 1 Purpose of this document Based on module AT command manual, this document will introduce HTTP application process. Developers could understand and develop application quickly and efficiently based on this document. 2 Bearer Configuration Usually module will register PS service automatically. 2.1 PDN Auto-activation AT Command AT+CPIN? AT+CSQ AT+CGREG? AT+CGACT? AT+COPS? AT+CGCONTRDP Response +CPIN:READY OK +CSQ: 20,0 OK +CGREG: 0,1 OK +CGACT: 1,1 OK +COPS: 0,2,"46000",9 OK +CGCONTRDP: 1,5,"cmnbiot","100.80.73.123.255.255.255.0" OK Description Check SIM card status Check RF signal Check PS service Activated automatically Check operator information 46000 is Numeric 9 is NB-IOT network Attached PS domain and got IP address automatically 2.2 APN Manual configuration If not attached automatically, could configure correct APN setting. SIM7020 Series HTTP Application Note Page 4 / 11 SIMCom Confidential File
Simplify Communication AT Command AT+CFUN=0 AT*MCGDEFCONT ="IP","cmnbiot" AT+CFUN=1 AT+CGREG? AT+CGCONTRDP Response +CPIN: NOT READY OK OK OK +CPIN: READY +CGREG: 0,1 OK +CGCONTRDP: 1,5,"cmnbiot","100.80.73.123.255.255.255.0" OK Description Disable RF Set the APN manually Enable RF Inquiry PS service Attached PS domain and got IP address automatically 3 HTTP GET service AT Command AT+CHTTPCREATE="http:// www.sim.com/" AT+CHTTPCON=0 AT+CHTTPSEND=0,0,"/inde x.html" AT+CHTTPDISCON=0 AT+CHTTPDESTROY=0 Response +CHTTPCREAT: 0 OK OK OK +CHTTPNMIH:0,0,800,Date: Tue, 10 Apr 2018 07:24:25 GMT Server: Apache/2.0.58 (Win32) PHP/5.2.11 Last-Modified: Fri, 16 May 2014 01:01:31 GMT ETag: "282e-45-f4410fef" Accept-Ranges: bytes Content-Length: 69 Content-Type: text/html +CHTTPNMIC:0,0,69,138,3c736372697074206c6 16e67756167653d6a6176617363726970743e6c 6f636174696f6e2e687265663d27657370636d73 2f696e6465782e706870273c2f7363726970743e OK OK Description Create HTTP host instance Connect server send http request First parameter 0 is http instance id, second parameter 0 is http get method, third parameter is file, not include root path. If succeed, will report incoming data +CHTTPNMIH is header +CHTTPNMIC is content Disconnected from server Destroy HTTP instance SIM7020 Series_HTTP_Application Note Page 5 / 11 SIMCom Confidential File
Simplify Communication 4 HTTP POST service AT Command AT+CHTTPCREATE="http://139.217.9.49:8080/" AT+CHTTPCON=0 AT+CHTTPSEND=0,1,"/setBikeData",4163636 570743a202a2f2a0d0a436f6e6e656374696f6 e3a204b6565702d416c6976650d0a5573657 22d4167656e743a2053494d434f4d5f4d4f44 554c450d0a,"application/json",7b226465765 34e223a223131313132323232222c2273706 56564223a2232352e36222c226c6f6e676974 756465223a2233362e32222c226c617469747 56465223a2239382e36222c22616c74697475 6465223a2231302e38222c22646972656374 696f6e223a2231352e38222c22736174656c6 c697465223a2235222c22766f6c7461676522 3a22342e32227d AT+CHTTPDISCON=0 AT+CHTTPDESTROY=0 Response +CHTTPCREAT: 0 OK OK OK Description Create HTTP host instance Connect server send http request If succeed, will report incoming data +CHTTPNMIH is header +CHTTPNMIC is content OK OK Disconnected from server Destroy HTTP instance 5 Long command multi-package to create an HTTP instance AT Command First Packet AT+CHTTPCREATEEXT=1,3268,998,"https:// 180.97.33.108/,,,3232,2d2d2d2d2d424547 494e2043455254494649434154452d2d2d 2d2d0d0a4d494945615443434131476741 7749424167494c42414141414141425245 3777516b63774451594a4b6f5a496876634 e4151454c42514177567a454c4d416b470d 0a4131554542684d43516b557847544158 42674e5642416f544545647362324a68624 64e705a323467626e59746332457845444 Response OK Description Multi-package creates an HTTP host example where the parameter is split into four command packets. The first parameter: 1 means that there is still unpacked data to be sent later; 0 means the last packet of data. SIM7020 Series_HTTP_Application Note Page 6 / 11 SIMCom Confidential File
Simplify Communication 14f42674e564241735442314a760d0a6233 516751304578477a415a42674e5642414d 54456b647362324a6862464e705a323467 556d39766443424451544165467730784e 4441794d6a41784d4441770d0a4d444261 467730794e4441794d6a41784d4441774d 4442614d475978437a414a42674e564241 5954416b4a464d526b7746775944565151 4b45784248624739690d0a595778546157 6475494735324c584e684d5477774f67594 456515144457a4e4862473969595778546 1576475494539795a32467561587068644 76c76626942570d0a595778705a47463061 57397549454e4249433067553068424d6a 553249433067527a4977676745694d4130 4743537147534962334451454241515541 413449420d0a447741776767454b416f494 241514448446d772f49354e2f7a48436c6e 534444446c4d2f6673424f7770684a796b6 656492b38444e495630794b4d" Second Packet AT+CHTTPCREATEEXT=1,3268,1000,"434c6 b5a630d0a4333334a694a3150692f44346e 47794d56545862762f4b7a3676766a56756 44b52746b5449736f32315a7642714f4f57 51355079444c7a6d2b65626f6d63686a0d0 a5348682f567a5a7047686b645774485566 634b6331482f6867424b7565757149366c6 65979676f4b4f684a4a6f6d495a6567306b3 97a667274484f536577556a0d0a6d784b31 7a7573703336515541726b427064536d6e 454e6b694e37346676376a3952376c2f747 96a714f526d4d646c4d4a656b5975596c5a 436137706e5278740d0a4e77394b486a55 674b4f4b763143474c41635246725734725 93675536132454b54534474633770387a7 63457746475666750445769327a5a43486c 4b5433686c0d0a32704b38766a58357338 54354a34424f2f355a53356749673451647 a3656307276624c7841674d424141476a67 67456c4d4949424954414f42674e5648513 8420d0a4166384542414d4341515977456 75944565230544151482f42416777426745 OK The second parameter: the total length of the multi-packet data, here 3268=998+1000+1000+270 The third parameter: indicates the data length of the current unpacking command, that is, the length of the content in the quotation marks. The fourth parameter:http host The fifth parameter:user name, Omitted here The sixth parameter: password, omitted here The seventh parameter: 3232 is the length of the server certificate The eighth parameter: the content of the server certificate, it includes: 1) server certificate part of the first packet data of AT+CHTTPCREATEEXT "2d2d2d.... 4b4d" 2) The second packet data content of AT+CHTTPCREATEEXT "434c6b... 593239" 3) The third packet data content of AT+CHTTPCREATEEXT "744c33... 534f6c" 4) server certificate part of the 4th packet of AT+CHTTPCREATEEXT "43646a... 2d0d0a" The ninth parameter: client_cert_len , here 0, in the last package command. The 10th parameter: client_cert, omitted here, in the last package command The 11th parameter: client_pk_len, here 0, in the last package SIM7020 Series_HTTP_Application Note Page 7 / 11 SIMCom Confidential File
Simplify Communication command. The 12th parameter: client_pk, omitted here, in the last package command 422f7749424144416442674e56485134454 66751556c7435683862306346696c540d0a 484d444d665475444145446d476e777752 7759445652306742454177506a41384267 5256485341414d4451774d6759494b7759 4242515548416745574a6d68300d0a6448 427a4f693876643364334c6d647362324a6 862484e705a323475593239" Third Packet AT+CHTTPCREATEEXT=1,3268,1000,"744c3 34a6c6347397a61585276636e6b764d444 d4741315564487751734d436f770d0a4b4b 416d6f435347496d6830644841364c79396 a636d77755a327876596d467363326c6e6 26935755a585176636d39766443356a636 d7777505159494b7759420d0a425155484 15145454d5441764d43304743437347415 15546427a41426869466f644852774f6938 7662324e7a6343356e624739695957787a 615764754c6d4e760d0a62533979623239 30636a4577487759445652306a42426777 466f41555948746d476b554e6c38714a554 33939424d303071502f382f557377445159 4a4b6f5a490d0a6876634e4151454c42514 1446767454241455971376c36397267466 74e7a4552686e4630746b5a4a794241572f 69396949786572483466346775334b3377 34730d0a333252316a7555596371654d4f6 f764a724b5633555066766e7154676f4938 5556364d71582b782b6252446d756f32774 3496432446b79793256473745514c790d0 a584e306376664e566c672f554273443834 694f4b4a484454752f42354771646863494 f4b72776246494e696859394273726b3879 313635384745563142536c330d0a33304a4 15a4753477669703243544676485354306 d6443462f76496843506e47397648515765 3357566a77494b414e6e75764435385a41 575236356e357279410d0a534f6c" Fourth Packet AT+CHTTPCREATEEXT=0,3268,270,"43646a 535856576b6b446f50576f43323039664e3 OK +CHTTPCREAT: 0 SIM7020 Series_HTTP_Application Note Page 8 / 11 SIMCom Confidential File
分享到:
收藏