Posting RFID through SIM900A Module

My project is about posting RFID Tag ID using SIM900A module to the server. I have collected few commands for the above-mentioned task, but I am getting empty data. Can anyone please help me out in this issue?

I have attached my code here and the respective snapshots.

#include <SPI.h>
#include <MFRC522.h>
#include <SoftwareSerial.h>

#define RST_PIN         9          // Configurable, see typical pin layout above
#define SS_PIN          10         // Configurable, see typical pin layout above
SoftwareSerial mySerial(7, 8);
String data;

MFRC522 mfrc522(SS_PIN, RST_PIN);  // Create MFRC522 instance

void setup() {
    mySerial.begin(9600);
    Serial.begin(9600);     // Initialize serial communications with the PC
    while (!Serial);        // Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4)
    SPI.begin();            // Init SPI bus
    mfrc522.PCD_Init();     // Init MFRC522

    //mfrc522.PCD_DumpVersionToSerial();    // Show details of PCD - MFRC522 Card Reader details
    //Serial.println(F("Scan PICC to see UID, SAK, type, and data blocks..."));
}

void loop() {
    // Look for new cards
  String code = "";
    if ( ! mfrc522.PICC_IsNewCardPresent()) {
        return;
    }
    // Select one of the cards
    if ( ! mfrc522.PICC_ReadCardSerial()) {
        return;
    }
  for (byte i = 0; i < mfrc522.uid.size; i++) {
      code += String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" :" ");
      code += String(mfrc522.uid.uidByte[i], HEX);
  }
  code.toUpperCase();
  Serial.println(code);
  mfrc522.PICC_HaltA();


 if (mySerial.available())
    Serial.write(mySerial.read());
  
  int num;
  String le;
  String data;
//  String tag_id;
//   data="tag_id = "+ String(result);
  data="tag_id"+ code;

//  Serial.println("HI : " +data);
// tag_id = "{\"tag_id\":"+ result + "}";
  num=data.length();
//  num=tag_id.length();
  le=String(num);
  
  mySerial.println(data);
  delay(100);
  ShowSerialData(); 
  mySerial.println("AT+CGATT?");                                                   //this is better made repeatedly because it is unstable
  delay(2000);
  ShowSerialData();
//  mySerial.println("AT+CSTT=\"www\",\"\",\"\"");                                    //start task and set the APN
//  delay(1000);
//  ShowSerialData();
//  mySerial.println("AT+CIICR");                                                      //bring up wireless connection
//  delay(3000);
//  ShowSerialData();
//  mySerial.println("AT+CIFSR");                                                      //get local IP adress
//  delay(2000);
//  ShowSerialData();
  mySerial.println("AT+CIPSRIP?");
  delay(3000);
  ShowSerialData();
  mySerial.println("AT+CIPSPRT=0");
  delay(3000);
  ShowSerialData();
  mySerial.println("AT+CIPSTART=\"TCP\",\"49.207.183.202\",\"6006\"");             //start up connection
  mySerial.println(data);
  delay(3000);
  ShowSerialData();
  mySerial.println("AT+CIPSEND");//begin sendiing data to the remote server
  delay(5000);
  ShowSerialData();
  mySerial.print("POST http://49.207.183.202:6006/esp_dht/rest/rfid_insert HTTP/1.1\n");
  //mySerial.println(data);
  delay(100);
  //ShowSerialData();
  //delay(100);
  ShowSerialData(); 
//  mySerial.println("tag_id = " + String(result));
//  delay(100);
//  ShowSerialData(); 
  mySerial.println("Content-Type: application/json");
  delay(100);
  ShowSerialData();
  mySerial.println("Content-Length: "+le);
  delay(100);
  ShowSerialData();
  mySerial.println("Host:49.207.183.202");
  delay(100);
  ShowSerialData();
  mySerial.println();
  delay(100);
  ShowSerialData();
  mySerial.println(data);
  delay(100);
  ShowSerialData();
  mySerial.println();
  delay(100);
  ShowSerialData();
  mySerial.println((char)26);
  delay(9000);
  mySerial.println();
  ShowSerialData();
  mySerial.println("AT+CIPCLOSE");                                                //close communication
  delay(1000);
  ShowSerialData();

}

