Difference between revisions of "Template:SIM7600CE-4G-HAT Manual"

From ingcool
Jump to: navigation, search
(接收英文短信)
m (Text replacement - "wget http://{{SERVERNAME}}" to "wget http://www.ingcool.com")
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
== 调试 ==
+
== Testing ==
 
+
=== Hardware setting ===
=== 硬件配置 ===
+
*This module comes with GSM antenna, LTE antenna and micro USB cable. Besides these you should prepare:
*用户在使用模块前除了micro USB线、LTE天线、GPS天线外,还需要准备以下东西:<br />
+
**A 4G sim card
一张4G SIM卡(移动、联通或电信卡,未停机且开通GPRS);
+
**A microphone cable
一根带麦克风耳机线(可选);
+
**A Micro SD card (Optional)
一张TF卡(可选);
+
*Insert the SIM card to the card slot, Insert the headphone cable and connect the LTE antenna.<br />
*断电的情况下,装入已经激活的4G SIM卡、TF卡(可选)、插入带麦克风的耳机线(可选),再接上USB线到电脑。<br />
 
 
<div><ul>  
 
<div><ul>  
<li style="display: inline-block;"> [[File:SIM7600X 4G HAT (5).png|thumb|none|400px|背面]] </li>
+
<li style="display: inline-block;"> [[File:SIM7600X 4G HAT (5).png|thumb|none|400px|back side]] </li>
<li style="display: inline-block;"> [[File:SIM7600X 4G HAT (7).jpg|thumb|none|400px|正面]] </li>
+
<li style="display: inline-block;"> [[File:SIM7600X 4G HAT (7).jpg|thumb|none|400px|front size]] </li>
 
</ul>
 
</ul>
 
</div>
 
