Cayenne dashboard freeze


#1

Hi all

First I’m not write good English or code expert :pensive:

I have little project where is
1 -> Raspberry pi 3 (control arduino and it’s connected lan) and there is Jessie OS
1 -> Arduino Uno (control my sensor etc… connected to Rpi3 with usb-cable)
1 -> USB hub (connected Uno and Rpi3)
6 -> d18s20 temp sensors
2 -> Relays (control water pump and fan)
4 -> Moisture sensors
2 -> water level sensors

Relays, water level sensors and moisture sensors are controlled by Cayenne dashboard. Only code what I have done is temperature sensor code and uptime (see below). Problem is that Cayenne dashboard freezing (after about 1- 10min) when I run cayenne-ser.sh script. Also arduino are freezing and last online status continue running without no control. I have change usb-cables, internet connections, reinstalled Rpi3, arduino codes… etc… I can’t trust that everything works well when I leave my greenhouse. I can do arduino code where everything this works (without cayenne and everything this) but this cayenne dashboard etc… is so good :sunglasses: mobile control etc… I like

if I add more code to my arduino, cayenne dashboard goes online but freeze immediately. If I run only temp sensors code all works fine. Same situation is all other sensors if I run sensors one by one. Everything works fine if I run one by one but if I add evrything in the same code dashboard will freeze. Maybe Uno can’t handle so many sensors but if look forum there is much more difficult system and one arduino :smile: I don’t understand what is wrong. Sorry this code are not full english but I think you can handle that.

#include <CayenneSerial.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#define CAYENNE_PRINT Serial


#define VIRTUAL_PIN1 V1
#define VIRTUAL_PIN2 V2
#define VIRTUAL_PIN3 V3
#define VIRTUAL_PIN4 V4
#define VIRTUAL_PIN5 V5
#define VIRTUAL_PIN6 V6
#define VIRTUAL_PIN13 V13


const int tmpPin1 = 3;

OneWire oneWire1(tmpPin1);
OneWire oneWire2(tmpPin1);
OneWire oneWire3(tmpPin1);
OneWire oneWire4(tmpPin1);
OneWire oneWire5(tmpPin1);
OneWire oneWire6(tmpPin1);

DallasTemperature sensors1(&oneWire1);
DallasTemperature sensors2(&oneWire2);
DallasTemperature sensors3(&oneWire3);
DallasTemperature sensors4(&oneWire4);
DallasTemperature sensors5(&oneWire5);
DallasTemperature sensors6(&oneWire6);


char token[] = "xxxxxx";

void setup()
{

  Serial.begin(9600);
  Cayenne.begin(token);
  sensors1.begin();
  sensors2.begin();
  sensors3.begin();
  sensors4.begin();
  sensors5.begin();
  sensors6.begin();
}

void loop()
{
  Cayenne.run();
   
}

//lämpötila-anturit
CAYENNE_OUT(VIRTUAL_PIN1)
{
sensors1.requestTemperatures();
Cayenne.celsiusWrite(VIRTUAL_PIN1, sensors1.getTempCByIndex(0));

}
CAYENNE_OUT(VIRTUAL_PIN2)
{
sensors2.requestTemperatures();
Cayenne.celsiusWrite(VIRTUAL_PIN2, sensors2.getTempCByIndex(1));
}
CAYENNE_OUT(VIRTUAL_PIN3)
{
sensors3.requestTemperatures();
Cayenne.celsiusWrite(VIRTUAL_PIN3, sensors3.getTempCByIndex(2));
}
CAYENNE_OUT(VIRTUAL_PIN4)
{
sensors4.requestTemperatures();
Cayenne.celsiusWrite(VIRTUAL_PIN4, sensors4.getTempCByIndex(3));
}
CAYENNE_OUT(VIRTUAL_PIN5)
{
sensors5.requestTemperatures();
Cayenne.celsiusWrite(VIRTUAL_PIN5, sensors5.getTempCByIndex(4));
}
CAYENNE_OUT(VIRTUAL_PIN6)
{
sensors6.requestTemperatures();
Cayenne.celsiusWrite(VIRTUAL_PIN6, sensors6.getTempCByIndex(5));
}
 
//uptime
CAYENNE_OUT(VIRTUAL_PIN13)
{
  CAYENNE_LOG("Data requested for Virtual Pin %d", VIRTUAL_PIN13);
  Cayenne.virtualWrite(VIRTUAL_PIN13, millis() / 60000);
}

BR -MH


#2

The beginning of the code was left out

#include CayenneSerial.h
#include OneWire.h
#include DallasTemperature.h
#define CAYENNE_PRINT Serial
  • BR MH

#3

Hi @mattiheikkinen84,

It seems like a really cool project! And your English is very good :slight_smile:

Hmmm. What do you mean by dashboard freeze? The data is not coming into the widgets?

-B


#4

Hi @bestes,

Thanks. Yes data is not coming into the widgets. There is another chain here too…

http://community.mydevices.com/t/dashboard-updates-slowly-or-not-at-all/3600/4

and I will test now this…(what @adam says) -> you cant use the serial output to display messages in the serial console That maybe problem in my code.

-MH