当前位置:网站首页>Use of ec200u-cn module
Use of ec200u-cn module
2022-07-24 15:59:00 【Persimmon wind year】
EC20 Official website DataSheet The control is relatively serious , You need to search the documentation carefully or ask the manufacturer or seller for .
Want to use the module , Hardware design instruction manual 、AT Instruction manuals and TCP/IP Application guidance , Three manuals are essential .
1、 Hardware control
Needless to say, the most important power design , The hardware can be designed according to the official document reference .
Mainly about how the software controls :
A few necessary IO:
EC20 burn 、 Debug interface
Main serial port Rx、Tx
Reset control IO
( A separate ) Power control IO
PowerKey Pin
Others such as SPI、I2C、ADC、SDIO、RTS/CTS Equal module , Anything you can't use can float .
1.1 Startup sequence
General , Startup of a module 、 Shut down and reset , All three operations need to conform to the sequence , Go to the corresponding hardware design manual to refer to how to realize .
Such as EC200U modular , The start-up sequence needs to be lowered 2s above , Pull up again ( More rigor , Pull down the power supply for a period of time and then pull up , then PowerKey Pin down 2s).
After the module starts successfully , Will actively vomit “RDY” The message is sent to the main serial port .
If you need to power on, start it automatically , You can directly pull down , Note that the resistance value of the pull-down resistor is determined according to the official .
The reset control pin is pulled down to take effect , Generally, the high level is directly assigned during initialization .
2、TCP Connect
Official documents have given “ Use TCP/IP AT The flow of orders ”, You can refer to .
Process description :
1. Power on first , Wait for the module to spit "RDY", Ready to enter
2. When it's ready , Execute the query command first , Such as CSGN | CCID | QLTS Used to synchronize module information
3. Inquire about SIM Card status
4. Query the network switching service status
5. Configure the scenario and activate
6. open socket The Internet
7. Conduct socket Network data interaction
among 3,4,5 command , If you fail many times , It is recommended to restart the module directly , Or restart it .
6、7 command , You can try to connect more than once .
Reopen socket When the network , It must be closed before opening .
When reactivating the scene , You must deactivate it before opening .
socket When the network is turned on , Choose the corresponding mode according to your own needs :
Cache mode requires manual data reading ;
Spit only mode is most commonly used ;
Note that the default transmission mode of transparent transmission is string Type data is still hex Format data , Or is hex character string .
Specific commands :
AT Command to “AT” start , With ‘\r’ ending .
The timeout is generally in seconds , When writing the sending interface, you can design the transmission parameters as seconds .
1、 Inquire about IMEI
AT+CGSN
AT+CGSN
869523054669669OK
Timeout time :300ms
2、 Inquire about ICCID
AT+QCCID
AT+QCCID
+QCCID: 89860425101950045915OK
Timeout time :300ms
3、 Inquire about SIM Card status
AT+CPIN?
AT+CPIN?
+CPIN: READYOK
Timeout time :5s
Returns the parameter :+CPIN: <code>
Normal reply READY,SIM PIN/SIM PIN2 Express SIM Card locking ,SIM PUK/SIM PUK2 Indicates that a password is required
4、 Inquire about CS Business
AT+CREG?
AT+CREG?
+CREG: 0,0OK
AT+CREG?
+CREG: 0,1OK
Timeout time :300ms
Returns the parameter :+CREG: <n>,<stat>
Query network registration status ,n Indicates the type of echo information ,0 Is the default ;stat Indicates the network registration status ,1 Yes, the registration is successful , Everything else can be considered wrong .
5、 Configuration scenarios
AT+QICSGP=1,1,"CMNET","","",1
AT+QICSGP=1,1,"CMNET",""."",1
OK
Input parameters :<id>,<ip_type>,<APN>,<username>,<password>,<APN_style>
id The scene ID, General applications only use 1 individual , namely 0;
ip type ,1 Express IPV4,2 Express IPV6,3 Express IPV4/IPV6;
APN, Indicates the access point name ,“CMNET” It means China Mobile ,“UNINET” Means China Unicom ;
username and password, User name and password ;
APN_style,APN Authentication method , The default with 0.
6、 Activate scene
AT+QIACT=1
AT+QIACT=1
OK
Timeout time :150s
Be careful 1: If 150S Timeout or activation failure , It is recommended to restart the module directly
Be careful 2: Before reactivating the scene , You must deactivate the scenario first , In the input parameters 1 Represents the scene ID.
7、 Reactivate
AT+QIDEACT=1
AT+QIDEACT=1
OK
Timeout time :40s, Timeout or failure , It is recommended to restart the module directly
8、 Connect TCP
AT+QIOPEN=1,0,"TCP","mqtt.51gonggui.com",1883,1,1
AT+QIOPEN=1,0,"TCP","mqtt.51gonggui.com",1883,1,1
OK
+QIOPEN: 0,0
Input parameters :<pdp_id>,<socket_id>,<socket_type>,<ip1/ip2>,<port>,<local>,<mode>
pdp_id, scene ID Corresponding to the above scenario configuration ID;
socket_id, from 0 Start ;
socket_type,TCP/UDP Respectively represent the corresponding client , The server usually uses less ;
ip1/ip2, It can be specific ip Address , Or domain name ;
port, Is the remote port number ;
local, Is the local port number , from 0 Start ;
mode,0 Indicates cache mode ( After receiving the data notification , You need to read the cache manually ),1 It's only spitting mode ( The received data will be directly spit out through the main serial port ),2 It's a transparent mode ( The data received by the main serial port is sent directly through the network , The received data is directly spit out through the main serial port )
however , however !!! By default, transparent mode transmits string type data , Unable to transmit hex Format data .( The manufacturer needs to modify and optimize the version ,, The current mass production version is still not supported )
9、 close TCP Connect
AT+QICLOSE=0
AT+QICLOSE=0
OK
If TCP The active connection fails or the connection is disconnected , It needs to be manually closed first TCP Connect , Try again TCP Connect ;
If it continues TCP The connection fails , You need to deactivate the scenario , In reactivating the scene .
above 9 Bar command , Are necessary commands in the process of networking .
In addition, you also need to deal with the messages actively spit out by the module :
+QIURC: “closed”
+QIURC: “recv”
+QIOPEN: 0,0
3、 Other commands
Query the current time
AT+QLTS=2
+QLTS: "2022/07/19,22:13:16+32,0"OK
Query signal strength
AT+CSQ
+CSQ: 18,99OK
边栏推荐
- 未来数据库需要关心的硬核创新
- Power of leetcode 231.2
- 华为无线设备配置WAPI-证书安全策略
- Read the paper with me - multi model text recognition network
- torch_ How to use scatter. Scatter() in detail
- Fine tune layoutlm V3 for bill data processing and content recognition
- Yolo5face: why reinvent the face detector
- 3、 Set foundation ArrayList set and simple student management system
- [shaders realize pixelate mosaic effect _shader effect Chapter 7]
- Leetcode 220. duplicate element III exists
猜你喜欢
![Dynamics crm: [problem solved]cannot open SQL encryption symmetric key because symmetric key password](/img/ae/125fcb16c9d85714c7bbd1255d1d18.png)
Dynamics crm: [problem solved]cannot open SQL encryption symmetric key because symmetric key password

