Binary data via UDP, TCP

5 thoughts on “Binary data via UDP, TCP

  1. The CC864 software manual is silent on the subject of binary data transmission and reception using UDP and TCP connections.

     

    I would like to know the  limitations and issues that arise.  I saw something about sending ^Z to send previous data, but that would seem to prevent sending ^Z as part of the binary data.

     

    If there is an AppNote or other document on this, I would be happy to study it.

     

     

    1. When the connection is up any data you send to the serial port is transmitted through TCP/IP regardless its content or type, binary or text. To close the connection one can use the +++ sequence guarded by proper silence time.

      CTRL-Z has no effect in this case, is used as terminator in the case of sending SMS.

       

      Telit Modules Software User Guide and  IP Easy User Guide describe these in detail.

      1. When the connection is up any data you send to the serial port is transmitted through TCP/IP regardless its content or type, binary or text. To close the connection one can use the +++ sequence guarded by proper silence time.

        CTRL-Z has no effect in this case, is used as terminator in the case of sending SMS.

         

        Telit Modules Software User Guide and  IP Easy User Guide describe these in detail.

        Thank you.  I have looked through these documents.  They manage to avoid UDP details almost completely.

         

        UDP is different because there is no "connection" except perhaps logically within the Telit module, and packet boundaries must be explicitly controlled by the user.  So I need to know how to do that.  I understand TCP, but that is different.

         

        Does the "+++" also serve as the send signal for each UDP packet?  So if I want to send multiple UDP packets in quick succession, I reissue the {AT#SD… command, followed by packet data, followed by guarded "+++"} as many times as I have UDP packets to send?

        1. You can also setup the connection in command mode, send -suspend-restore. Packets can be split in parts see relevant parameters of #SCFG.

           

        2. There is only one difference in commands for TCP and UDP:

          AT#SD=X,1,… for UDP
           or

          AT#SD=X,0,… for TCP

           

          Packet will be sent according to SCFG settings, but to force packet to be sent you can use AT#PKTSZ=?, where ? is the size of the packet (up to 1500 bytes ). This is useful when packets has different size but less 300 bytes. By default packet size is 300 byte, so if your packet size is for instance 150bytes,  first packet sending will wait the second packet for reaching said default packet size. 

           

          "+++" just only suspends the socket. If you intend to send packet after packet, no need to suspend the socket.

           

          I am using UDP instead of TCP also for at least of 2 reasons:

          1. TCP overhead is bigger.

          2. Because of no any logical connection in UDP, GSM provider do not close the socket even if it is not in use for a long time (several hours).