data sensor can't send to thingsboard

void loop() {
 status = WiFi.status();
  if ( status != WL_CONNECTED) {
    while ( status != WL_CONNECTED) {
      Serial.print("Attempting to connect to WPA SSID: ");
      Serial.println(WIFI_AP);
      // Connect to WPA/WPA2 network
      status = WiFi.begin(WIFI_AP, WIFI_PASSWORD);
      delay(500);
    }
    Serial.println("Connected to AP");
  }

  //if ( !client.connected() ) {
  //  reconnect();
//  }

  if ( millis() - lastSend > 2000 ) { // Update and send only after 1 seconds
    getAndSendGreenbuildingData();
    lastSend = millis();
  }

  client.loop();
}

void getAndSendGreenbuildingData()
{
  Serial.println("Collecting temperature data.");

  // Reading temperature or humidity takes about 250 milliseconds!
 int t2 = dht2.readTemperature();
  // Read temperature as Celsius (the default)
 int t3 = dht3.readTemperature();
 

  float moisture3_percentage;
  int s3;
  s3 = analogRead(MoistureIn3);
  moisture3_percentage = ( 100 - ( (s3/1023.00) * 100 ) );

  float moisture2_percentage;
  int s2;
  s2 = analogRead(MoistureIn2);
  moisture2_percentage = ( 100 - ( (s2/1023.00) * 100 ) );

  // Check if any reads failed and exit early (to try again).
  if (isnan(t3) || isnan(t2)|| isnan(s3)|| isnan(s2)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }

 // Serial.print("Temperature: ");
 // Serial.print(t2);
 // Serial.print(" *C");
  //Serial.print("Temperature: ");
 // Serial.print(t3);
 // Serial.print(" *C ");

  //String temperature3 = String(t3);
 // String temperature2 = String(t2);
  String SoilMoisture3 = String(moisture3_percentage);
  String SoilMoisture2 = String(moisture2_percentage);

  // Just debug messages
  Serial.print( "Sending temperature and humidity : [" );
 // Serial.print( temperature3 ); Serial.print( "," );
 // Serial.print( temperature2 ); Serial.print( "," );
  Serial.print( SoilMoisture3 ); Serial.print( "," );
  Serial.print( SoilMoisture2 ); Serial.print( "," );
  Serial.print( "]   -> " );

  // Prepare a JSON payload string
  String payload = "{";
  //payload += "\"temperature3\":"; payload += temperature3; payload += ",";
  //payload += "\"temperature2\":"; payload += temperature2;
  payload += "\"SoilMoisture3\":"; payload += SoilMoisture3; payload += ",";
  payload += "\"SoilMoisture2\":"; payload += SoilMoisture2; payload += ",";
  payload += "}";

  // Send payload
  char attributes[1000];
  payload.toCharArray( attributes, 1000 );
  client.publish( "v1/devices/me/attributes", attributes );
  Serial.println( attributes );
}

hello guys i have some problem in my program.. i want try send 2 data soil moisture to platform thingsboard. data can read in serial monitor but not send to thingboard. if i try sending 2 data temperature it can send.
can anyone explain my problem?? thanks

Can you post all your code.

#include <DHT.h>

#include <LiquidCrystal_I2C.h>
#include <WiFiEspClient.h>
#include <WiFiEsp.h>
#include <WiFiEspUdp.h>
#include <PubSubClient.h>
#include <SoftwareSerial.h>
#include <Servo.h> 
//#include <DS3231.h>
#include <Stepper.h>
#include <FuzzyRule.h>
#include <FuzzyComposition.h>
#include <Fuzzy.h>
#include <FuzzyRuleConsequent.h>
#include <FuzzyOutput.h>
#include <FuzzyInput.h>
#include <FuzzyIO.h>
#include <FuzzySet.h>
#include <FuzzyRuleAntecedent.h>

String Lampu3;
String Lampu2;
String Pompa3;
String Pompa2;
String Spray3;
String Spray2;

#define WIFI_AP "ICE2015"
#define WIFI_PASSWORD "ikibersamadijalanmentengnomorduabelas"

#define TOKEN "BnvbupDtpsqvGZ6IKGlm"
 //moisture sensor
const int MoistureIn2 = A0; // Analog input pin that the Sensor is attached to
const int MoistureIn3 = A3; // Analog input pin that the Sensor is attached to
int sensorValue = 0; // value read from the Soil Moisture 

//Stepper
int Atap;
int direction;
const int stepsPerRevolution = 50000;
Stepper myStepper(Atap, 8, 9);

