[SOLVED] Need assitance to get the sensor readings into ubidots

I need assitance to get the sensor readings into ubidots using ARDUINO AND ESP8266.(for example sending ir sensor data to ubidots ).i used this code it is not working


#define TOKEN  "******"
#define ID_1  "********"  // Put here your Ubidots variable ID
#define ID_2  "*********"  // Put here your Ubidots variable ID
#define ID_3  "*********"
#define WIFISSID "********"
#define PASSWORD "******"

 Ubidots client(TOKEN);
 
#include <SoftwareSerial.h>
#include "DHT.h"
#define DHTPIN 5     
#define DHTTYPE DHT11
     
DHT dht(DHTPIN, DHTTYPE);
int irpin=5;
int enter=0;

void setup(){
    Serial.begin(115200);
    delay(10);
    client.wifiConnection(WIFISSID, PASSWORD);
    
    Serial.begin(9600);
    Serial.begin(9600);
    
    dht.begin();
    pinMode(irpin,INPUT);
  
}
void loop(){
      float value1 = dht.readHumidity();
      Serial.println(value1);
    
     float value2 = dht.readTemperature();
     Serial.println(value2);


    
    // int h = dht.readHumidity();
    // delay(1000);
    // Read temperature as Celsius (the default)
   //int t = dht.readTemperature();
   // delay(1000);

  int c,i,count=0,rpm,v;
  for(i=0;i<=1000;++i)
  {
    c=analogRead(irpin);
    if(c<400)
    {
      enter=1;
      }
      if ( (c>400)&& (c>v)&& (enter==1))
      {
        count++;
        enter=0;
        }
        delay(1);
        v=0;
        }
   
  
    rpm=count*53.5;

  Serial.println(rpm);


   
 
  
    
    client.add(ID_1,value1);
    client.add(ID_2,value2);
    client.add(ID_3, rpm);
    client.sendAll(false);
  delay(5000);  
}

Hello @nitin,

At the moment we doesn’t support the Arduino+ESP8266, we’re working on a new version of the library. So, please reference to the following article:

This guide will help you to send data to Ubidots from the ESP8266 without any issue.

To be able to get the reading from the sensor you have to read the GPIO0 or GPIO2 of the ESP module. If you want to be able to get the sensor reading you have to connect the sensor to the ESP8266 pins, please references to the pinout of it.

Take in count that the article provided before is to send data from the ESP to Ubidots, not from the Arduino. The Arduino is used just to program the ESP module.

Regards!