Cayenne refuse the conection?


#1

Hi,
how Could I know that cayyene is refusing my conection and why?
My project was starting good and some minutes later start to lost comunication.
Im using 3 sliders and sending a data about the feeback status of the vaue send as well of the typican sensors, humidity,temperature and luminosity.

I am surfering a very poor experience and I sure that something wrong I am doing because with the old library it was working very good.

Now I’m with arduino and ESP8266-01 as a wifi shield in MQTT.


#2

You may be hitting the rate limit.


#3

How we could know?


#4

You can post your code and we can tell you :slight_smile:


#5

Here is a example of how to only send your data at intervals rather than flooding the connection/server with data. This sends the virtualwrites every 10 seconds.

insert code into your sketch:

unsigned long time4 = 0;  // declare variable

void setup()
{
Cayenne.begin(username, password, clientID, ssid, wifiPassword);
}


void loop()
{
    Cayenne.loop();

	if (millis() - time4 > 10000)  // sends data every 10 sec
	  {
		  Cayenne.virtualWrite(0, 1, "digital_sensor", "d");  // send any data here
		  time4 = millis();  // resets timer
	  }
}