I can’t recommend the LilyGO T-SIM A7670E the reasons being
After procrastinating a few weeks with that unit, I came to the conclusion that I can’t use it for my project.
I will try to find out another unit such as the T-SIM A7600 that works a lot better. Maybe give a go at the S3 version.
It has been noted that the GPS data can be inaccurate, while the 7600 is fairly accurate, the 7670 is more unstable.
As the trigger for mqtt uplink is based on a Lat/log/Alt difference, when the GPS data is not accurate, a message is sent wheras it should not.
So an additional check has to be made before checking the difference to establish that an mqtt update is to be sent
The PDOP, HDOP, VDOP, have been check to discard the GPS reading out of bound, but that’s stil not enough.
Necessary AT coammands
|At Cmd|Reason|
|++++++++++++++++|++++++++++++++++++++++++++++++++|
|AT+CGNSSPWR=1,1|turn GPS on (in Hot flash mode)|
|AT+CGNSSPORTSWITCH=1,0|
|AT+CGNSSTST=0|Test mode OFF|
|AT+CGNSSMODE=1|GPS|
|AT+CGNSSPORTSWITCH=1,0|Send NMEA Data to output port|
|AT+CGNSSINFO=30|Report GNSS info every 30 seconds|
|AT+CGPSINFO=30|Report GPS info every 30 seconds|
Mon module: Model: A7670E-FASE Revision: A7670M7_V1.11.1
répond AT+CGNSSMODE=? +CGNSSMODE: (1-4)
Le mode 1 verouille (GPS)
Le mode 3 (GPS+GLONASS+GALILEO+SBAS+QZSS) verouille aussi
[
Donc:
3
AT+CGNSSPORTSWITCH 1,0 AT+CGNSSMODE 3 AT+CGPSWARM AT+CGNSSINFO 30
GPRS
AT+CPIN=pin AT+CREG=1 AT+CNUM returns the phone number (+CNUM: “�”,"+32498691052",145))
Packet domain
register AT+CGREG=1 attach AT+CGATT=1 AT+NETOPEN
Start MQTT
AT+CMQTTSTART AT+CMQTTACCQ=0,“modemtest”,0 //acquire a client define client ID AT+CMQTTCONNECT=0,“tcp://www.jcoenen.com:8883”,60,1,“jcoenen”,“Beatr1ce” // connect to broker
Get IP address AT+CGPADDR
Ping: AT+CPING=“ www.jcoenen.com ”,1,4 returns: 1, IP address, packet size, rtt, TTL (+CPING: 1,213.211.158.130,92,270,55) 2 ping time out 3 ping result
MQTT sequence
CMQTTSTART AT+CMQTTACCQ=0,“modemtest”,0. //acquire client AT+CMQTTCONNECT=0,“tcp://www.jcoenen.com:8883”,60,1,“jcoenen”,“Beatr1ce” //connect client to broker
AT+CMQTTTOPIC=0,length(topic string) topic string
AT+MQTTPAYLOAD=0,length(payload string) payload string
AT+CMQTTPUB=0,1,120,1. (client ID, Send at least once, timeout seconds, retain flag)