Socket test tool was configured to listen for socket connection on port 50099. This can be any free port on your PC. It is important that your PC have public IP address visible from internet. Otherwise socket connection will not be possible. Also check that your firewall isn’t blocking connection. Print screen of socket tool is displayed on picture below.
Print screen of terminal tool is displayed below
Under is displayed complete communication between PC COM port and modem. Comments after // are added to explain further every command that is issued.
Lines that are sent from PC to GPRS modem are highlighted
^SYSSTART //it is written on modem startup and can confirm you that you are communicating with modem at^sics=0,conType,gprs0 OK //you are setting up gprs connection type at^sics=0,passwd,gprs OK //password is parameter provided by your mobile operater, see gprs access information from operater for this data. In this case it is gprs at^sics=0,apn,internet OK //apn is parameter provided by your mobile operater, see gprs access information from operater for this data. In this case it is internet at^sics=0,user,telenor OK //user is parameter provided by your mobile operater, see gprs access information from operater for this data. In this case it is telenor at^siss=1,srvType,socket OK //we setup socket type of connection at^siss=1,conId,0 OK //modem can save several different parameters for connection so we choose position to save current parameters. Position 0 at^siss=1,address,socktcp://126.96.36.199:50099 OK //here we declare IP address and PORT of destination software. at^siso=1 OK ^SISW: 1, 1 //with this AT command we open socket for data tranfer at^sisw=1,6 ^SISW: 1, 6 OK // This command sends six bytes to destination via opened socket connection //after receiving ok next declared number of bytes are being sent via socket connection. In this case next 6 bytes will be sent 123456 //these are bytes that are being sent ^SISW: 1, 1 ^SISR: 1, 1 //informs us something was received on open socket at^sisr=1,120 //with this command we say we want to read first 120 unread bytes that were received on socket connection. If there are less than for this example 120 bytes only available number of bytes will be read. ^SISR: 1, 8 //only 8 bytes were received 123456 //these are 8 bytes. 123456 and enter LF+CR OK at^sisc=1 OK //with this command we close socket connection so we can make other configurations to modem at^sisr=1,120 ERROR //after socket is closed we can not issue read command at^sisw=1,6 ERROR //after socket is closed we can not issue write command at^siso=1 OK ^SISW: 1, 1 //with this command socket is again opened and now again we can read or write data to socket connection at^sisw=1,6 ^SISW: 1, 6 OK asdfgh ^SISW: 1, 1 at^sisc=1 OK
Commands that were used are :
Indicates that the modem has been started and is ready to operate.
ATE Enable command echo
The ATE command determines whether or not the modem echoes characters received from PC during command
state.You can use it with parameter following ATE. For example ATE0 or ATE1.
Parameter meaning is:
0 or no parameter - Echo mode off
1 - Echo mode on
In case of using the command without parameter, <value> is set to 0
AT^SICS Internet Connection Setup Profile
AT^SICS serves to create and edit Internet connection profiles. A connection profile can be assigned to one or
more service profiles defined with AT^SISS, and thus, determines which type of connection is to be established
when opening a service profile with AT^SISO.
Here we defined parameters
AT^SISS Internet Service Setup Profile
AT^SISS serves to set up the necessary parameters in the Internet service profiles. Any service profile can then be used to control a data link in conjunction with AT^SISO, AT^SISC, AT^SISR, AT^SISW
Here we used profile 1 and we have defined next parameters:
AT^SISO Internet Service Open
The AT^SISO write command starts the Internet session configured by the service profile. If the service opens
successfully, the command "^SISW" and "^SISR" will trigger the action to follow, either writing data with AT^SISW
or reading data with AT^SISR. If the "^SISW" and "^SISR"commands notify that no data are available at all, or that
a data transfer has been successful, the service can be closed with AT^SISC.
AT^SISW Internet Service Write Data
The AT^SISW write command must be terminated only with the ASCII character set #13 (Carriage Return). Do not send any further characters after the end-of-line identifier, until the response "^SISW" is received. This is necessary to avoid that any characters related to the AT command can be interpreted as being part of the data stream to be transferred
AT^SISR Internet Service Read Data
The AT^SISR write command triggers reading data via the Internet service configured with AT^SISS.
AT^SISC Internet Service Close
The AT^SISC write command performs all necessary action to release all properties activated by AT^SISO.
For more details on AT commands and other options of this modem refer to its datasheet that you can download from this link