//DHT
#define DHT3PIN A2     // what digital pin we're connected to
#define DHT3TYPE DHT11   // DHT 11
DHT dht3(DHT3PIN, DHT3TYPE);

#define DHT2PIN A5     // what digital pin we're connected to
#define DHT2TYPE DHT11   // DHT 11
DHT dht2(DHT2PIN, DHT2TYPE);

//RELAY
#define RELAYL3  23 //Lampu 3
#define RELAYM3  7 //Motor DC 3
#define RELAYP3  5 //PUMP3
#define RELAYL2  22 //Lampu 2
#define RELAYM2  6  //Motor DC 2
#define RELAYP2  11 //PUMP2

char thingsboardServer[] = "demo.thingsboard.io";


// Initialize the Ethernet client object
WiFiEspClient espClient;

PubSubClient client(espClient);

SoftwareSerial soft(12, 13); // RX, TX

int status = WL_IDLE_STATUS;
unsigned long lastSend;

int OutAtap = 0;




//LCD
LiquidCrystal_I2C lcd3(0x27, 20,4); 
LiquidCrystal_I2C lcd2(0x3F, 20,4);

//SYMBOL
byte Thermometer[8]={B00100, B01010, B01010, B01110, B01110, B11111, B11111, B01110};
byte WaterDrop[8] ={B00100, B00100, B01010, B01010, B10001, B10001, B10001,B01110};
byte Fan[8] = {B10011, B10100, B01110, B00101, B11001, B00000, B00100, B01110};
byte Lamp[8] = {B01110, B10001, B10001, B10001, B01010, B01010, B00100, B01110};
byte Pump[8] = {B00000, B01110, B01010, B01110, B01000, B01000, B01000, B00000};  // [3] Pump Symbol

//DS3231 RTC
//DS3231  rtc(SDA, SCL);

//SERVO
Servo Servo3; 
Servo Servo2; 

//FUZZY
Fuzzy* fuzzy = new Fuzzy();

FuzzySet* dingin = new FuzzySet(0, 0, 15, 20);
FuzzySet* sejuk = new FuzzySet(15, 25, 35, 40);
FuzzySet* normal = new FuzzySet(35, 45, 55, 60);
FuzzySet* hangat = new FuzzySet(55, 65, 75, 80);
FuzzySet* panas = new FuzzySet(75, 85, 100, 100);

FuzzySet* kering = new FuzzySet(0, 0, 15, 20);
FuzzySet* semi = new FuzzySet(15, 25, 35, 40);
FuzzySet* good = new FuzzySet(35, 45, 55, 60);
FuzzySet* great = new FuzzySet(55, 65, 75, 80);
FuzzySet* lembab = new FuzzySet(75, 85, 100, 100);
void setup() {
  // initialize serial for debugging
  Serial.begin(9600);
  dht.begin();
  InitWiFi();
  client.setServer( thingsboardServer, 1883 );
  lastSend = 0;
//konektivitas kethingsboard===========================//
status = WiFi.status();
  if ( status != WL_CONNECTED) {
    while ( status != WL_CONNECTED) {
      Serial.print("Attempting to connect to WPA SSID: ");
      Serial.println(WIFI_AP);
      // Connect to WPA/WPA2 network
      status = WiFi.begin(WIFI_AP, WIFI_PASSWORD);
      delay(500);
    }
   Serial.println("Connected to AP");
  }
 if ( !client.connected() ) {
    reconnect();
  }

  if ( millis() - lastSend > 1000 ) { // Update and send only after 1 seconds
    getAndSendGreenbuildingData();
    lastSend = millis();
  }

  client.loop();
}    

