Graphs are not working as expected. No data available

can you join slack http://slack.mydevices.com/ and PM me whenever this occur so i can look into it.

2 Likes

Guys, sorry to jump on this topic but looks a similar problem. My temperature max range is locked in 20ĀŗC so I canā€™t see anything on the graph.

Please see below:

History_92d19110-91a1-11e8-b389-d93e10e08451_ecb531a0-91a1-11e8-af94-07170ec969cc_hour_2018-08-14-23_52_00_2018-08-17 11_52_00.csv (9.3 KB)

you should see a straight blue line if you the change is not much. can you share the code you are using?

Hello Shramik, if you see the csv file the data are there. You should look for Thermistor function:

#include <CayenneTemperature.h>
#include <CayenneMQTTEthernet.h>  
#include "DHT.h"

char username[] = "";
char password[] = "";
char clientID[] = "";

#define CAYENNE_DEBUG 
#define CAYENNE_PRINT Serial
#define SENSOR_PIN 0
#define VIRTUAL_THERMISTOR 1
#define VIRTUAL_DHT11_TEMP 2
#define VIRTUAL_DHT11_HUM 3
#define VALVE 4
#define VIRTUAL_VALVE 4
#define DHTPIN 5
#define DHTTYPE DHT11   // DHT 22  (AM2302), AM2321
#define GARAGE 6
#define VIRTUAL_GARAGE 6
#define QUARTINHO 7
#define VIRTUAL_QUARTINHO 7

const float resistance = 2200; // Resistance of the resistor 

DHT dht(DHTPIN, DHTTYPE);
Thermistor thermistor(SENSOR_PIN, resistance);

void setup()
{
	Serial.begin(9600);
	Cayenne.begin(username, password, clientID);
  dht.begin();
  pinMode(VALVE,OUTPUT);
  pinMode(GARAGE,OUTPUT);
  pinMode(QUARTINHO,OUTPUT);
  
}

void loop()
{
	Cayenne.loop();


}

 CAYENNE_IN(VIRTUAL_VALVE)

{
  int value = getValue.asInt();
  CAYENNE_LOG("Channel %d, pin %d, value %d", VIRTUAL_VALVE, VALVE, value);
  // Write the value received to the digital pin.
  digitalWrite(VALVE, value);
}


CAYENNE_IN(VIRTUAL_GARAGE)
{

  if (getValue.asInt() == 0) {
    digitalWrite(GARAGE, HIGH);
  }
  else {
    digitalWrite(GARAGE, LOW);
  }
}


CAYENNE_IN(VIRTUAL_QUARTINHO)
{

  if (getValue.asInt() == 0) {
    digitalWrite(QUARTINHO, HIGH);
  }
  else {
    digitalWrite(QUARTINHO, LOW);
  }
}


CAYENNE_OUT(VIRTUAL_THERMISTOR)
{

	Cayenne.celsiusWrite(VIRTUAL_THERMISTOR, thermistor.getCelsius());
}


CAYENNE_OUT(VIRTUAL_DHT11_TEMP)
{
  float t = dht.readTemperature();
  Cayenne.celsiusWrite(VIRTUAL_DHT11_TEMP, t);
}

CAYENNE_OUT(VIRTUAL_DHT11_HUM)
{
  float h = dht.readHumidity();
  Cayenne.virtualWrite(VIRTUAL_DHT11_HUM, h);
}

i tried your code and it works well. i can see data on the graph.
change this

      Cayenne.virtualWrite(VIRTUAL_DHT11_HUM, h);

to

Cayenne.virtualWrite(VIRTUAL_DHT11_HUM, h, "temp", "c" );

Can you check, Iā€™m no C programmer but I see no sleep function.
(Iā€™m python)

What you are saying sounds like you are hitting the rate limited.
If it gives results then stops for a while then gives a blast of results and stop for a while.
That happens when you hit the rate limited.

Just something to check.

CAYENNE_OUT() functions are designed to automatically run at intervals every 15 seconds.

Hello Shramik,

the Cayenne.virtualWrite works fine fot the DHT11 temp and humidity. The problem is with the function Cayenne.celsiusWrite(VIRTUAL_THERMISTOR, thermistor.getCelsius()); that Iā€™m using for the thermistor. This is an analog input nd looks like just a problem with the locked Axis on the dashboard as the data is there on the csv file.

