{"id":10855,"date":"2014-01-18T06:24:18","date_gmt":"2014-01-18T14:24:18","guid":{"rendered":"http:\/\/m2msupport.net\/m2msupport\/?page_id=10855"},"modified":"2018-12-14T23:19:02","modified_gmt":"2018-12-15T07:19:02","slug":"tcpudp-ip-testing-for-m2m-modules","status":"publish","type":"page","link":"https:\/\/m2msupport.net\/m2msupport\/tcpudp-ip-testing-for-m2m-modules\/","title":{"rendered":"TCP\/UDP IP testing for M2M Modules"},"content":{"rendered":"<p>Device manufacturers implement proprietary AT coommand interfaces for TCP\/UDP connections. Typical interfaces includes bringing up TCP\/UDP connection, setting up TCP configuration, send\/receive data to remote server, providing link statistics etc.<\/p>\n<p><strong>TCP\/UDP Testing for Huawei Modules<\/strong><br \/>\nHuawei modules have embedded TCP\/UDP stack. This lets us create IP connections which are needed for common applications like connecting to a remote server, email, FTP, HTTP etc.<br \/>\nIn the TCP\/UDP tab of the AT Command Tester, you can easily test TCP connections.<\/p>\n<p><a href=\"http:\/\/m2msupport.net\/m2msupport\/module-tester\/\"><img decoding=\"async\" src=\"http:\/\/www.m2msupport.net\/m2msupport\/wp-content\/themes\/admired\/images\/huawei_tcp_send.PNG\" alt=\"Huawei TCP UDP\" height=\"98%\" width=\"98%\"\/><\/a><\/p>\n<p><strong>TCP Connection<\/strong><br \/>\nUp to five TCP or UDP connection links can be setup at a time. First IP initialization uses the APN information to create a network connection. Once the IP is initialized, a successful IP address is avilable. Once the IP is initialized, a connection to a remote server to a specific port can be made.<\/p>\n<p><code><br \/>\nChecking registration status...<\/code><\/p>\n<p><code>AT+CREG?<\/code><\/p>\n<p><code>+CREG: 2,5,\"7CF4\",\"232B521\",2<\/p>\n<p>OK<br \/>\nDevice is registered and is roaming.<\/p>\n<p>Checking if device is already connected...<\/p>\n<p>AT+CGACT?<\/p>\n<p>+CGACT: 1,1<br \/>\n+CGACT: 15,0<\/p>\n<p>OK<br \/>\nDisconnected profile 1<br \/>\nAT+CGACT=0, 1<\/p>\n<p>OK<br \/>\nDis-connect is successful<\/p>\n<p>^IPSTATE: 7,0,2<br \/>\nAT+CMEE=1<\/p>\n<p>OK<br \/>\nAttaching to network...<br \/>\nAT+CGATT=1<\/p>\n<p>OK<\/p>\n<p>Initializing the IP connection...<br \/>\nAT^IPINIT=\"bluevia.movistar.es\"<\/p>\n<p>^MODE: 5,7<\/p>\n<p>OK<\/p>\n<p>^MODE: 5,4<\/p>\n<p>Checking initialization status...<\/p>\n<p>AT^IPINIT?<\/p>\n<p>^IPINIT: 1,\"10.104.133.125\",\"bluevia.movistar.es\",\"80.58.61.250\",\"80.58.61.254\"<\/p>\n<p>OK<br \/>\nThe network connection is sucessfully initialized.<br \/>\nIP Address -&gt; \"10.104.133.125\"<br \/>\nAPN -&gt; \"bluevia.movistar.es\"<br \/>\nPrimary DNS Address -&gt; \"80.58.61.250\"<br \/>\nSecondary DNS Address -&gt; \"80.58.61.254\"<br \/>\nOpening the TCP connection...<\/p>\n<p>AT^IPOPEN=1,\"TCP\",\"www.m2msupport.net\",80<\/p>\n<p>OK<br \/>\nAT^IPOPEN?<\/p>\n<p>^IPOPEN: 1,\"TCP\",39855,\"74.124.194.252\",80,3,1220<\/p>\n<p>OK<br \/>\nFollowing connections are opened,<\/p>\n<p>Link ID-&gt; 1<br \/>\nType-&gt;\"TCP\"<br \/>\nLocal Port-&gt;39855<br \/>\nRemote IP-&gt;\"74.124.194.252\"<br \/>\nRemote Port-&gt;80<br \/>\nSIO Port&gt;3<br \/>\nMSS Port-&gt;1220<br \/>\nAT^IPOPEN?<\/p>\n<p>^IPOPEN: 1,\"TCP\",39855,\"74.124.194.252\",80,3,1220<\/p>\n<p>OK<br \/>\nFollowing connections are opened,<\/p>\n<p>Link ID-&gt; 1<br \/>\nType-&gt;\"TCP\"<br \/>\nLocal Port-&gt;39855<br \/>\nRemote IP-&gt;\"74.124.194.252\"<br \/>\nRemote Port-&gt;80<br \/>\nSIO Port&gt;3<br \/>\nMSS Port-&gt;1220<br \/>\nSending TCP data<\/p>\n<p><strong>How to send data to remote server?<\/strong><br \/>\nOnce an IP connection is established, you can use TCP or UDP to connect to a remote server. You can then send the client data using the AT Command Tester. In the above, example, the device is connected to HTTP port (80) of http:\/\/m2msupport.net. It then sends HTTP formatted message to the server over the TCP\/IP connection. It gets successful response back from the server which is also a HTTP formatted message. When you input messages in the 'Client Data' text box, please check the appropriate formatting(newline) of the intended application.<\/p>\n<p><\/code><code><\/code><code><\/code><code><br \/>\nAT^IPSEND=1,\"<br \/>\nGET \/m2msupport\/http_get_test.php HTTP\/1.1<br \/>\nHost:www.m2msupport.net<br \/>\nConnection:keep-alive<\/code><\/p>\n<p>&#8221;<br \/>\n^IPDATA: 1,416,HTTP\/1.1 200 OK<br \/>\nDate: Tue, 14 Jan 2014 13:53:50 GMT<br \/>\nServer: Apache\/2.2.26 (Unix) mod_ssl\/2.2.26 OpenSSL\/0.9.8e-fips-rhel5 DAV\/2 mod_auth_passthrough\/2.1 mod_bwlimited\/1.4 FrontPage\/5.0.2.2635<br \/>\nX-Powered-By: PHP\/5.2.17<br \/>\nKeep-Alive: timeout=3, max=100<br \/>\nConnection: Keep-Alive<br \/>\nTransfer-Encoding: chunked<br \/>\nContent-Type: text\/html; charset=utf-8<\/p>\n<p>3a<br \/>\nSucessful HTTP GET test. Data received from m2msupport.net<br \/>\n0<\/p>\n<p>^IPSEND: 1<\/p>\n<p>OK<\/p>\n<p>^IPSTATE: 1,0,0<\/p>\n<p>&nbsp;<\/p>\n<p><strong>TCP\/UDP Testing for Simcom Modules<\/strong><\/p>\n<div id=\"TCP\"><strong>TCP\/UDP<\/strong><\/div>\n<p>SIMCOM modules have in-built TCP\/UDP stack. AT command tester provides interfaces to<a href=\"http:\/\/m2msupport.net\/m2msupport\/tcpudp-ip-testing-for-m2m-modules\/\"> test TCP\/UDP <\/a>functions of SIMCOM modules.<\/p>\n<p><a href=\"http:\/\/m2msupport.net\/m2msupport\/module-tester\/\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6245\" title=\"diagnostics\" src=\"http:\/\/www.m2msupport.net\/m2msupport\/wp-content\/themes\/admired\/images\/simcom_tcp.PNG\" alt=\"\" width=\"689\" height=\"688\"\/><\/a><\/p>\n<p><strong>AT Command sequence for Simcom TCP function<\/strong><br \/>\n<code><br \/>\n<span style=\"color: #0000ff;\"><em><strong>\/\/Checking registration status...<\/strong><\/em><\/span><br \/>\nAT+CREG?<\/code><\/p>\n<p><code>+CREG: 0,5<\/code><\/p>\n<p><code>OK<br \/>\nDevice is registered and is roaming.<\/p>\n<p><span style=\"color: #0000ff;\"><em><strong>\/\/Checking if device is already connected...<\/strong><\/em><\/span><br \/>\nAT+CGACT?<\/p>\n<p>+CGACT: 1,0<br \/>\n+CGACT: 2,0<br \/>\n+CGACT: 3,0<\/p>\n<p>OK<br \/>\nAT+CMEE=1<\/p>\n<p>OK<\/p>\n<p><span style=\"color: #0000ff;\"><em><strong>\/\/Attaching to network...<\/strong><\/em><\/span><br \/>\nAT+CGATT=1<\/p>\n<p>OK<\/p>\n<p><span style=\"color: #0000ff;\"><em><strong>\/\/Setting up APN for TCP connection...<\/strong><\/em><\/span><br \/>\nAT+CSTT=\"bluevia.movistar.es\"<\/p>\n<p>OK<\/p>\n<p><span style=\"color: #0000ff;\"><em><strong>\/\/Bring up GPRS Connection...<\/strong><\/em><\/span><\/p>\n<p>AT+CIICR<\/p>\n<p>OK<\/p>\n<p><span style=\"color: #0000ff;\"><em><strong>\/\/Get the local IP address<\/strong><\/em><\/span><br \/>\nAT+CIFSR<\/p>\n<p>10.0.131.15<\/p>\n<p><span style=\"color: #0000ff;\"><em><strong>\/\/Start TCP connection<\/strong><\/em><\/span><br \/>\nAT+CIPSTART=\"TCP\",\"74.124.194.252\",\"80\"<\/p>\n<p>OK<\/p>\n<p>CONNECT OK<br \/>\nTCP connection success<\/p>\n<p>Sending TCP data<\/p>\n<p><em><strong><span style=\"color: #0000ff;\">\/\/Send data. Below data is HTTP formatted.<\/span><\/strong><\/em><br \/>\nAT+CIPSEND<\/p>\n<p>&gt;<br \/>\nGET \/m2msupport\/http_get_test.php HTTP\/1.1<br \/>\nHost:www.m2msupport.net<br \/>\nConnection:keep-alive<\/p>\n<p>\u001a<br \/>\nSEND OK<\/p>\n<p><span style=\"color: #0000ff;\"><em><strong>\/\/Response from remote server.<\/strong><\/em><\/span><br \/>\nHTTP\/1.1 200 OK<br \/>\nDate: Mon, 20 Jan 2014 19:44:37 GMT<br \/>\nServer: Apache\/2.2.26 (Unix) mod_ssl\/2.2.26 OpenSSL\/0.9.8e-fips-rhel5 DAV\/2 mod_auth_passthrough\/2.1 mod_bwlimited\/1.4 FrontPage\/5.0.2.2635<br \/>\nX-Powered-By: PHP\/5.2.17<br \/>\nKeep-Alive: timeout=3, max=100<br \/>\nConnection: Keep-Alive<br \/>\nTransfer-Encoding: chunked<br \/>\nContent-Type: text\/html; charset=utf-8<\/p>\n<p>3a<br \/>\nSucessful HTTP GET test. Data received from m2msupport.net<br \/>\n0<\/p>\n<p><\/code><code><\/code><code>CLOSED<br \/>\nTCP connection is closed by remote server<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Device manufacturers implement proprietary AT coommand interfaces for TCP\/UDP connections. Typical interfaces includes bringing up TCP\/UDP connection, setting up TCP configuration, send\/receive data to remote server, providing link statistics etc. TCP\/UDP Testing for Huawei Modules Huawei modules have embedded TCP\/UDP &hellip; <a href=\"https:\/\/m2msupport.net\/m2msupport\/tcpudp-ip-testing-for-m2m-modules\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"software_howto.php","meta":{"footnotes":""},"class_list":["post-10855","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/pages\/10855","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/comments?post=10855"}],"version-history":[{"count":3,"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/pages\/10855\/revisions"}],"predecessor-version":[{"id":16833,"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/pages\/10855\/revisions\/16833"}],"wp:attachment":[{"href":"https:\/\/m2msupport.net\/m2msupport\/wp-json\/wp\/v2\/media?parent=10855"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}