</div>
*把micro USB线一端接PC机USB接口,另一端接SIM7600X 4G HAT的USB接口,PWR灯亮起,NET灯不亮状态。
+
*Connect the USB interface of SIM7600E-H 4G HAT to PC with a micro USB cable. Then the PWR indicator will keep bright.
*按下PWR按键约1秒,等待十秒左右,看到NET灯开始隔一秒闪烁一次,则模块开始工作
+
*Press the PWRKEY button and hold for 1s, the NET indicator will blink 1 time per second.
*打开设备管理器里面可以看到多出下图所示COM口。<br />[[File:Sim7600x-4G-HAT-wiki-1.jpg|600px]]
+
*Open Device Manager to check the COM ports<br />[[File:Sim7600x-4G-HAT-wiki-1.jpg|600px]]
*如果上图识别出来COM口,但是出现叹号,则表示还没有安装驱动,需要手动加载下[http://www.waveshare.net/w/upload/e/e6/SIM7600-Driver.7z 驱动]
+
*Install SIM7600 driver([http://www.waveshare.net/w/upload/e/e6/SIM7600-Driver.7z driver])
<font color="red">'''【说明】:SIM7600CE 4G HAT默认硬件需要按键开机,如果需要硬件上电自动开机,可用杜邦线把模块排针上的PWR和GND接到一起即可实现上电自动开机,如下图。'''</font><br />
+
<font color="red">'''【Note】The default hardware of SIM7600CE 4G HAT needs to be turned on by button. If the hardware needs to be turned on automatically, you can use a connection line to connect the PWR and GND pins on the module pin, so that it can automatically turn on, as shown in the figure below'''</font><br />
 
[[File:SIM7600X 4G HAT (3).png|600px]]
 
[[File:SIM7600X 4G HAT (3).png|600px]]
 
+
== Testing it with AT commands ==
【说明】:<br />
+
=== General AT commands ===
NET灯的工作状态说明如下图:<br />[[File:SIM7600X-4G-HAT-wiki-2.png|800px]]
+
<br />[[File:Sim7600x-4G-HAT-wiki-3.jpg|thumb|680px]]<br />
 
 
== 测试简要说明 ==
 
=== 常用AT指令 ===
 
<br />[[File:Sim7600x-4G-HAT-wiki-3.jpg|thumb|680px|AT指令测试示例图]]<br />
 
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! 命令 !! 说明 !! 返回值
+
! Command !! Description !! Return
 
|-
 
|-
| AT || AT测试指令 || OK
+
| AT || AT test command || OK
 
|-
 
|-
| ATE || ATE1设置回显<br /> ATE0关闭回显|| OK
+
| ATE || ATE1: Enable echo<br /> ATE0: Disable echo|| OK
 
|-
 
|-
| AT+CGMI || 查询模组制造商 || OK
+
| AT+CGMI || Module manufacturers|| OK
 
|-
 
|-
| AT+CGMM || 查询模组型号 || OK
+
| AT+CGMM || Module model || OK
 
|-
 
|-
| AT+CGSN || 查询产品序列号 || OK
+
| AT+CGSN || Serial number || OK
 
|-
 
|-
| AT+CSUB || 查询模块版本以及芯片 || OK
+
| AT+CSUB || Module revision || OK
 
|-
 
|-
| AT+CGMR || 查询固件版本序列号 || OK
+
| AT+CGMR || Firmware revision || OK
 
|-
 
|-
| AT+IPREX  || 设置模块硬件串口波特率 || +IPREX:<br />OK
+
| AT+IPREX  || Set baud rate || +IPREX:<br />OK
 
|-
 
|-
| AT+CRESET || 复位模块 || OK
+
| AT+CRESET || Reset module || OK
 
|-
 
|-
| AT+CSQ || 网络信号质量查询,返回信号值 || +CSQ: 17,99<br />OK
+
| AT+CSQ || Check signal quality || +CSQ: 17,99<br />OK
 
|-
 
|-
| AT+CPIN? || 查询SIM卡状态,返回READY,表示SIM卡能正常识别 || +CPIN: READY
+
| AT+CPIN? || SIM Card Status || +CPIN: READY
 
|-
 
|-
| AT+COPS? || 查询当前运营商,正常联网后会返回运营商信息 || +COPS:<br />OK
+
| AT+COPS? || Operator selection || +COPS:<br />OK
 
|-
 
|-
| AT+CREG? || 查询网络注册状态 || +CREG:<br />OK
+
| AT+CREG? || Network registration || +CREG:<br />OK
 
|-
 
|-
| AT+CPSI? || 查询UE系统信息 ||  
+
| AT+CPSI? || UE system infor ||  
 
|-
 
|-
|AT+CNMP || 网络模式选择命令:<br />2:Automatic<br />13:GSM only<br />38:LTE only<br />48 : Any modes but LTE<br />... .... ||  OK
+
|AT+CNMP || Mode selection:<br />2:Automatic<br />13:GSM only<br />38:LTE only<br />48 : Any modes but LTE<br />... .... ||  OK
 
|}
 
|}
<font color="red">更多AT指令请查阅:SIM7500_SIM7600 Series_AT Command Manual_V1.07 </font>
+
<font color="red">For more details, please refer to the documentation: SIM7500_SIM7600 Series_AT Command Manual_V1.07 </font>
 
<div class="sep0px"></div>
 
<div class="sep0px"></div>
 
+
=== '''Raspberry Pi use 4G''' ===
== 拨号上网 ==
+
*Insert the module to 40PIN GPIO of Raspberry Pi, connect the USB interface of 4G module to USB port of Pi, and start it.
<font color="red">【注意】:须用开通了GPRS联网功能并且未停机的SIM卡,国内支持移动、电信和联通手机卡。</font>
+
[[File:SIM7600X 4G HAT (7).jpg|600px|Hardware connection]]
=== '''计算机Windows上网''' ===
+
*Initialize Raspberry Pi according to [[#Initailize Raspberry Pi | Initialize Raspberry Pi]]
*电信和联通卡一般接上模块后会自动连接 (注意:事先需要把所有的驱动都安装好)
+
*Refer to the guide below for networking. (Recommend you use USB port for faster speed):
*移动拨号上网(下面步骤以Windows 10为例)
+
**[[#Networking via wwan0 Interface]]<br />
**未拨号之前查看电脑网络,连接方式是以太网。如下图所示:<br />[[File:Sim7600x-4G-HAT-wiki-4.jpg|880px]]
+
*If the network work abnormally, please check set the DNS by commands below for a try:
**开始拨号<br />[[File:Sim7600x-4G-HAT-wiki-5.jpg|1200px]]<br />[[File:Sim7600x-4G-HAT-wiki-6.jpg|1200px]]
 
*显示连接方式出现“拨号连接5”,此时禁用以太网,便可以使用4G网络联网使用。
 
 
 
 
 
=== '''树莓派Raspbian上网''' ===
 
 
 
*把模块插到树莓派,并USB接口连到树莓派USB口上,开机,如下图所示:
 
[[File:SIM7600X 4G HAT (7).jpg|600px|硬件连接图]]
 
*参考下文的“[[SIM7600CE_4G_HAT#.E6.A0.91.E8.8E.93.E6.B4.BE.E4.BE.8B.E7.A8.8B | 树莓派初始化设置]]”,对树莓派做初始化设置。
 
*拨号上网参考下面教程(拨号上网建议使用USB接口连接,速度更快):
 
 
 
<font color="red">'''关于树莓派拨号上网相关的具体操作,请参考以下链接:'''</font><br />
 
*[[SIM7600x拨号上网]]<br />
 
*拨号上网后,如果DNS解析不了,上不了网,可以加上指令:
 
 
  route add -net 0.0.0.0 ppp0
 
  route add -net 0.0.0.0 ppp0
  
== GPS调试 ==
+
== Test GPS ==
=== GNSS控制实例 ===
+
*Connecting the GPS antenna, and place the receiver on open area outdoor
*插上GPS天线,并将接收器置于空旷的室外,上电需要等待约1分钟才能接收到定位信号;
+
*AT Commands used
*详细测试指令和截图如下:
+
  AT+CGPS=1     //Enable GPS
  AT+CGPS=1     //打开GPS
+
  AT+CGPSINFO      //Print GPS information to serial port
  AT+CGPSINFO      //将GPS信息打印到串口
+
  AT+CGPS=0      //Disable GPS
  AT+CGPS=0      //关闭GPS
 
 
[[File:Sim7600x-4G-HAT-wiki-7.jpg|600px]]
 
[[File:Sim7600x-4G-HAT-wiki-7.jpg|600px]]
  
== TCP/IP连接GPRS发数据 ==
+
== TCP/IP Connection ==
<font color="red">GPRS 调试须用开通了 GPRS 联网功能的 SIM 卡</font><br />  
+
<font color="red">Please make sure that your SIM card supports GPRS services.</font><br />  
 
+
#Assemble the SIM card, connect all the antenna, and connect the module to PC by USB cable.
下例以接入移动 SIM 卡为例: <br />
+
#Press the PWR button to power on the module and wait for a dozen seconds.
#正确安装移动手机卡(须开通 GPRS 联网功能)、 GSM 天线、连接好 USB 线到电脑;
+
#Mkae sure that all the indicator light normally.
#按下 PWR 键,启动模块,等待十几秒;
+
=== Set the local virtual servers settings ===
#观察指示灯是否正常, PWR 指示灯常亮, NET 灯闪烁;
+
Virtual servers define the mapping between service ports of WAN and web servers of LAN. All requests from the Internet to service ports of WAN will be redirected to the computer (webservers of LAN) specified by the server IP. (see your router’s guide manual))<br />
=== 设置本地电脑虚拟服务器 ===
+
#Log in Management Console of your router with a browser (read your router’s guide manual for specific address)
虚拟服务器定义了广域网服务端口和局域网网络服务器之间的映射关系,所有对该广域网服务端口的访问都会被重新定位给通过IP地址指定的局域网网络服务器。(请参阅您的路由器对应厂商的说明书)<br />
+
#Set Port::2317(The Port can’t conflict to others. Here we set2317)
#使用浏览器登录到路由器管理界面(具体地址请参阅您的路由器说明书)
+
#Set LAN IP address of your computer (you can run CMD on your computer, and execute commands config to inquiry the address of IPv4), 192.168.1.168 as examples<br />
#设置端口号:2317(与已有的端口号不冲突即可。本例设为2317)
+
=== Get WAN IP ===
#设置电脑端内网IP(局域网内电脑获取的IP,可以在本机运行CMD,进入命令行提示符,输入ipconfig查看IPv4地址,本例的电脑内网IP是192.168.1.168)<br />
+
You can search “IP” on the browser to get your WAN IP address<br />
 
 
=== 获取外网IP ===
 
外网IP可以通过浏览器搜索IP获得,如下图所示:<br />
 
 
[[File:Sim7600x-4G-HAT-wiki-8.jpg|1000px]]
 
[[File:Sim7600x-4G-HAT-wiki-8.jpg|1000px]]
=== 配置GPRS ===
+
=== Set GPRS ===
  AT+CGDCONT=1,"IP","CMNET"    //设置APN
+
  AT+CGDCONT=1,"IP","CMNET"    //Set APN
  AT+CSQ      //查询网络信号质量,其中第一个参数为网络信号质量最大为 31,此数值越大说明网络信号越强
+
  AT+CSQ      //Check the quality of the signal, bigger the value, stronger the signal.
  AT+CREG?        //查询网络注册情况,其中第二个参数为 1 则说明已经注册成功
+
  AT+CREG?        //GPRS network status
  AT+CIPMODE=1        //设置TCP/IP模式
+
  AT+CIPMODE=1        //TCP/IP mode
  AT+CSOCKSETPN=1          //选择TCP/IP应用模式
+
  AT+CSOCKSETPN=1          //PDP profile number
  AT+CIPMODE=0          //选择TCP/IP应用模式
+
  AT+CIPMODE=0          //Choose TCP/IP mode
  AT+NETOPEN        //开启模式
+
  AT+NETOPEN        //Open socket
  AT+CIPOPEN=0,"TCP","113.81.233.65",2317        //设置设置TCP 、IP 和端口号,建立 TCP/IP 连接
+
  AT+CIPOPEN=0,"TCP","113.81.233.65",2317        //establish connection
  AT+CIPSEND=0,9,        //为指定发送9个字符的数据,返回>即可开始发送9个字符内容
+
  AT+CIPSEND=0,9,        //Send data of a specific size
  AT+CIPCLOSE=0,        //关闭TCP连接
+
1A                    //(HEX format) Tell module to send data
  AT+NETCLOSE,        //关闭网络
+
  AT+CIPCLOSE=0,        //close connection
 +
  AT+NETCLOSE,        //Close socket
  
== TF卡调试 ==
+
== Test TF card==
1. 断电的情况下插入TF卡(按压弹出式),按正常开机步骤,选择端口号:
+
1. Plug the SIM card, connect the LTE antenna, and connect the USB interface of SIM7600E-H 4G HAT to PC. Then press the PWRKEY to power on
  
 
[[File:SIM7600X 4G HAT (5).png|600px]]
 
[[File:SIM7600X 4G HAT (5).png|600px]]
  
2. 选择TF卡目录作为当前目录:
+
2. User command to use TF card
  AT+FSCD=D: //选择 TF 卡路径
+
  AT+FSCD=D: //Choose the path of TF card
 
  +FSCD: D:/
 
  +FSCD: D:/
 
  OK
 
  OK
  AT+FSLS //查看子目录
+
  AT+FSLS //Check subdirecotry
 
  +FSLS: SUBDIRECTORIES:  
 
  +FSLS: SUBDIRECTORIES:  
 
  overlays
 
  overlays
Line 139: Line 117:
 
  ...
 
  ...
 
  OK
 
  OK
[[File:Sim7600x-4G-HAT-wiki-9.jpg|880px]]<br />
+
[[File:Sim7600x-4G-HAT-wiki-9.jpg|880px]]</ br>
3. 在TF卡上建立文件夹和文件内容
+
3. Create file and write data to TF card
使用语句在根目录设置 MyDir 文件夹并在文件夹内建立 t1.txt 文件,同时写入内容 test content<br />
+
Create MyDir folder in the root directory and create tx.txt in the folder, write data test content to the file by the following commands<br />
  AT+CFTRANRX="D:/MyDir/t1.txt",12 //文件名
+
  AT+CFTRANRX="D:/MyDir/t1.txt",12 //file name
  >test content //内容
+
  >test content //data
 
  OK
 
  OK
  
 
[[File:Sim7600x-4G-HAT-wiki-10.jpg|880px]]
 
[[File:Sim7600x-4G-HAT-wiki-10.jpg|880px]]
  
4. 打开TF卡文件
+
4. Open file of TF card
 
  AT+CFTRANTX="D:/MyDir/t1.txt"
 
  AT+CFTRANTX="D:/MyDir/t1.txt"
 
  +CFTRANTX: DATA,012
 
  +CFTRANTX: DATA,012
Line 154: Line 132:
 
  +CFTRANTX: 0
 
  +CFTRANTX: 0
 
  OK
 
  OK
[[File:Sim7600x-4G-HAT-wiki-11.jpg|800px]]<br />
+
[[File:Sim7600x-4G-HAT-wiki-11.jpg|800px]]</ br>
 
[[File:Sim7600x-4G-HAT-wiki-12.jpg|800px]]
 
[[File:Sim7600x-4G-HAT-wiki-12.jpg|800px]]
  
更多指令可以参照:SIM7500_SIM7600 Series_AT Command Manual_V1.07  P256~P268
+
For more information about the commands, please refer to SIM7500_SIM7600 Series_AT Command Manual_V1.07  P256~P268
  
== 拔打电话 ==
+
== Take calls ==
*参考《硬件配置》章节接好LTE天线、SIM卡(须开通电话功能)和带麦克风耳机线,模块开机。
+
*Connect the hardware and power on the SIM7600X module.
*拨打电话常用指令:<br />
+
*Commands for taking calls:<br />
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! AT+CNUM || 查询本机号码(并非所有的SIM卡都支持此指令) || +CNUM<br />OK
+
! AT+CNUM || Phone number (Not all SIM cards Support) || +CNUM<br />OK
 
|-
 
|-
| AT+CSDVC || AT+CSDVC=1:切换到耳机输出<br />AT+CSDVC=3:切换到喇叭输出 || OK
+
| AT+CSDVC || AT+CSDVC=1:Handset output<br />AT+CSDVC=3:Speaker output|| OK
 
|-
 
|-
| AT+CLVL=? || 查询音量范围 || OK
+
| AT+CLVL=? || check volume level || OK
 
|-
 
|-
| AT+CLVL=2 || 设置音量为2 || OK
+
| AT+CLVL=2 || volume level set to 2 || OK
 
|-
 
|-
| ATD<phone_number>; || ATD10086; :拔打移动10086客服电话 || OK
+
| ATD<phone_number>; ||  Make calls || OK
 
|-
 
|-
| AT+CHUP || 挂断电话 || OK
+
| AT+CHUP || Hang up call || OK
 
|-
 
|-
| AT+CLIP=1 || 设置来电显示 || OK
+
| AT+CLIP=1 || Phone ring || OK
 
|-
 
|-
| ATA || 接听电话 || OK
+
| ATA || Answer call|| OK
 
|}
 
|}
*详细操作截图如下所示:
+
[[File:Sim7600x-4G-HAT-wiki-13.jpg|600px|Take call]]<br />
[[File:Sim7600x-4G-HAT-wiki-13.jpg|600px|拨打电话示例图]]<br />
 
 
<div class="sep0px"></div>
 
<div class="sep0px"></div>
<font color="red">【注意】:在使用SSCOM串口助手收发AT指令时,须勾选“加回车换行”</font>
+
<font color="red">【Note】: You need to check "new line" when using SSCOM to test</font>
 +
== Send/Receive SMS ==
 +
#Plug the SIM card, connect the LTE antenna and connect the USB interface of SIM7600E-H 4G HAT to PC. Then press the PWRKEY to
 +
#Check whether the indicators blink correctly (PWR’s and NET’s flashes).
 +
#Use commands below to send SMS
 +
{|class="wikitable"
 +
!Comamnd!! Description!! Return
 +
|-
 +
|AT+CMGF=1||select message format||OK
 +
|-
 +
|AT+CSCS="GSM"||Select TE character set: GSM||OK
 +
|-
 +
|AT+CSMP||set text mode para||OK
 +
|-
 +
|AT+CMGS="<phonenumber>"||Send message||OK
 +
|-
 +
|AT+CNMI=2,1||message indications||OK
 +
|-
 +
|AT+CMGR=1||Read message 1||OK
 +
|}
 +
[[File:Sim7600x-4G-HAT-wiki-14.jpg|700px|Send SMS]]
  
== 语音输出模式和音量调节 ==
+
[[File:Sim7600x-4G-HAT-wiki-15.jpg|680px|Receive SMS]]
AT+CSDVC=1 //切换到耳机
 
AT+CSDVC =3         //切换到喇叭
 
AT+CLVL =?         //查询音量范围,返回 +CLVL: (0-5)  //说明音量有0~5可调
 
AT+CLVL=2            //设置音量为2,返回 OK
 
== 接听电话 ==
 
来电串口显示:RING
 
发送“ATA” //接听电话
 
发送“AT+CHUP”  //挂断电话
 
== 音频参数调试 ==
 
AT+CACDBFN=?
 
+CACDBFN: (Handset_cal.acdb,Handset_tianmai.acdb) // 建议考虑设置这组参数
 
OK
 
  
A.模块开机初始化阶段,在拨打电话之前,增加如下
+
== Working with Raspberry Pi ==
 
+
===Hardware connection===
AT^PWRCTL=0,1,3 // 主要改善TDD noise效果
+
The relationship between SIM7600 control pins and Raspberry Pi IOs is shown in Table:
OK
 
 
 
B.模块建立语音通话过程中
 
 
 
VOICE CALL:BEGIN  // 模块通话建立执行,改善通话效果
 
AT+CECM=1      //回音抑制处理
 
OK
 
AT+CECH=0x500 //改善手机端音量效果
 
OK
 
 
 
<font color="red">详见“SIM7X00_Audio_Application_Note”文档</font>
 
 
 
== 发送英文短信 ==
 
#正确安装 SIM 手机卡和LTE天线、模块USB接口用USB线接电脑,模块开机;
 
#观察指示灯是否正常, PWR 指示灯常亮,NET 灯闪烁;
 
#设置当地短信中心:AT+CSCA="+8613800755500"+回车,返回OK。<br />注:中国移动的短信服务中心号是+861380xxxx500,其中 xxxx 是你所在的长途电话区号,短信中心每个地方可能不一样,具体可百度查询或拨打移动联通客服,此短信中心为深圳(0755);
 
#AT+CMGF=1  :设置短信模式为TEXT ;
 
#AT+CMGS="phone number"<回车> ,设置接收方手机号 ,然后会返回:“>”,发送需要的内容,如“Send massage test!”,结尾不需要回车,编辑完短信后以十六进制的格式发送1A发信息发送(1A是“CTRL+Z”的键值,用于告诉模块执行发送操作,也可以发送1B即“ESC”取消操作),发送成功后模块返回+CMGS:15确认发送成功。如下图所示。
 
[[File:Sim7600x-4G-HAT-wiki-14.jpg|700px|发送英文指令]]
 
 
 
== 接收英文短信 ==
 
#手机上发送一条:“This is a receive test for SIM7600X!”到试验模块上
 
#接受到信息时,串口会制动上报信息,“SM”, 20,代表存在 SM 里面有20条信息了,刚刚发的信息就是第 20 条
 
#读取信息:AT+CMGR=20 读取第20条信息(AT+CMGL="ALL" 为读取所有信息)
 
#删除信息:AT+CMGD=20,如下图所示
 
#将显示的信息通过编码转换器转换成文本。
 
<div><ul>
 
<li style="display: inline-block;"> [[File:Sim7600x-4G-HAT-wiki-15.jpg|680px|接收英文短信指令]] </li>
 
<li style="display: inline-block;"> [[File:Sim7600x-4G-HAT-wiki-16.jpg|编码转换]] </li>
 
</ul>
 
</div>
 
 
 
== 发送中文短信 ==
 
1、设置发送短信参数
 
AT+CMGF=1            //设置为文本模式
 
AT+CSCS="UCS2"          //设置信息文本为UCS2编码集
 
AT+CSMP=17,167,2,25          //设置文本模式参数。
 
AT+CMGS="00310033003400330032003100310039003100300031"          //设置接收方手机号的UCS2集;
 
2、等待返回>,此时发送进过转换的信息内容(00530049004D003700360030003000584E2D658777ED4FE16D4B8BD5),结尾不需要回车,编辑完短信后以十六进制的格式发送1A发信息发送,如下图所示:<br />[[File:sim7600CE-10.jpg|thumb|left|1200px|发送中文短信]]
 
 
 
== 接收中文短信 ==
 
1、设置短信接收参数
 
AT+CMGF=1    //设置文本显示
 
AT+CSCS="GSM" //设置GSM编码集
 
AT+CNMI=2,1  //设置新信息提醒
 
2、接受到信息时,串口会自动上报信息,如下图所示读取返回的第21条信息:
 
AT+CMGR=21        //读取序号21的短信内容
 
3、在软件中把信息转成中文,如下图所示:<br />[[File:sim7600CE-9.jpg|thumb|left|1200px|接收中文短信]]
 
 
 
== 树莓派例程 ==
 
=== 硬件连接 ===
 
SIM7600X 4G HAT板载树莓派GPIO接口,可直接插入各版本树莓派使用;下表为树莓派管脚与模块引脚连接情况(树莓派三代B+):
 
[[File:SIM7600-PIN.jpg|300px|thumb|与树莓派引脚连接图]]
 
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 263: Line 195:
 
| GND || GND
 
| GND || GND
 
|-
 
|-
| RXD || TXD (对应BCM的14)
+
| RXD || TXD (BCM: 14)
 
|-
 
|-
| TXD || RXD (对应BCM的15)
+
| TXD || RXD (BCM: 15)
 
|-
 
|-
| PWR || P22 (对应BCM的P6)
+
| PWR || P22 (BCM: P6)
 
|-
 
|-
| FLIGHTMODE || P7 (对应BCM的P4),当拉高时进入飞行模式
+
| FLIGHTMODE || P7 (BCM: P4), high active
 
|}
 
|}
 
+
=== Initialize Raspberry Pi ===
=== 树莓派初始化设置 ===
+
You need to set the SIM7600 module to the working mode first.
为确保SIM7600X 4G HAT接入树莓派后能正常工作,需先初始化树莓派部分引脚的电平输出。具体操作如下:
+
*Download demo codes[http://{{SERVERNAME}}/w/images/2/29/SIM7600X-4G-HAT-Demo.7z demo codes],unzip it and recommend the folder Rspberry Pi/c as SIM7600X,and sopy it  to /home/pi directory of Raspberry Pi
*下载[http://www.waveshare.net/w/upload/2/29/SIM7600X-4G-HAT-Demo.7z 示例程序],解压后,把Raspberry文件夹下的c文件夹改名为SIM7600X,然后把SIM7600X整个文件夹复制到树莓派/home/pi目录下,
+
*Go to /home/pi/SIM7600X directory and run the following command.
*命令行进入到/home/pi/SIM7600X目录下,执行指令
 
 
  chmod 777 sim7600_4G_hat_init
 
  chmod 777 sim7600_4G_hat_init
*设置开机初始化脚本,运行命令:
+
*Set auto-run when booting:
 
  sudo nano /etc/rc.local
 
  sudo nano /etc/rc.local
*在exit 0前面加入 (如下图所示):
+
*Add the line below in the from of exit 0:
 
  sh /home/pi/SIM7600X/sim7600_4G_hat_init
 
  sh /home/pi/SIM7600X/sim7600_4G_hat_init
[[File:sim7600CE-28.jpg|1000px]]
+
[[File:Sim7600x-4G-HAT-wiki-19.jpg|600px]]
  
=== 树莓派串口配置 ===
+
=== Enable serial port ===
由于树莓派串口默认用于终端调试,如需使用串口,则需要修改树莓派设置。执行如下命令进入树莓派配置:
+
For proper use, you need to disable the login shell and enable the hardware serial.
 
  sudo raspi-config
 
  sudo raspi-config
选择Interfacing Options  ->Serial ->no -> yes,关闭串口调试功能。<br />
+
Choose Interfacing Options  ->Serial ->no -> yes,<br />
[[File:sim7600CE-27.jpg|1200px]]<br />
 
打开/boot/config.txt文件,找到如下配置语句使能串口,如果没有,可添加在文件最后面:<br />
 
enable_uart=1
 
重启生效
 
  
<!--===wwan0接口上网===
+
===Networking via wwan0 Interface===
1、使用USB线,将SIM7600模块的USB接口(注意不是USB to UART接口)连接到树莓派的USB接口
+
1、Connect the USB interface of SIM7600 module to Rasberry Pi by USB cable
  
2、终端输入ifconfig指令查看是否有识别到wwan0接口。如果没有识别到的话,检查一下是否初始化设置没有做好,或者更换USB线再尝试一下
+
2、Use ifconfig command to check wwan0 interface.
  
3、安装libqmi和udhcpc
+
3、Install libqmi and udhcpc
 
  sudo apt-get install libqmi-utils udhcpc -y
 
  sudo apt-get install libqmi-utils udhcpc -y
3、检查一下wwan0口工作状态:
+
3、Check the status of wwan0 interface:
 
  sudo qmicli -d /dev/cdc-wdm0 --dms-get-operating-mode
 
  sudo qmicli -d /dev/cdc-wdm0 --dms-get-operating-mode
:如果查询到的工作模式不是online的话,运行以下指令设置,然后再检查一遍
+
: If the status is not online, you need to run the following command to configure it and test again.
 
  sudo qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode='online'
 
  sudo qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode='online'
4、设置wwan0网络
+
4、Set wwan0 network
 
<pre>
 
<pre>
 
sudo qmicli -d /dev/cdc-wdm0 -w
 
sudo qmicli -d /dev/cdc-wdm0 -w
Line 311: Line 238:
 
</pre>
 
</pre>
  
5、 设置APN并接连网络
+
5、 Set APN and connect to network.
 
  sudo qmicli -p -d /dev/cdc-wdm0 --device-open-net='net-raw-ip|net-no-qos-header' --wds-start-network="apn='YOUR_APN',username='YOUR_USERNAME',password='YOUR_PASSWORD',ip-type=4" --client-no-release-cid
 
  sudo qmicli -p -d /dev/cdc-wdm0 --device-open-net='net-raw-ip|net-no-qos-header' --wds-start-network="apn='YOUR_APN',username='YOUR_USERNAME',password='YOUR_PASSWORD',ip-type=4" --client-no-release-cid
:注意:这里apn, username和password后面的参数要修改成你的4G卡对应的apn参数。
+
:Note: the apn, username, password and other parameters should be modified according to the actual situation.
:由于一般情况下APN的用户名是默认不用设置的,所以这里的username和password你可以选择不设置。例如如果你用的是移动4G卡,APN为CMNET,可以用下面的指令直接设置
+
:The user name of APN can be ignore sometimes. For examples:
 
  sudo qmicli -p -d /dev/cdc-wdm0 --device-open-net='net-raw-ip|net-no-qos-header' --wds-start-network="apn='CMNET',ip-type=4" --client-no-release-cid
 
  sudo qmicli -p -d /dev/cdc-wdm0 --device-open-net='net-raw-ip|net-no-qos-header' --wds-start-network="apn='CMNET',ip-type=4" --client-no-release-cid
  
6、最后使用udhcpc设置路由和分配IP
+
6、User udhcpc to set router and IP
 
   sudo udhcpc -i wwan0
 
   sudo udhcpc -i wwan0
7、现在你可以拔掉网线,关掉wifi,测试一下4G网络是否可以正常使用。-->
+
7、Now you can disconnect the RJ45, turn off the WiFi and test the 4G network.
=== 树莓派minicom串口调试 ===
+
 
1、将模块插入树莓派中<br />
+
=== Minicom test ===
2、安装minicom,minicom是linux平台串口调试工具:<br />
+
1、Connect the SIM7600 module and power on Raspberry Pi<br />
 +
2、Install minicom<br />
 
  sudo apt-get install minicom
 
  sudo apt-get install minicom
3、执行minicom -D /dev/ttyS0(ttyS0为树莓派3B/3B+/4B的串口)。<br />
+
3、Use the command minicom -D /dev/ttyS0 for testing<br />
默认波特率为115200<br />
+
Default baud rate: 115200<br />
树莓派2B/zero,用户串口设备号为ttyAMA0,树莓派3B/3B+/4B串口设备号为ttyS0。<br />
+
If you use Pi2B/zero, the serial port should be ttyAMA0<br />
4、以AT同步测试为例,发送相关指令,如下图所示:<br />[[File:sim7600CE-29.jpg|880px]]
+
4、Send commands:
  
=== 示例程序 ===
+
[[File:Sim7600x-4G-HAT-wiki-20.jpg|680px]]
1、将模块插入树莓派中;
+
 
2、下载示例程序到/home/pi/ 路径下;
+
=== Demo codes ===
  wget https://www.waveshare.com/w/upload/2/29/SIM7600X-4G-HAT-Demo.7z
+
1、Connect the SIM7600 module and power on Raspberry Pi<br />
 +
2、Dwonalod demo codes and copy it to /home/pi/ directory;
 +
  wget http://www.ingcool.com/w/images/2/29/SIM7600X-4G-HAT-Demo.7z
 
  sudo apt-get install p7zip-full
 
  sudo apt-get install p7zip-full
 
  7z x SIM7600X-4G-HAT-Demo.7z  -r -o/home/pi
 
  7z x SIM7600X-4G-HAT-Demo.7z  -r -o/home/pi
 
  sudo chmod 777 -R /home/pi/SIM7600X-4G-HAT-Demo
 
  sudo chmod 777 -R /home/pi/SIM7600X-4G-HAT-Demo
  
3、进入到bcm2835目录,编译安装BCM2835库:
+
3、Enter the folder of bcm2835 compile and install BCM2835 libraries:
 
  chmod +x configure && ./configure && sudo make && sudo make install
 
  chmod +x configure && ./configure && sudo make && sudo make install
说明:如果编译出现问题,请参考FAQ的说明操作。<br />
+
 
4、分别进到对应实例目录下,编译和运行程序,相关指令说明如下(以PhoneCall程序为例):
+
4、Enter the examples folder and run the codes as below:
  sudo make clean      //清除原来的执行文件
+
  sudo make clean      //Clean
  sudo make        //重新编译
+
  sudo make        //compile
  sudo ./PhoneCall      //运行程序
+
  sudo ./PhoneCall      //run the codes
上述命令组合使用:<br />
+
You can also combine the commands:<br />
 
  sudo make clean && sudo make && sudo ./PhoneCall
 
  sudo make clean && sudo make && sudo ./PhoneCall
==== '''PHONECALL打电话例程''' ====
+
==== '''PHONECALL example''' ====
[[File:sim7600CE-31.jpg|1000px]]
+
[[File:Sim7600x-4G-HAT-wiki-21.jpg|600px]]
==== '''SMS短信收发例程''' ====
+
==== '''SMS example''' ====
[[File:sim7600CE-32.jpg|1000px]]
+
[[File:Sim7600x-4G-HAT-wiki-22.jpg|600px]]
==== '''GPS定位例程''' ====
+
==== '''GPS example''' ====
[[File:sim7600CE-33.jpg|1000px]]
+
[[File:Sim7600x-4G-HAT-wiki-23.jpg|600px]]
===='''TCP网路通信例程'''====
+
===='''TCP example'''====
[[File:sim7600CE-34.jpg|1000px]]
+
[[File:Sim7600x-4G-HAT-wiki-24.jpg|600px]]
==== '''FTP下载和上传例程''' ====
+
==== '''FTP example''' ====
[[File:sim7600CE-35.jpg|1000px]]
+
[[File:Sim7600x-4G-HAT-wiki-25.jpg|600px]]
  
==Arduino例程==
+
==Arduino example==
=== 硬件连接 ===
+
=== Hardware connection ===
硬件连接到开发板UNO PLUS / Arduino UNO:
+
Connect the SIM7600 module to UNO PLUS / Arduino UNO:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 374: Line 304:
 
| PWR || 2
 
| PWR || 2
 
|}
 
|}
=== 安装Arduino库 ===
+
=== Install Arduino Libraries ===
下载解压示例程序,<br />
+
Downloaad the demo codes and unzip it<br />
把Waveshare_SIM7600X_Arduino_Library文件夹复制到Arduino IDE安装路径下的Library目录下<br />
+
Copy folder Waveshare_SIM7600X_Arduino_Library to libraries folder under the installation directory of Arduino IDE<br />
打开Arduino IDE --> File -->Examples -->Waveshare SIM7600X,然后选择运行对应的示例程序:<br />
+
Open Arduino IDE --> File -->Examples -->Waveshare SIM7600X,and run the examples:<br />
[[File:sim7600CE-36.jpg|800px]]
+
[[File:Sim7600x-4G-HAT-wiki-26.jpg|600px]]
=== 示例程序 ===
+
=== Examples ===
==== '''PHONECALL打电话例程''' ====
+
==== '''PHONECALL example''' ====
[[File:sim7600CE-41.jpg|800px]]
+
[[File:Sim7600x-4G-HAT-wiki-27.jpg|600px]]
==== '''SMS短信收发例程''' ====
+
==== '''SMS example''' ====
[[File:sim7600CE-42.jpg|800px]]
+
[[File:Sim7600x-4G-HAT-wiki-28.jpg|600px]]
==== '''GPS定位例程''' ====
+
==== '''GPS example''' ====
[[File:sim7600CE-43.jpg|800px]]
+
[[File:Sim7600x-4G-HAT-wiki-29.jpg|600px]]
==== '''TCP网路通信例程''' ====
+
==== '''TCP example''' ====
[[File:sim7600CE-44.jpg|800px]]
+
[[File:Sim7600x-4G-HAT-wiki-30.jpg|600px]]
==== '''FTP下载和上传例程''' ====
+
==== '''FTP example''' ====
[[File:sim7600CE-45.jpg|800px]]
+
[[File:Sim7600x-4G-HAT-wiki-31.jpg|600px]]
  
==Jetson Nano例程==
+
==Jetson Nano Examples==
===硬件连接===
+
===Hardware connection===
Jetson Nano板载RaspberryPi 40Pin GPIO接口,SIM7600X 4G HAT可直接接入使用,Jetson Nano的终端访问串口不影响与SIM7600X 4G HAT(即Pin10和Pin8)串口通信。
+
Jetson Nano has the same 40PIN header as Raspberry Pi.
  
[[File:sim7600CE-46.png|thumb|300px|连接图]]
+
[[File:SIM7600X 4G HAT (4).png|thumb|300px|connection]]
  
 
{| class="wikitable" style="text-align:center;"
 
{| class="wikitable" style="text-align:center;"
Line 406: Line 336:
 
| GND || GND
 
| GND || GND
 
|-
 
|-
| TXD || 10 (Board编码)
+
| TXD || 10 (Board)
 
|-
 
|-
| RXD || 8 (Board编码)
+
| RXD || 8 (Board)
 
|-
 
|-
| PWR || 31(Board编码)
+
| PWR || 31(Board)
 
|}
 
|}
  
===Jetson Nano minicom串口调试===
+
===Jetson Nano minicom test===
1、将SIM7600X 4G HAT接入Jetson Nano中,按下PWRKER键三秒后开机<br \>
+
1、Connect SIM7600X 4G HAT to Jetson Nano and power on it by pressing the PWRKERY key for 3s.将SIM7600X 4G HAT接入Jetson Nano中,按下PWRKER键三秒后开机<br \>
2、[http://www.waveshare.net/study/portal.php?mod=view&aid=596 使用SERIAL登录Jetson Nano终端],安装minicom,在终端下输入:
+
2、Access Jetson nano <br \>
 +
3、Open a terminal and install minicom:
 
  sudo apt-get install minicom
 
  sudo apt-get install minicom
3、运行minicom进行串口调试,在终端下输入
+
3、use the command to test module
 
  sudo minicom -D /dev/ttyTHS1 -b 115200
 
  sudo minicom -D /dev/ttyTHS1 -b 115200
4、 发送AT指令测试,退出时按下PWRKEY按键三秒后开始关机,退出minicom先按Ctrl+A,再按X,最后按ENTER<br \>
+
4、 Send commands:<br \>
[[File:sim7600CE-47.png|400px]]
+
[[File:Sim7600x-4G-HAT-wiki-32.png|400px]]
  
===Python例程===
+
===Python Examples===
安装函数库后<br \>
+
Install libraries<br \>
 
  sudo apt-get python3-pip
 
  sudo apt-get python3-pip
 
  sudo pip3 install pyserial
 
  sudo pip3 install pyserial
 
  sudo apt-get install p7zip
 
  sudo apt-get install p7zip
使用wget工具下载源码到Jetson Nano指定文件夹,复制下面命令
+
Download the demo codes
 
  mkdir -p ~/Documents/SIM7600X_4G_HAT
 
  mkdir -p ~/Documents/SIM7600X_4G_HAT
  wget -P ~/Documents/SIM7600X_4G_HAT/ http://www.waveshare.net/w/upload/2/29/SIM7600X-4G-HAT-Demo.7z
+
  wget -P ~/Documents/SIM7600X_4G_HAT/ http://{{SERVERNAME}}/w/images/2/29/SIM7600X-4G-HAT-Demo.7z
[[File:sim7600CE-48.png|400px]]<br \>
+
[[File:Sim7600x-4G-HAT-wiki-33.png|400px]]<br \>
进入刚创建并下载了源码的目录,使用p7zip工具解压到当前目录
+
Ener the folder of demo codes and unzip it
 
  cd ~/Documents/SIM7600X_4G_HAT/
 
  cd ~/Documents/SIM7600X_4G_HAT/
 
  sudo p7zip --uncompress SIM7600X-4G-HAT-Demo.7z
 
  sudo p7zip --uncompress SIM7600X-4G-HAT-Demo.7z
 
===='''AT'''====
 
===='''AT'''====
SIM7600X_4G_HAT接入Jetson Nano,接入天线,例程使用了软件开机关机,无需按下按键进行开关机,退出时按下Ctrl+C后会进行软件关机。
+
Connect the SIM7600X_4G_HAT to Jetson Nano.</ br>
进入Jetson Nano/AT目录,执行命令:
+
Enter the directoryJetson Nano/AT:
 
  cd ~/Documents/SIM7600X_4G_HAT/Jetson\ nano/AT/
 
  cd ~/Documents/SIM7600X_4G_HAT/Jetson\ nano/AT/
 
  sudo python3 AT.py
 
  sudo python3 AT.py
[[File:sim7600CE-49.png|400px]]
+
[[File:Sim7600x-4G-HAT-wiki-34.png|400px]]
 
===='''GPS'''====
 
===='''GPS'''====
SIM7600X_4G_HAT接入Jetson Nano,接入GNSS天线,例程使用了软件开机关机,无需按下按键进行开关机,退出时按下Ctrl+C后会进行软件关机。
+
Connect the SIM7600X_4G_HAT to Jetson Nano.</ br>
进入Jetson Nano/GPS目录,执行命令:
+
Enter the directory Jetson Nano/GPS:
 
  cd ~/Documents/SIM7600X_4G_HAT/Jetson\ nano/GPS/
 
  cd ~/Documents/SIM7600X_4G_HAT/Jetson\ nano/GPS/
 
  sudo python3 GPS.py
 
  sudo python3 GPS.py
[[File:sim7600CE-50.png|400px]]
+
[[File:Sim7600x-4G-HAT-wiki-35.png|400px]]
 
===='''PhoneCall'''====
 
===='''PhoneCall'''====
SIM7600X_4G_HAT接入Jetson Nano,接入main天线,耳机,例程使用了软件开机关机,无需按下按键进行开关机,本例程使用移动卡自动拨打10086,退出时按下Ctrl+C后会进行软件关机。
+
Connect the SIM7600X_4G_HAT to Jetson Nano.</ br>
进入Jetson Nano/PhoneCall目录,执行命令:
+
Enter the direcoryJetson Nano/PhoneCall:
 
  cd ~/Documents/SIM7600X_4G_HAT/Jetson\ nano/PhoneCall/
 
  cd ~/Documents/SIM7600X_4G_HAT/Jetson\ nano/PhoneCall/
 
  sudo python3 PhoneCall.py
 
  sudo python3 PhoneCall.py
[[File:sim7600CE-51.png|400px]]
+
:Note: You need to modify the number by modify the codes.
 +
[[File:Sim7600x-4G-HAT-wiki-36.png|400px]]
 
===='''SMS'''====
 
===='''SMS'''====
SIM7600X_4G_HAT接入Jetson Nano,接入main天线,例程使用了软件开机关机,无需按下按键进行开关机。本例程发送信息www.waveshare.com给指定号码后,会自动软件关机。用户使用SMS例程时,须'''先使用vim等工具更改SMS.py文件中第10行的号码''',将*替换成数字,保留''' ' '''符号,[http://www.waveshare.net/study/portal.php?mod=view&aid=598 vim使用请点击此句参考]。<br \>
+
Connect the SIM7600X_4G_HAT to Jetson Nano.</ br><br \>
进入Jetson Nano/SMS目录,执行命令:
+
Enter the directory Jetson Nano/SMS:
 
  cd ~/Documents/SIM7600X_4G_HAT/Jetson\ nano/SMS/
 
  cd ~/Documents/SIM7600X_4G_HAT/Jetson\ nano/SMS/
 
  sudo python3 SMS.py
 
  sudo python3 SMS.py
[[File:sim7600CE-52.png|400px]]
+
:Note: You need to change the phone number by modify the codes
 +
[[File:Sim7600x-4G-HAT-wiki-37.png|400px]]
 
===='''TCP'''====
 
===='''TCP'''====
SIM7600X_4G_HAT接入Jetson Nano,接入main天线,例程使用了软件开机关机,无需按下按键进行开关机。<br \>
+
Connect the SIM7600X_4G_HAT to Jetson Nano.</ br>。<br \>
进入Jetson Nano/TCP目录,执行命令:
+
Enter the directory Jetson Nano/TCP:
 
  cd ~/Documents/SIM7600X_4G_HAT/Jetson\ nano/TCP/
 
  cd ~/Documents/SIM7600X_4G_HAT/Jetson\ nano/TCP/
 
  sudo python3 TCP.py
 
  sudo python3 TCP.py
[[File:sim7600CE-53.png|400px]]
+
:Note: you need to modify the address to the actual one.
 
+
[[File:Sim7600x-4G-HAT-wiki-38.png|400px]]
 
 
更多示例程序持续更新中… …
 

Latest revision as of 10:12, 13 July 2020

Testing

Hardware setting

  • This module comes with GSM antenna, LTE antenna and micro USB cable. Besides these you should prepare:
    • A 4G sim card
    • A microphone cable
    • A Micro SD card (Optional)
  • Insert the SIM card to the card slot, Insert the headphone cable and connect the LTE antenna.
  • back side
  • front size
  • Connect the USB interface of SIM7600E-H 4G HAT to PC with a micro USB cable. Then the PWR indicator will keep bright.
  • Press the PWRKEY button and hold for 1s, the NET indicator will blink 1 time per second.
  • Open Device Manager to check the COM ports
    Sim7600x-4G-HAT-wiki-1.jpg
  • Install SIM7600 driver(driver)

【Note】The default hardware of SIM7600CE 4G HAT needs to be turned on by button. If the hardware needs to be turned on automatically, you can use a connection line to connect the PWR and GND pins on the module pin, so that it can automatically turn on, as shown in the figure below
SIM7600X 4G HAT (3).png

Testing it with AT commands

General AT commands


Sim7600x-4G-HAT-wiki-3.jpg


Command Description Return
AT AT test command OK
ATE ATE1: Enable echo
ATE0: Disable echo
OK
AT+CGMI Module manufacturers OK
AT+CGMM Module model OK
AT+CGSN Serial number OK
AT+CSUB Module revision OK
AT+CGMR Firmware revision OK
AT+IPREX Set baud rate +IPREX:
OK
AT+CRESET Reset module OK
AT+CSQ Check signal quality +CSQ: 17,99
OK
AT+CPIN? SIM Card Status +CPIN: READY
AT+COPS? Operator selection +COPS:
OK
AT+CREG? Network registration +CREG:
OK
AT+CPSI? UE system infor
AT+CNMP Mode selection:
2:Automatic
13:GSM only
38:LTE only
48 : Any modes but LTE
... ....
OK

For more details, please refer to the documentation: SIM7500_SIM7600 Series_AT Command Manual_V1.07

Raspberry Pi use 4G

  • Insert the module to 40PIN GPIO of Raspberry Pi, connect the USB interface of 4G module to USB port of Pi, and start it.:

Hardware connection

route add -net 0.0.0.0 ppp0

Test GPS

  • Connecting the GPS antenna, and place the receiver on open area outdoor
  • AT Commands used
AT+CGPS=1	    //Enable GPS
AT+CGPSINFO       //Print GPS information to serial port
AT+CGPS=0       //Disable GPS

Sim7600x-4G-HAT-wiki-7.jpg

TCP/IP Connection

Please make sure that your SIM card supports GPRS services.

  1. Assemble the SIM card, connect all the antenna, and connect the module to PC by USB cable.
  2. Press the PWR button to power on the module and wait for a dozen seconds.
  3. Mkae sure that all the indicator light normally.

Set the local virtual servers settings

Virtual servers define the mapping between service ports of WAN and web servers of LAN. All requests from the Internet to service ports of WAN will be redirected to the computer (webservers of LAN) specified by the server IP. (see your router’s guide manual))

  1. Log in Management Console of your router with a browser (read your router’s guide manual for specific address)
  2. Set Port::2317(The Port can’t conflict to others. Here we set2317)
  3. Set LAN IP address of your computer (you can run CMD on your computer, and execute commands config to inquiry the address of IPv4), 192.168.1.168 as examples

Get WAN IP

You can search “IP” on the browser to get your WAN IP address
Sim7600x-4G-HAT-wiki-8.jpg

Set GPRS

AT+CGDCONT=1,"IP","CMNET"     //Set APN
AT+CSQ       //Check the quality of the signal, bigger the value, stronger the signal.
AT+CREG?         //GPRS network status
AT+CIPMODE=1        //TCP/IP mode
AT+CSOCKSETPN=1          //PDP profile number
AT+CIPMODE=0          //Choose TCP/IP mode
AT+NETOPEN         //Open socket
AT+CIPOPEN=0,"TCP","113.81.233.65",2317         //establish connection
AT+CIPSEND=0,9,         //Send data of a specific size
1A                     //(HEX format) Tell module to send data
AT+CIPCLOSE=0,         //close connection
AT+NETCLOSE,         //Close socket

Test TF card

1. Plug the SIM card, connect the LTE antenna, and connect the USB interface of SIM7600E-H 4G HAT to PC. Then press the PWRKEY to power on

SIM7600X 4G HAT (5).png

2. User command to use TF card

AT+FSCD=D:				//Choose the path of TF card 
+FSCD: D:/
OK
AT+FSLS					//Check subdirecotry
+FSLS: SUBDIRECTORIES: 
overlays
MyDir
System Volume Information
...
...
OK

Sim7600x-4G-HAT-wiki-9.jpg</ br> 3. Create file and write data to TF card Create MyDir folder in the root directory and create tx.txt in the folder, write data test content to the file by the following commands

AT+CFTRANRX="D:/MyDir/t1.txt",12				//file name
>test content								//data
OK

Sim7600x-4G-HAT-wiki-10.jpg

4. Open file of TF card

AT+CFTRANTX="D:/MyDir/t1.txt"
+CFTRANTX: DATA,012
test content
+CFTRANTX: 0
OK

Sim7600x-4G-HAT-wiki-11.jpg</ br> Sim7600x-4G-HAT-wiki-12.jpg

For more information about the commands, please refer to SIM7500_SIM7600 Series_AT Command Manual_V1.07 P256~P268

Take calls

  • Connect the hardware and power on the SIM7600X module.
  • Commands for taking calls:
AT+CNUM Phone number (Not all SIM cards Support) +CNUM
OK
AT+CSDVC AT+CSDVC=1:Handset output
AT+CSDVC=3:Speaker output
OK
AT+CLVL=? check volume level OK
AT+CLVL=2 volume level set to 2 OK
ATD<phone_number>; Make calls OK
AT+CHUP Hang up call OK
AT+CLIP=1 Phone ring OK
ATA Answer call OK

Take call

【Note】: You need to check "new line" when using SSCOM to test

Send/Receive SMS

  1. Plug the SIM card, connect the LTE antenna and connect the USB interface of SIM7600E-H 4G HAT to PC. Then press the PWRKEY to
  2. Check whether the indicators blink correctly (PWR’s and NET’s flashes).
  3. Use commands below to send SMS
Comamnd Description Return
AT+CMGF=1 select message format OK
AT+CSCS="GSM" Select TE character set: GSM OK
AT+CSMP set text mode para OK
AT+CMGS="<phonenumber>" Send message OK
AT+CNMI=2,1 message indications OK
AT+CMGR=1 Read message 1 OK

Send SMS

Receive SMS

Working with Raspberry Pi

Hardware connection

The relationship between SIM7600 control pins and Raspberry Pi IOs is shown in Table:

SIM7600X 4G HAT Raspberry Pi
5V 5V
GND GND
RXD TXD (BCM: 14)
TXD RXD (BCM: 15)
PWR P22 (BCM: P6)
FLIGHTMODE P7 (BCM: P4), high active

Initialize Raspberry Pi

You need to set the SIM7600 module to the working mode first.

  • Download demo codesdemo codes,unzip it and recommend the folder Rspberry Pi/c as SIM7600X,and sopy it to /home/pi directory of Raspberry Pi
  • Go to /home/pi/SIM7600X directory and run the following command.
chmod 777 sim7600_4G_hat_init
  • Set auto-run when booting:
sudo nano /etc/rc.local
  • Add the line below in the from of exit 0:
sh /home/pi/SIM7600X/sim7600_4G_hat_init

Sim7600x-4G-HAT-wiki-19.jpg

Enable serial port

For proper use, you need to disable the login shell and enable the hardware serial.

sudo raspi-config

Choose Interfacing Options ->Serial ->no -> yes,

Networking via wwan0 Interface

1、Connect the USB interface of SIM7600 module to Rasberry Pi by USB cable

2、Use ifconfig command to check wwan0 interface.

3、Install libqmi and udhcpc

sudo apt-get install libqmi-utils udhcpc -y

3、Check the status of wwan0 interface:

sudo qmicli -d /dev/cdc-wdm0 --dms-get-operating-mode
If the status is not online, you need to run the following command to configure it and test again.
sudo qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode='online'

4、Set wwan0 network

sudo qmicli -d /dev/cdc-wdm0 -w	
sudo ip link set wwan0 down	
sudo echo 'Y' | sudo tee /sys/class/net/wwan0/qmi/raw_ip
sudo ip link set wwan0 up

5、 Set APN and connect to network.

sudo qmicli -p -d /dev/cdc-wdm0 --device-open-net='net-raw-ip|net-no-qos-header' --wds-start-network="apn='YOUR_APN',username='YOUR_USERNAME',password='YOUR_PASSWORD',ip-type=4" --client-no-release-cid
Note: the apn, username, password and other parameters should be modified according to the actual situation.
The user name of APN can be ignore sometimes. For examples:
sudo qmicli -p -d /dev/cdc-wdm0 --device-open-net='net-raw-ip|net-no-qos-header' --wds-start-network="apn='CMNET',ip-type=4" --client-no-release-cid

6、User udhcpc to set router and IP

 sudo udhcpc -i wwan0

7、Now you can disconnect the RJ45, turn off the WiFi and test the 4G network.

Minicom test

1、Connect the SIM7600 module and power on Raspberry Pi
2、Install minicom

sudo apt-get install minicom

3、Use the command minicom -D /dev/ttyS0 for testing
Default baud rate: 115200
If you use Pi2B/zero, the serial port should be ttyAMA0
4、Send commands:

Sim7600x-4G-HAT-wiki-20.jpg

Demo codes

1、Connect the SIM7600 module and power on Raspberry Pi
2、Dwonalod demo codes and copy it to /home/pi/ directory;

wget http://www.ingcool.com/w/images/2/29/SIM7600X-4G-HAT-Demo.7z
sudo apt-get install p7zip-full
7z x SIM7600X-4G-HAT-Demo.7z   -r -o/home/pi
sudo chmod 777 -R /home/pi/SIM7600X-4G-HAT-Demo

3、Enter the folder of bcm2835 compile and install BCM2835 libraries:

chmod +x configure && ./configure && sudo make && sudo make install

4、Enter the examples folder and run the codes as below:

sudo make clean      //Clean
sudo make        //compile 
sudo ./PhoneCall       //run the codes

You can also combine the commands:

sudo make clean && sudo make && sudo ./PhoneCall

PHONECALL example

Sim7600x-4G-HAT-wiki-21.jpg

SMS example

Sim7600x-4G-HAT-wiki-22.jpg

GPS example

Sim7600x-4G-HAT-wiki-23.jpg

TCP example

Sim7600x-4G-HAT-wiki-24.jpg

FTP example

Sim7600x-4G-HAT-wiki-25.jpg

Arduino example

Hardware connection

Connect the SIM7600 module to UNO PLUS / Arduino UNO:

SIM7600X 4G HAT UNO PLUS / Arduino UNO
5V 5V
GND GND
TXD 0 (RX)
RXD 1 (TX)
PWR 2

Install Arduino Libraries

Downloaad the demo codes and unzip it
Copy folder Waveshare_SIM7600X_Arduino_Library to libraries folder under the installation directory of Arduino IDE
Open Arduino IDE --> File -->Examples -->Waveshare SIM7600X,and run the examples:
Sim7600x-4G-HAT-wiki-26.jpg

Examples

PHONECALL example

Sim7600x-4G-HAT-wiki-27.jpg

SMS example

Sim7600x-4G-HAT-wiki-28.jpg

GPS example

Sim7600x-4G-HAT-wiki-29.jpg

TCP example

Sim7600x-4G-HAT-wiki-30.jpg

FTP example

Sim7600x-4G-HAT-wiki-31.jpg

Jetson Nano Examples

Hardware connection

Jetson Nano has the same 40PIN header as Raspberry Pi.

connection
SIM7600X 4G HAT Jetson Nano
5V 5V
GND GND
TXD 10 (Board)
RXD 8 (Board)
PWR 31(Board)

Jetson Nano minicom test

1、Connect SIM7600X 4G HAT to Jetson Nano and power on it by pressing the PWRKERY key for 3s.将SIM7600X 4G HAT接入Jetson Nano中,按下PWRKER键三秒后开机
2、Access Jetson nano
3、Open a terminal and install minicom:

sudo apt-get install minicom

3、use the command to test module

sudo minicom -D /dev/ttyTHS1 -b 115200

4、 Send commands:
Sim7600x-4G-HAT-wiki-32.png

Python Examples

Install libraries

sudo apt-get python3-pip
sudo pip3 install pyserial
sudo apt-get install p7zip

Download the demo codes

mkdir -p ~/Documents/SIM7600X_4G_HAT
wget -P ~/Documents/SIM7600X_4G_HAT/ http://www.ingcool.com/w/images/2/29/SIM7600X-4G-HAT-Demo.7z

Sim7600x-4G-HAT-wiki-33.png
Ener the folder of demo codes and unzip it

cd ~/Documents/SIM7600X_4G_HAT/
sudo p7zip --uncompress SIM7600X-4G-HAT-Demo.7z

AT

Connect the SIM7600X_4G_HAT to Jetson Nano.</ br> Enter the directoryJetson Nano/AT:

cd ~/Documents/SIM7600X_4G_HAT/Jetson\ nano/AT/
sudo python3 AT.py

Sim7600x-4G-HAT-wiki-34.png

GPS

Connect the SIM7600X_4G_HAT to Jetson Nano.</ br> Enter the directory Jetson Nano/GPS:

cd ~/Documents/SIM7600X_4G_HAT/Jetson\ nano/GPS/
sudo python3 GPS.py

Sim7600x-4G-HAT-wiki-35.png

PhoneCall

Connect the SIM7600X_4G_HAT to Jetson Nano.</ br> Enter the direcoryJetson Nano/PhoneCall:

cd ~/Documents/SIM7600X_4G_HAT/Jetson\ nano/PhoneCall/
sudo python3 PhoneCall.py
Note: You need to modify the number by modify the codes.

Sim7600x-4G-HAT-wiki-36.png

SMS

Connect the SIM7600X_4G_HAT to Jetson Nano.</ br>
Enter the directory Jetson Nano/SMS:

cd ~/Documents/SIM7600X_4G_HAT/Jetson\ nano/SMS/
sudo python3 SMS.py
Note: You need to change the phone number by modify the codes

Sim7600x-4G-HAT-wiki-37.png

TCP

Connect the SIM7600X_4G_HAT to Jetson Nano.</ br>。
Enter the directory Jetson Nano/TCP:

cd ~/Documents/SIM7600X_4G_HAT/Jetson\ nano/TCP/
sudo python3 TCP.py
Note: you need to modify the address to the actual one.

Sim7600x-4G-HAT-wiki-38.png