Check your Serial monitor if you are sending correct data to cayenne.

No historical data availabe here.

Rapsberrypi 3 model B
Linux raspberrypi 4.19.58-v7+ #1245 SMP Fri Jul 12 17:25:51 BST 2019 armv7l GNU/Linux

Are looking for historical data of raspberry default widgets like CPU RAM, then they do not store history data.

Please help! I Have the same problem.

.
Here is the code.

//----------------------------------------------------------------------------------------------------------------------------------------------------------------//
//------------------------------------------------------------------LIBRERƍAS UTILIZADAS--------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------------------------------------------------------//

#include <Wire.h>
#include <CayenneMQTTESP8266.h>
#include "RTClib.h"

//----------------------------------------------------------------------------------------------------------------------------------------------------------------//
//-----------------------------------------------------------------------PARƁMETROS ------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------------------------------------------------------//

#define CAYENNE_PRINT Serial
#define nanodir 11
#define longitud 9
#define intervalo 2000

//Informacion de la red Wi-Fi
char ssid[] =  "Nombredelared";
char contrasenawifi[] = "password";

//Informacion de autentificacion con Cayenne
char usuario[] = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
char contrasena[] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
char cliente[] = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";

//contadores y banderas para activar accionadores
unsigned long actual;
unsigned long anterior = 0;
byte envioanterior = 0;
byte envioanterior2 = 0;
byte i;
byte j;
byte envio[longitud + 1];
byte fin;

// Variables de entrada
int canal;
int dato;

//----------------------------------------------------------------------------------------------------------------------------------------------------------------//
//-------------------------------------------------------CONFIGURACIƓN DE PINES Y ESTADOS DE LA PLACA-------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------------------------------------------------------//

void setup() {
  // Inicia la conexion con el Arduino
  Wire.begin();

  // Inicia Serial
  Serial.begin(115200);

  //Inicia la conexion a internet y a la cola de mensajes de Cayenne
  Cayenne.begin(usuario, contrasena, cliente, ssid, contrasenawifi);

  Serial.println("");
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------FUNCION PRINCIPAL--------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------------------------------------------------------//

void loop() {
  Cayenne.loop();
  actual = millis();
  if (actual - anterior > intervalo) {
    anterior = actual;
    recepcion();
  }
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------INTERRUPCION AL RECIBIR DATOS--------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------------------------------------------------------//

void recepcion () {  //desde aqui empieza a recibir el string:
  i = 0;
  Wire.requestFrom(nanodir, longitud); //luego de pedir datos, se queda esperando la respuesta
  while (Wire.available()) {
    Serial.print("Canal ");
    for (i = 0 ; i < longitud ; i++) {
      envio[i] = Wire.read();
      Serial.print(i);
      Serial.print(": ");
      Serial.print(envio[i]);
      if (i < longitud - 1) Serial.print("; Canal ");
    }
    fin = Wire.read();
    Serial.println("");
  }
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------//
//-----------------------------------------------------------RECEPCION Y ENVIO DE DATOS A CAYENNE-----------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------------------------------------------------------//

CAYENNE_OUT_DEFAULT() {
  envioanterior2 = envioanterior;
  envioanterior = envio[0];
  j = 1;
  for (j = 0 ; j < longitud ; j++) {
    Cayenne.virtualWrite(j, envio[j]);
  }
}

CAYENNE_IN_DEFAULT() {
  canal = request.channel;
  dato = getValue.asInt();
  Wire.beginTransmission(nanodir); //inicia el envio de parametros al Arduino
  Wire.write(canal);  //el primer valor enviado es el numero del canal
  Wire.write(dato); //el segundo valor enviado es el dato concreto
  Wire.endTransmission(); //termina el envio de parametros al Arduino
  Serial.print ("Recibido el dato del canal ");
  Serial.print (canal);
  Serial.print (": ");
  Serial.println (dato);
}

First delete all the sensor widgets from your dashboard. you are not using the correct data type.
change this:

to:
Cayenne.virtualWrite(j, envio[j],"temp", "c");

Once, you upload the code, temporary green widgets will be created on your dashboard. Add them by clicking on +.

Thanks, that solved my problem!!

2 Likes