Hi guys, i have a problem with my proyect, my device don´t send data from cayenne
Serial:
[1576] ESP is not responding
[4087] ESP is not responding
[6597] ESP is not responding
[15366] Connected to WiFi
[15366] Connecting to mqtt.mydevices.com:1883
[15985] Connected
[26007] MQTT connect failed, error 0
My code:
`
//#define CAYENNE_DEBUG // Uncomment to show debug messages
#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space
#include <CayenneMQTTESP8266Shield.h>
#include <OneWire.h>
#include <DallasTemperature.h>
OneWire oneWire(8);
DallasTemperature sensors(&oneWire);
unsigned long lastTempUpdate = 0;
// WiFi network info.
char ssid = “RN”;
char wifiPassword = “********”;
// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username = “69f8c2b0-46ca-11ea-a38a-d57172a4b4d4”;
char password = “fa8e580b3e8adf4d400c731aa5e722202e3be649”;
char clientID = “7dd4fb50-47c9-11ea-ba7c-716e7f5ba423”;
// Set ESP8266 Serial object. In this example we use the Serial1 hardware serial which is available on boards like the Arduino Mega.
#define EspSerial Serial1
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(2, 3); // RX, TX
ESP8266 wifi(&EspSerial);
// WiFi network info.
void setup()
{
Serial.begin(9600);
delay(10);
// Set ESP8266 baud rate
EspSerial.begin(115200);
delay(10);
sensors.begin();
Cayenne.begin(username, password, clientID, wifi, ssid, wifiPassword);
}
void loop(){
Cayenne.loop();
sensors.requestTemperatures();
// float temperatureC = sensors.getTempCByIndex(0);
if ( millis() - lastTempUpdate > 600 ) {
lastTempUpdate = millis();
Cayenne.virtualWrite(0, sensors.getTempCByIndex(0) ,TYPE_TEMPERATURE,UNIT_CELSIUS);
//lastTempUpdate = now;
}
}
// Default function for processing actuator commands from the Cayenne Dashboard.
// You can also use functions for specific channels, e.g CAYENNE_IN(1) for channel 1 commands.
CAYENNE_IN_DEFAULT()
{
CAYENNE_LOG(“Channel %u, value %s”, request.channel, getValue.asString());
//Process message here. If there is an error set an error message using getValue.setError(), e.g getValue.setError(“Error message”);
}`