4G模块AIR780EG连接阿里云实现物联网笔记(一)

实物

用CH340 USB转ttl,连接,CH340rxd-》AIR780txd(图上6所示) ,CH340txd-》AIR780rxd(图上6所示) 。

打开安信可串口调试助手

命令文档如下:

AT Commands Documentation

English+中文

AT+RESET

This command is used to restart the wireless module.

4G无线模块air780复位命令既上图中1命令

AT+MCONFIG

This command is used to configure the wireless module's client ID, username, and password.

这个命令就是MQTT协议连接命令

Format:格式

AT+MCONFIG="clientid","username","password"

Example:案例

AT+MCONFIG="k0m5r7ycMDl.8FvvLEUFQCldBEQFZqCv|securemode=2,signmethod=hmacsha256,timestamp=1702450549302|","8FvvLEUFQCldBEQFZqCv&k0m5r7ycMDl","ebfb098356549a87d8a6e7b8664877079d20e5162e42dd6b8cd439e89d8df798"

客户端:k0m5r7ycMDl.8FvvLEUFQCldBEQFZqCv|securemode=2,signmethod=hmacsha256,timestamp=1702450549302|","8FvvLEUFQCldBEQFZqCv&k0m5r7ycMDl

账号:8FvvLEUFQCldBEQFZqCv&k0m5r7ycMDl  其中k0m5r7ycMDl 是阿里云产品分类

密码:ebfb098356549a87d8a6e7b8664877079d20e5162e42dd6b8cd439e89d8df798

这些可从阿里云MQTT服务器实例中注册得到

{"clientId":"k0m5r7ycMDl.8FvvLEUFQCldBEQFZqCv|securemode=2,signmethod=hmacsha256,timestamp=1702524063228|","username":"8FvvLEUFQCldBEQFZqCv&k0m5r7ycMDl","mqttHostUrl":"iot-060a9eh1.mqtt.iothub.aliyuncs.com","passwd":"8677d9bb8f53a9a616d774ba9105c7ee000231f78c7d12fb0feb9c36b9056d09","port":1883}

AT+MIPSTART

This command is used to start an IP connection by setting the IP address (or domain) and port number. 这个命令是连接到TCP服务器,就是服务器地址

Format:

AT+MIPSTART="ip or domain","port"
Example:

AT+MIPSTART="iot-060a9eh1.mqtt.iothub.aliyuncs.com","1883" 你自己创建的MQTT服务器地址

AT+MCONNECT

This command is used to start a network connection by setting the connection status and timeout.心跳包长联机命令
Format:

AT+MCONNECT=<connect>,<timeout>
Example:

AT+MCONNECT=1,60   1表示连接,60秒频率连接一次,超过60秒掉线

以下是带GPS的命令

AT+CGNSPWR  GPS模块开关命令

This command is used to control the GPS positioning function of the wireless module.

To turn on GPS positioning:

AT+CGNSPWR=1    打开GPS
To turn off GPS positioning:

AT+CGNSPWR=0    关闭GPS

AT+CGNSINF  获取具体GPS定位信息

This command is used to get GPS positioning information.

Example:

AT+CGNSINF

The device returns the following information:

+CGNSINF: 1,1,20231213043400,22.742352,114.449663,116.099,0.25,0.00,3,,3.10,2.18,4.00,,11,10,,,34,,

This means:

– <GNSS run status>: 1, GNSS is running.
– <Fix status>: 1, positioned.
– <UTC date & Time>: 20231213043400, UTC date and time is 04:34:00 on December 13, 2023.
– <Latitude>: 22.742352, latitude is 22.742352 degrees.
– <Longitude>: 114.449663, longitude is 114.449663 degrees.
– <MSL Altitude>: 116.099, altitude above sea level is 116.099 meters.
– <Speed Over Ground>: 0.25, ground speed is 0.25 knots.
– <Course Over Ground>: 0.00, ground course is 0.00 degrees.
– <Fix Mode>: 3, 3D positioning.
– <HDOP>: 3.10, horizontal accuracy factor is 3.10.
– <PDOP>: 2.18, position accuracy factor is 2.18.
– <VDOP>: 4.00, vertical accuracy factor is 4.00.
– <GNSS Satellites in View>: 11, the number of GNSS satellites in view is 11.
– <GNSS Satellites Used>: 10, the number of GNSS satellites used for positioning is 10.
– <C/N0 max>: 34, the carrier-to-noise ratio of the strongest satellite signal received is 34 dBHz.

So, your device has successfully received the GPS signal and has positioned to the location with latitude 22.742352, longitude 114.449663, and altitude 116.099 meters.

所以,你的设备已经成功获取到GPS信号,并且已经定位到纬度22.742352,经度114.449663,海拔高度116.099米的位置。其他的信息没有用,这个定位相差500米以上,所以这个带GPS模块版本也没多大用。AIR780EG,只选780E就可以。

物联沃分享整理
物联沃-IOTWORD物联网 » 4G模块AIR780EG连接阿里云实现物联网笔记(一)

发表评论