void getAndSendGreenbuildingData()
{
  Serial.println("Collecting data.");

 
  // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
  int t3 = dht3.readTemperature();
  int s3 = analogRead(MoistureIn3);
  s3 = map(s3,550,10,0,100);
  int t2 = dht2.readTemperature();
  int s2 = analogRead(MoistureIn2);
  s2 = map(s2,550,10,0,100);



 //lantai 2
// Serial.println("-----------------------------------");
 //Serial.println(" -Lantai 2- ");
 // Serial.print("Temperature: ");
//  Serial.print(t2);
 //Serial.print(" C ");
 
  
// set the cursor to (0,0):
  lcd2.setCursor(2, 0);
  lcd2.print("T");
  lcd2.print(char(1));
  lcd2.print(": ");
  lcd2.print(t2);
  lcd2.print((char)223);
  lcd2.print("C");
  

 if(t2>=28){
  //Serial.println("HighTemp");
  digitalWrite(RELAYM2,0);          // Turns Motor DC 2 On
  //Serial.println("Motor DC2: ON");
  Servo2.attach(2); 
  Servo2.write(0);
  delay(500); 
  Servo2.write(90); 
  delay(500); 
  lcd2.setCursor(0,1);
  lcd2.print(char(3));
  lcd2.print(": ON ");}
  
  else {
  //Serial.println("LowTemp");
  digitalWrite(RELAYM2,1);          // Turns Motor DC 2 Off
 // Serial.println("Motor DC2: OFF");
  Servo2.detach(); 
  lcd2.setCursor(0,1);
  lcd2.print(char(3));
  lcd2.print(": OFF");}
 
  if(t2<=26){
  //Serial.println("LowTemp");
  digitalWrite(RELAYL2,0);          // Turns Lampu 2 On
 // Serial.println("Light ON");
  lcd2.setCursor(8,1);
  lcd2.print(char(4));
  lcd2.print(": ON ");}
                                      
  else {
 // Serial.println("HighTemp");
  digitalWrite(RELAYL2,1);          // Turns Lampu 2 Off
 // Serial.println("Light OFF");
  lcd2.setCursor(8,1);
  lcd2.print(char(4));
  lcd2.print(": OFF");} 

 //Serial.print("Humidity: ");
//Serial.print(s2);
//Serial.println("%");

  lcd2.setCursor(12,0);
  lcd2.print("S");
  lcd2.print(char(2));
  lcd2.print(":");
  lcd2.print(s2);
  lcd2.print("%");
  
  if(s2<=65){
  //Serial.println("Dry");
  digitalWrite(RELAYP2,0);          // Turns Pump 2 On
 // Serial.println("Pump: ON");

  lcd2.setCursor(14,1);
  lcd2.print(char(5));
  lcd2.print(": ON ");}

  
  else {
  //Serial.println("High Moisture");
  digitalWrite(RELAYP2,1);          // Turns Pump 2 Off
 // Serial.println("Pump: OFF");
    
  lcd2.print(char(5));
  lcd2.print(": OFF");}

 //lantai 3
// Serial.println(" -Lantai 3- ");
 //Serial.print("Temperature: ");
// Serial.print(t3);
// Serial.print(" C ");
  
   // set the cursor to (0,0):
  lcd3.setCursor(2, 0);
  lcd3.print("T");
  lcd3.print(char(1));
  lcd3.print(": ");
  lcd3.print(t3);
  lcd3.print((char)223);
  lcd3.print("C");
  
//set point 28
  if(t3>=29){
//  Serial.println("HighTemp");
  digitalWrite(RELAYM3,0);          // Turns Motor DC 3 On
//  Serial.println("Motor DC3: ON");
  Servo3.attach(3); 
  Servo3.write(0);
  delay(500); 
  Servo3.write(90); 
  delay(500); 
  lcd3.setCursor(0,1);
  lcd3.print(char(3));
  lcd3.print(": ON ");}

  
  else {
  //Serial.println("LowTemp");
  digitalWrite(RELAYM3,1);          // Turns Motor DC 3 Off
  //Serial.println("Motor DC3: OFF");
  Servo3.detach(); 
  lcd3.setCursor(0,1);
  lcd3.print(char(3));
  lcd3.print(": OFF");}


  if(t3<=27){
 // Serial.println("LowTemp");
  digitalWrite(RELAYL3,0);          // Turns Lampu 3 On
  //Serial.println("Light ON");
  lcd3.setCursor(8,1);
  lcd3.print(char(4));
  lcd3.print(": ON ");}  
                                                           
  else {
 // Serial.println("HighTemp");
  digitalWrite(RELAYL3,1);          // Turns Lampu 3 Off
 // Serial.println("Light OFF");
  lcd3.setCursor(8,1);
  lcd3.print(char(4));
  lcd3.print(": OFF");}  

//Serial.print("Soil: ");
//  Serial.print(s3);
// Serial.println("%");

  lcd3.setCursor(12,0);
  lcd3.print("S");
  lcd3.print(char(2));
  lcd3.print(":");
  lcd3.print(s3);
  lcd3.print("%");


if(s3<=65){
  //Serial.println("Dry");
  digitalWrite(RELAYP3,0);          // Turns Pump 3 On
 // Serial.println("Pump: ON");

  lcd3.setCursor(14,1);
  lcd3.print(char(5));
  lcd3.print(": ON ");}

  
  else {
 // Serial.println("High Moisture");
  digitalWrite(RELAYP3,1);           // Turns Pump3 Off
 // Serial.println("Pump: OFF");
    
  lcd3.print(char(5));
  lcd3.print(": OFF");}

   //PROSES PENGIRIMAN DATA ON-OFF=============================//

int L3 = digitalRead(23);
int L2 = digitalRead(22);
int P3 = digitalRead(5);
int P2 = digitalRead(11);
int M3 = digitalRead(7);
int M2 = digitalRead(6);

if (L3==0) {
  Lampu3="OFF";
 
}
else {
  Lampu3="ON";
  }

 
if (L2==0) {
  Lampu2="OFF";
 
}
else {
  Lampu2="ON";
  }


if (P3==0) {
  Pompa3="OFF";
 
}
else {
  Pompa3="ON";
  }

  
if (P2==0) {
  Pompa2="OFF";
 
}
else {
  Pompa2="ON";
  }

  
if (M3==0) {
  Spray3="OFF";
 
}
else {
  Spray3="ON";
  }

  
if (M2==0) {
  Spray2="OFF";
 
}
else {
  Spray2="ON";
  }

//=========================================================//
//             OUTPUT MOTOR STEPPER (ATAP)                //
//=======================================================//

  //Serial.print("Steps = ");
 // Serial.println(Atap);
  myStepper.step(Atap);
  delayMicroseconds(1000);
  
   myStepper.step(-Atap);
   delayMicroseconds(1000);

  

//================================================================
  // Check if any reads failed and exit early (to try again).
  if (isnan(t3) || isnan(t2) || isnan(s3) || isnan(s2) || isnan(output1)) {
    Serial.println("Failed to read sensor!");
    return;
}
//ubah ke data sensor string======================
String temperature3 = String(t3);
String temperature2 = String(t2);
String SoilMoisture3 = String(s3);
String SoilMoisture2 = String(s2);
char buffer[5];
String BukaanAtap = dtostrf(output1, 1, 4, buffer);
//pesan pengiriman data================

  Serial.print( "Sending  Data : [" );
  Serial.print( temperature3 ); Serial.print( "," );
  Serial.print( temperature2 ); Serial.print( "," );
  Serial.print( SoilMoisture3 ); Serial.print( "," );
  Serial.print( SoilMoisture2 ); Serial.print( "," );
  Serial.print( Lampu3 ); Serial.print( "," );
  Serial.print( Lampu2 ); Serial.print( "," );
  Serial.print( Pompa3 ); Serial.print( "," );
  Serial.print( Pompa2 ); Serial.print( "," );
  Serial.print( Spray3 ); Serial.print( "," );
  Serial.print( BukaanAtap ); Serial.print( "," );
  Serial.print( Spray2 );
  Serial.print( "]   -> " );

  
  // Prepare a JSON payload string
  String payload = "{";
  payload += "\"Temperature3\":"; payload += temperature3; payload += ",";
  payload += "\"Temperature2\":"; payload += temperature2; payload += ",";
  payload += "\"SoilMoisture3\":"; payload += SoilMoisture3; payload += ",";
  payload += "\"SoilMoisture2\":"; payload += SoilMoisture2; payload += ",";
 payload += "}";

  // Send payload
  char attributes[1000];
  payload.toCharArray( attributes, 1000 );
  client.publish( "v1/devices/me/attributes", attributes );
  Serial.println( attributes );
}