void ShowSerialData()
{
  while(mySerial.available()!=0)
  Serial.write(mySerial.read());
}

![](http://C:\Users\ACER\Desktop\GSMGPRS\Serial Monitor)

![](http://C:\Users\ACER\Desktop\GSMGPRS\GSMGPRS Table Structure)

I have tried with different set of AT commands, and I got the response for some commands as Error. Can anyone please help me out in this?

mySerial.println("AT");                                                   //this is better made repeatedly because it is unstable
  delay(300);
  ShowSerialData();

  mySerial.println("AT+CREG?");                                                   //this is better made repeatedly because it is unstable
  delay(300);
  ShowSerialData();
  
  mySerial.println("AT+CGATT?");                                                   //this is better made repeatedly because it is unstable
  delay(300);
  ShowSerialData();

  mySerial.println("AT+CIPSHUT");                                                   //this is better made repeatedly because it is unstable
  delay(300);
  ShowSerialData();

  mySerial.println("AT+CIPSTATUS");
  delay(300);
  ShowSerialData();

  mySerial.println("AT+CIPMUX=0");
  delay(300);
  ShowSerialData();

  mySerial.println("AT+CSTT=\"www\",\"web\",\"web\"");
  delay(300);
  ShowSerialData();

  //mySerial.println("AT+CSTT");
  //delay(300);
  //ShowSerialData();

  mySerial.println("AT+CIICR");
  delay(300);
  ShowSerialData();

  mySerial.println("AT+CIFSR");
  delay(300);
  ShowSerialData();
  
  mySerial.println("AT+SAPBR=3,1,\"APN\",\"www\"");
  delay(1000);
  ShowSerialData();
  
  mySerial.println("AT+CIPSPRT=0");  
  delay(3000);
  ShowSerialData();
  
  mySerial.println("AT+CIPSTART=\"TCP\",\"49.207.183.202\",\"6006\"");             //start up connection
  delay(2000);
  ShowSerialData();
  Serial.println();
  
  mySerial.println("AT+CIPSEND");             //start up connection
  delay(3000);
  ShowSerialData();
  
  mySerial.print("POST /esp_dht/rest/rfid_insert?");
  delay(100);
  ShowSerialData();
   
  mySerial.println("tag_id =");
  mySerial.println(code);
  delay(100);
  ShowSerialData(); 
  
  mySerial.println("HTTP/1.1\r\n");
  delay(500);
  ShowSerialData();
  
  mySerial.println("Host: 49.207.183.202\r\n");
  delay(500);
  ShowSerialData();
  
  mySerial.println("Connection: close");
  mySerial.println("\r\n");
  mySerial.println("\r\n");
  delay(500);
  ShowSerialData();
  
  //mySerial.println(0x1A,BYTE);
  //delay(500);
  //mySerial.println();
  //ShowSerialData();
  
  mySerial.println("AT+CIPCLOSE");
  delay(100);
  ShowSerialData();
  
  mySerial.println("AT+CIPSHUT=0");                                                //close communication
  delay(100);
  ShowSerialData();

Serial Monitor Response :-

36 2A 80 50
tag_id 36 2A 80 50
AT

OK
AT+CREG?

+CREG: 0,1

OK
AT+CGATT?

+CGATT: 1

OK
AT+CIPSHUT

SHUT OK
AT+CIPSTATUS

OK

STATE: IP INITIAL
AT+CIPMUX=0

OK
AT+CSTT="www","web","web"

OK
AT+CIICR

OK
AT+CIPSPRT=0

OK
AT+CIPSTART="TCP","49.207.183.202","6006"

ERROR

AT+CIPSEND

ERROR
POST /esp_dht/rest/rfid_insert?tag_id =
36 2A 80 50
HTTP/1.1Host: 49.207.183.202

Connection: close