当前位置:网站首页>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
边栏推荐
- [shaders realize pixelate mosaic effect _shader effect Chapter 7]
- LaneATT
- Yolov6 trains its own data set
- yolov3 训练自己的数据集
- Research on the efficiency of numpy array access
- 自适应设计和响应式设计
- Kubernetes version docking object storage
- Pattern water flow lamp 1: check the table and display the LED lamp
- Code shoe set - mt2093 · palindrome digit
- Can flush accounts be opened directly? Is it safe to open an account? How to open an account??
猜你喜欢

Knowledge points of MySQL (12)

Error 1053: the service did not respond to the start or control request in a timely fashion

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

Dynamics crm: sharing records for users and teams
![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
![Programming in CoDeSys to realize serial communication [based on raspberry pie 4B]](/img/9c/05118efe2152dc5461a92720732076.jpg)
Programming in CoDeSys to realize serial communication [based on raspberry pie 4B]

Leetcode 220. duplicate element III exists

微调LayoutLM v3进行票据数据的处理和内容识别

Research on stability of time-delay systems based on Lambert function

105 constructing binary trees from preorder and inorder traversal sequences
随机推荐
Image label processing -- converting JSON files into PNG files
2022/7/18 CF training
【LeetCode】Day103-搜索二维矩阵 II
【着色器实现Pixelate马赛克效果_Shader效果第七篇】
Deploy ZABBIX monitoring system and email alarm mechanism in lamp architecture
PHP中array_merge的坑
3、 Set foundation ArrayList set and simple student management system
LaneATT
Hard core innovation that database needs to care about in the future
每天20分钟之feign
There are more than 20 categories of the four operators in MySQL. It took three days and three nights to sort them out. Don't collect them quickly
Research on stability of time-delay systems based on Lambert function
Machine learning notes - building a recommendation system (5) feedforward neural network for collaborative filtering
Adaptive design and responsive design
未来数据库需要关心的硬核创新
yolov6训练自己的数据集
Lsyncd搭建同步镜像-用Lsyncd实现本地和远程服务器之间实时同步
Exomeiser annotates and prioritizes exome variants
[Luogu] p1908 reverse sequence pair
Getting started with OpenMP