[SOLVED] Five of my six variables are working fine, one is not - Ardino Yun

Hi, I can’t figure out why the variable “Count” is not getting updated. All the other ones are received fine on my Ubidots dashboard. Is this a limitation on the payload that I can send to Ubidots? any ideas? thanks!

Here is my code:

#include <UbidotsYUN.h>
#include <DHT.h>
#define TOKEN "x8KfAtJF"


//DHT11 stuff
#define DHTTYPE DHT11
#define DHT11_PIN 4
#define VIRTUAL_TEMP V2
#define VIRTUAL_HUM V1
DHT dht(DHT11_PIN, DHTTYPE);
Ubidots client(TOKEN);
float counter=1;


void setup() {
  client.init();
  Serial.begin(9600);
  dht.begin();  
}

void loop() {
  float pared = analogRead(A1);
  float calentador = analogRead(A2);
  float techo = analogRead(A3);
  float h = dht.readHumidity();
  float t = dht.readTemperature();
  float f = dht.readTemperature(true);
  client.add("Pared", pared);
  client.add("Calentador", calentador);
  client.add("Techo", techo);
  client.add("Humedad", h);
  client.add("Temperatura", f);
  client.add("Count", counter);
  client.sendAll(); 
  delay(15000);
  counter++;
}

Hello @roquito.
Yeah you are right, there are a limitation to send 5 variables each time in the library, but you can call another time the add function between sendAll function as the next example:

  client.add("Pared", pared);
  client.add("Calentador", calentador);
  client.add("Techo", techo);
  client.add("Humedad", h);
  client.add("Temperatura", f);
  client.sendAll();
  client.add("Count", counter);
  client.sendAll(); 

Best regards,
Metavix

1 Like

Thanks a lot. It worked.

No problem you are welcome.

Best regards,
Metavix