title: Adafruit Fona establishes connection with echo server, but doesn't send over any data
body: <p>Using mbed OS and stm32 nucleo board with Adafruit Fona 3g, I am trying to send data to a server via 3g connection. I am using the .cpp file and .h file posted here: <a href="https://os.mbed.com/users/Nels885/code/Adafruit_FONA_3G/file/b18cfba4283a/" rel="nofollow noreferrer">https://os.mbed.com/users/Nels885/code/Adafruit_FONA_3G/file/b18cfba4283a/</a></p>
  
  <p>The code seems to get stuck on getTCPtimeout. I am having trouble figuring out why this is the case. </p>
  
  <p>I have tried commenting out the getTCPtimeout function to see the results and the code runs through completely, but never establishes a connection with the server. </p>
  
  <pre><code>#include "mbed.h"
  #include "Adafruit_FONA.h"
  
  #define FONA_RST D4
  #define FONA_TX D1
  #define FONA_RX D0
  #define FONA_RI D7 //not used
  
  char replybuffer[255];
  
  
  Adafruit_FONA_3G fona(FONA_TX, FONA_RX, FONA_RST, FONA_RI);
  Serial pc(USBTX, USBRX);
  
  int main() 
  {
  
      fona.TCPinitialize();
      pc.printf ("initialize \n");
      char *Timeout = "10000000";
      fona.getTCPtimeout(Timeout);
      pc.printf ("timeout \n");
      char * Server = "47.218.188.133";
      uint16_t Port = 23;
      fona.TCPconnect(Server,Port);
      pc.printf ("connect \n");
      char * Packet = "Pick Up %";
      fona.TCPsend(Packet);
      pc.printf ("send \n");
      fona.TCPclose();
      pc.printf ("close \n");
      }
  </code></pre>
  
  <p>Edit: I was running the code and noticed that after fixing the above issue, the code would get stuck TCPSend function, specifically right before 
      packet[0] = 0;
  which is shown down here:</p>
  
  <pre><code>bool Adafruit_FONA_3G::TCPsend(char *packet)
  {
      if (strlen(packet) &gt; 0) {
          mySerial.printf("%s", packet);
          //mySerial.printf("%s\r\n", packet);
  
          readline();
  
          packet[0] = 0;
  
          return true;
      } else return false;
  }
  </code></pre>
  
  <p>When commenting out the line, the code would run all the way through. I am still in the process of testing to see if the code still functions as intended, but my question is what exactly is the purpose of packet[0] = 0;? </p>