Power of leetcode 231.2

Error: pidfile (celerybeat.pid) already exists when celery starts beat

2.19 haas506 2.0 development tutorial - Bluetooth - Bluetooth communication (only supports versions above 2.2)

torch_ How to use scatter. Scatter() in detail

JUC源码学习笔记3——AQS等待队列和CyclicBarrier,BlockingQueue

【AdaptiveAvgPool3d】pytorch教程

Fine tune layoutlm V3 for bill data processing and content recognition

Choice of advanced anti DDoS IP and CDN in case of DDoS

Will the capital market be optimistic about TCL's folding screen story?
随机推荐
Hard core innovation that database needs to care about in the future
Dedecms editor supports automatic pasting of word pictures
安信证券开户在手机开户安全吗?
Leetcode 223. 矩形面积
Is Huishang futures platform safe? Is it OK to open a futures account?
未来数据库需要关心的硬核创新
Windows10 installation free redis
YOLO5Face:为什么要重新发明人脸检测器
【LeetCode】Day102-螺旋矩阵 II
请问好的券商的排名?网上开户安全吗
简化理解:发布订阅
Some understanding of the rank sum of matrix and the rank of image
mysql源码分析——索引的数据结构
Error 1053: the service did not respond to the start or control request in a timely fashion
Can flush accounts be opened directly? Is it safe to open an account? How to open an account??
Fast RCNN trains its own data set
2022/7/18 CF training
[adaptiveavgpool3d] pytorch tutorial
[shaders realize pixelate mosaic effect _shader effect Chapter 7]
20. Shell programming variables