If you have a 2G (GSM) device based on SIM800C and are now working on creating a 4G (LTE) equivalent, then it is quite possible that you are considering SIM7600 (SIM7600E if you are in India, some other suffix if you are in a different location).
Most IoT devices require the basic functionality of exchanging data over the internet. In this post, we will see the changes that are required in major network-related AT Commands as you migrate from SIM800C to SIM7600. We will restrict ourselves to TCP/IP connections.
Disclaimer: I’ll be oversimplifying the functions of several AT Commands in this tutorial, to ease their understanding. Please don’t quote me anywhere on these commands.
So let’s get started!
Checking Network Registration
On SIM800C, you would be using the following two commands to check network registration
The good news is that the syntax and the usage remains exactly the same with SIM7600. If you are not quite sure of the difference between AT+CREG? and AT+CGREG?, here’s the explanation I use (don’t quote me, I may be oversimplifying it here). AT+CREG? is used to check if cellular network is available or not, and AT+CGREG? is used to check if internet is available or not. Thus, if you have a SIM Card with no internet pack, but voice calls and SMS enabled, AT+CREG? should say registered and AT+CGREG? should say registration denied.
Connecting to the Internet
With SIM800C, you check the GPRS service status with AT+CGATT? and explicitly set it to 1 if it is 0, using AT+CGATT=1. You then set the APN of your provider using AT+CSTT. You then bring up the wireless connection using AT+CIICR.
Luckily, with 7600, there is no need to set the APN. You just need to start the internet using AT+NETOPEN.
Checking IP Address Allotment
In SIM800C, you check if your module has been allotted an IP Address using AT+CIFSR. In SIM7600, the equivalent command is AT+IPADDR
In SIM800C, you use the AT+CIPMUX command to specify if you wish to stay in single IP mode or multi-IP mode (AT+CIPMUX=0 for single IP and AT+CIPMUX=1 for multi-IP). In the case of SIM7600, there is no such equivalent. The module is, by default in the multi-IP mode.
Starting the TCP Connection
In SIM800C, you start the TCP Connection using the AT+CIPSTART command. The typical syntax for single IP mode is
AT+CIPSTART = <mode>,<IP Address or domain>,<port>
AT+CIPSTART = “TCP”,”iotespresso.com”,80
For multi-IP mode, there is an extra connection number field.
AT+CIPSTART = <n>,<mode>,<IP Address or domain>,<port>
<n> can take values from 0 to 5, indicating a maximum of 6 connections.
The equivalent command in SIM7600 is AT+CIPOPEN. It is similar in syntax to the multi-IP mode syntax of SIM800C.
The syntax is:
AT+CIPOPEN = <n>,<mode>,<IP Address or domain>,<port>
<n> is like the channel number of the socket number. You can create up to 10 sockets in parallel in the command mode, and therefore, the <n> can have values from 0 to 9. In the transparent mode, the <n> can only have the value of 0.
Querying the connection status
In SIM800C, you use AT+CIPSTATUS to query the status of the connection. Unfortunately, there is no equivalent for SIM7600.
In SIM800C, you use AT+CIPSEND to send data in single IP mode and AT+CIPSEND=<n> to send data in the multi-IP mode, where <n> represents the channel number. It returns a prompt (>), following which you can keep sending data, till you terminate the transmission using Ctrl+Z (\x1A). The process is similar for SIM7600 and the syntax is same as the multi-IP mode. You use AT+CIPSEND=<n>, to specify over which connection/link you’d like to send data.
Closing the TCP Connection
In SIM800C, you call AT+CIPCLOSE to close an open TCP Connection in single IP mode. In multi-IP mode, you call AT+CIPCLOSE = <n>. In SIM7600 as well, you call AT+CIPCLOSE=<n> and specify which connection you wish to close.
Closing Network Connection
Technically, this is mentioned in the AT Commands manuals as deactivating the PDP Context. In SIM800C, the command is AT+CIPSHUT. The equivalent for SIM7600 is AT+NETCLOSE.
The table below summarizes the things discussed so far:
Of course, you are encouraged to go through the AT Commands manual of both the modules, and also the TCP/IP application note, to get a detailed idea on these commands and a fair idea of the TCP Connection process.
- SIM800C AT Commands Manual
- SIM7600 AT Command Manual
- SIM800 TCP/IP Application Note
- SIM7600 TCP/IP Application Note
Enjoyed this article? Then you may also like other firmware articles on iotespresso.com. Click here to access them. Feel that some AT Commands should be added to this post? Mention them in the comments below.