Cayenne server connection problem


#1

hi friends,
I’m working ultrasonic data post with my cayenne dashboard in web browser using nodemcu12E Arduino library last 3 days my device not connecting to my cayenne dashboard mostly comes this Network connection problem in my device
[718830] MQTT connect failed, error -1
[750286] MQTT connect failed, error -1
[781828] MQTT connect failed, error -1
[813249] MQTT connect failed, error -1

so please help me how i fixed this bugs


#2

yes there is a bug with cayenne MQTT and will be fixed soon.


#3

thanks for replay,
now cayenne connected. but my data didn’t store in my dashboard, chart not working show only No data available for this period.


#4

try this Should I be able to use multiple widgets on a single channel?


#5

but i only use 1 sensor value upload with 1 channel chart only show no data like this

please help how i fix this bugs


#6

try deleting and re adding the widget. also can you share the code.


#7
  • Agree :
  • Also try to change channel number of your Temperature sensor !

#8

I deleting and adding new widget multiple times also change channel numbers the data is change but previous value doesn’t store in my dashboard.

now again come Network connection failed problem

this is my code

#define CAYENNE_DEBUG
#define CAYENNE_PRINT Serial
#include <CayenneMQTTESP8266.h>
float Temperature=0;
float Humidity=0;
#include <Wire.h>
#include “ClosedCube_HDC1080.h”

ClosedCube_HDC1080 hdc1080;

char ssid[] = “xxxxx”;
char wifiPassword[] = “yyyyyyy”;

void setup()
{
Serial.begin(9600);
Serial.println(“ClosedCube HDC1080 Arduino Test”);
hdc1080.begin(0x40);
Cayenne.begin(username, password, clientID, ssid, wifiPassword);
}

void loop()
{
Serial.print(“T=”);
Temperature=hdc1080.readTemperature();
Serial.print(Temperature);
Serial.print(“C, RH=”);
Humidity=hdc1080.readHumidity();
Serial.print(Humidity);
Serial.println("%");
delay(1000);
Cayenne.virtualWrite(V1, Temperature);
Cayenne.virtualWrite(V2, Humidity);
Cayenne.loop();
}

please help me to solve this problem


#9

Hi,

Did you click the plus sign when adding the widget? Also, dont post your MQTT credentials on the forums.


#10

change this

to

  unsigned long lastMillis = 0;
  if (millis() - lastMillis > 10000) {
    lastMillis = millis();
Cayenne.virtualWrite(V1, Temperature);

Cayenne.virtualWrite(V2, Humidity);
  }

#11

again come network connection problem. am missing any function for network connectivity???

[211099] Network connect failed
[219123] Network connect failed
[227123] Network connect failed


#12

did you try the above code? can you post the entire code you are using.


#13

it’s pehaps a wifi connection failed instead of “Cayenne Failed” ?
Add this somewhere in LOOP :

  int i = 0;
  while (WiFi.status() != WL_CONNECTED && i < 50) {
    delay(500);
    i++;
    Serial.print(".");
  }
  if (WiFi.status() != WL_CONNECTED) {
    Serial.println("WiFi Connection failed, restart");// echoué = reset
    WiFi.disconnect();
    ESP.restart();
  }

#14

#define CAYENNE_DEBUG
#define CAYENNE_PRINT Serial
#include <CayenneMQTTESP8266.h>
float Temperature=0;
float Humidity=0;
#include <Wire.h>
#include “ClosedCube_HDC1080.h”

ClosedCube_HDC1080 hdc1080;

char ssid[] = “xxxxx”;
char wifiPassword[] = “yyyyyyy”;

void setup()
{
Serial.begin(9600);
Serial.println(“ClosedCube HDC1080 Arduino Test”);
hdc1080.begin(0x40);
int i = 0;
while (WiFi.status() != WL_CONNECTED && i < 50) {
delay(500);
i++;
Serial.print(".");
}
if (WiFi.status() != WL_CONNECTED) {
Serial.println(“WiFi Connection failed, restart”);// echoué = reset
WiFi.disconnect();
ESP.restart();
}
Cayenne.begin(username, password, clientID);
}

void loop()
{
Serial.print(“T=”);
Temperature=hdc1080.readTemperature();
Serial.print(Temperature);
Serial.print(“C, RH=”);
Humidity=hdc1080.readHumidity();
Serial.print(Humidity);
Serial.println("%");
unsigned long lastMillis = 0;
if (millis() - lastMillis > 10000) {
lastMillis = millis();
Cayenne.virtualWrite(V1, Temperature);

Cayenne.virtualWrite(V2, Humidity);
}
}
some times server connected data show Value Display Widget, but chart not updating current data with previous days .

most of Cayenne server disconnected
[340006] Network connect failed
[348131] Network connect failed
[356180] Network connect failed

this error mostly come


#15

this is mostly because of the error with wifi connection. can you try connecting to another wifi if you have or to your mobile hotspot.