当前位置:网站首页>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
边栏推荐
- What is the ranking of good securities companies? Is online account opening safe
- Mysql8 encountered the problem of stopping after the service was started
- PHP中array_merge的坑
- Windows10 installation free redis
- 矩阵的秩和图像的秩的一些了解
- Knowledge points of MySQL (12)
- MySQL write lock does not take effect
- SQL row to column, column to row
- Hard core innovation that database needs to care about in the future
- Deploy ZABBIX monitoring system and email alarm mechanism in lamp architecture
猜你喜欢

Mysql8 encountered the problem of stopping after the service was started

Small list of iptables common commands

Knowledge points of MySQL (12)

机器学习笔记 - 构建推荐系统(5) 前馈神经网络用于协同过滤

MySQL学习笔记(总结)

Yolo5face: why reinvent the face detector

LaneATT

Dynamics 365: how to get the authentication information required to connect to D365 online from azure

Memorythrashing: Tiktok live broadcast to solve memory dithering practice

105 constructing binary trees from preorder and inorder traversal sequences
随机推荐
聊聊C指针
Configuring WAPI certificate security policy for Huawei wireless devices
Do you understand the working principle of gyroscope?
Exomeiser annotates and prioritizes exome variants
You can't just focus on flex layout and elaborate animation to explain all flex layout methods! Easy to understand dry goods tutorial
Read the paper with me - multi model text recognition network
2.19 haas506 2.0 development tutorial - Bluetooth - Bluetooth communication (only supports versions above 2.2)
从哪些维度评判代码质量的好坏?如何具备写出高质量代码的能力?
Memcache cache application (lnmp+memcache)
torch_ How to use scatter. Scatter() in detail
G026-db-gs-ins-03 openeuler deployment opengauss (1 active and 2 standby or multiple standby)
How to deal with being attacked? Advanced anti DDoS IP protection strategy
城市安全系列科普丨进入溺水高发期,救生常识话你知
自适应设计和响应式设计
未来数据库需要关心的硬核创新
Kubernetes static storage and dynamic storage
MySQL learning notes (summary)
R language ggplot2 visualization: ggplot2 visualization basic scatter plot, through in theme_ Specify the parameter base in BW_ Size to change the size of axis labels and control the size of gridlines
【SWT】自定义数据表格
MySQL之知识点(十二)