Hello, im new in arduino and cayenne thing and want to learning.
im building with nodemcu sensor and relay stuff but keep getting message “[160758] Connecting to arduino.mydevices.com:”
and then get this message : ets Jan 8 2013,rst cause:4, boot mode:(1,6)
wdt reset with debug on,
,
can anyone help me to solve this problem?
Here is my code :
#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space
#define CAYENNE_DEBUG
#include <ESP8266WiFi.h>
#include “CayenneDefines.h” // Wifi Sensors
#include “BlynkSimpleEsp8266.h”
#include “CayenneWiFiClient.h”
#include <DHT.h> // DHT Sensors
#define Pin A0 // Soil Sensors Analog
#define DHTPIN 5 // DHT Pin Sensor
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
char token = “”;
char ssid = “”;
char password = “”;
void setup(void)
{
// initialize digital pin 2 as an output.
pinMode(D5, OUTPUT);
pinMode(D6, OUTPUT);
pinMode(D7, OUTPUT);
pinMode(D8, OUTPUT);
Serial.begin(115200);
// dht.begin();
Cayenne.begin(token, ssid, password); //Cayenne
}
void loop(){
{
Cayenne.run();
}
delay (500);
int h = dht.readHumidity();
int t = dht.readTemperature();
Serial.print(“Temeperature : “);
Serial.print(t);
Serial.println(” C”);
Serial.print(“Humidity : “);
Serial.print(h);
Serial.println(” %”);
int x = analogRead(A0);
int y = map(x, 945, 380 , 0, 100);
Serial.print("Moisture : ");
Serial.println(y);
Cayenne.virtualWrite(V1,y);
}
// CAYENNE_OUT(V1)
//{
// Cayenne.virtualWrite(V1,y);
//}
CAYENNE_OUT(V2)
{
Cayenne.virtualWrite(V2, dht.readTemperature());
}
CAYENNE_OUT(V3)
{
Cayenne.virtualWrite(V3, dht.readHumidity());
}
//----------------- RELAY LINES
// This function will be called every time a Dashboard widget writes a value to Virtual Pin 2.
CAYENNE_IN(V5) //------------------- RELAY 1
{
CAYENNE_LOG(“Got a value: %s”, getValue.asStr());
int i = getValue.asInt();
if (i == 0)
{
digitalWrite(D5, HIGH);
}
else
{
digitalWrite(D5, LOW);
}
}
CAYENNE_IN(V6) //------------------- RELAY 2
{
CAYENNE_LOG(“Got a value: %s”, getValue.asStr());
int i = getValue.asInt();
if (i == 0)
{
digitalWrite(D6, HIGH);
}
else
{
digitalWrite(D6, LOW);
}
}
CAYENNE_IN(V7) //------------------- RELAY 3
{
CAYENNE_LOG(“Got a value: %s”, getValue.asStr());
int i = getValue.asInt();
if (i == 0)
{
digitalWrite(D7, HIGH);
}
else
{
digitalWrite(D7, LOW);
}
}
CAYENNE_IN(V8) //------------------- RELAY 4
{
CAYENNE_LOG(“Got a value: %s”, getValue.asStr());
int i = getValue.asInt();
if (i == 0)
{
digitalWrite(D8, HIGH);
}
else
{
digitalWrite(D8, LOW);
}
}