void InitWiFi()
{
  // initialize serial for ESP module
  soft.begin(9600);
  // initialize ESP module
  WiFi.init(&soft);
  // check for the presence of the shield
  if (WiFi.status() == WL_NO_SHIELD) {
    Serial.println("WiFi shield not present");
    // don't continue
    while (true);
  }

  Serial.println("Connecting to AP ...");
  // attempt to connect to WiFi network
  while ( status != WL_CONNECTED) {
    Serial.print("Attempting to connect to WPA SSID: ");
    Serial.println(WIFI_AP);
    // Connect to WPA/WPA2 network
    status = WiFi.begin(WIFI_AP, WIFI_PASSWORD);
    delay(2000);
  }
  Serial.println("Connected to AP");
}

void reconnect() {
  // Loop until we're reconnected
  while (!client.connected()) {
    Serial.print("Connecting to ThingsBoard node ...");
    // Attempt to connect (clientId, username, password)
    if ( client.connect("Arduino Uno Device", TOKEN, NULL) ) {
      Serial.println( "[DONE]" );
    } else {
      Serial.print( "[FAILED] [ rc = " );
      Serial.print( client.state() );
      Serial.println( " : retrying in 5 seconds]" );
      // Wait 5 seconds before retrying
      delay( 5000 );
    }
  }
}

thats all code. i want to send parameters from my project to thingsboard. i try send temperature data it can send, but while i try send soil data it cant send