//#define CAYENNE_DEBUG // Uncomment to show debug messages
#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space
#include "CayenneDefines.h"
#include "BlynkSimpleEsp8266.h"
#include "CayenneWiFiClient.h"
// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token[] = "TOKEN";
// Your network name and password.
char ssid[] = "SSID";
char password[] = "PASSWORD";
void setup()
{
Serial.begin(9600);
// Cayenne.begin(token, ssid, password);
Cayenne.config(token); //If this doesn't work, try Blynk.config(token);
}
void loop()
{
Cayenne.run();
}
Maybe try this, make a new file called CayenneESP8266WiFiClient.h and use
it instead of CayenneWifiClient.h. I added config to the public calls and directed it to use the Cayenne domain and port. I still think the problem is that the Cayenne functions do not have a handle. Hard to really help you since you haven’t shared your current sketch.
#include <ESP8266WiFi.h>
#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space
#include "CayenneDefines.h"
#include "BlynkSimpleEsp8266.h"
#include "CayenneESP8266WiFiClient.h"
char token[] = "";
const char* ssid = "";
const char* password = "";
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("YaHoo...");
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.waitForConnectResult() != WL_CONNECTED) {
Serial.println("Connection Failed! Rebooting...");
delay(5000);
ESP.restart();
}
// Cayenne.begin(token, ssid, password);
Cayenne.config(token); //If this doesn't work, try Blynk.config(token);
//Blynk.config(token);
}
void loop() {
// put your main code here, to run repeatedly:
Cayenne.run();
delay(100);
Serial.print(".");
}
And the solution doesn’t help:
C:\Users\vkrav\AppData\Local\Temp\build1af443b1e6fff8ae03707f8515d69806.tmp\sketch\CayenneESP8266WiFiClient.h:24:9: error: ‘Base’ has not been declared
Base::begin(auth);
^
C:\Users\vkrav\AppData\Local\Temp\build1af443b1e6fff8ae03707f8515d69806.tmp\sketch\CayenneESP8266WiFiClient.h:25:15: error: ‘class CayenneWiFiClient’ has no member named ‘conn’
This sketch is an example. I don’t want to amend the main sketch that consist is more than 12 separate files and a hundred of routines.
The idea not to use Wi-Fi connection made by Cayenne is in the following: there is a number of WiFi managers that can provide you with connection setup in a case of non-connected. It is obvious that it is not possible to use them if the sketch uses Cayenne WiFi connection. That’s the reason.
I had a problem while connecting with ESP8266 to Cayenne. The problem was in my router. Try enabling port 8442 pot on your router. Than it may connect to the Cayenne with ESP device.
I tested the code with Blynk.config(token) and WiFi connection with ESP libraries rather than Cayenne libraries. It works fine.
Blynk is open source, and I love that Cayenne has adopted it and instead focused on a comprehensive dashboard solution with solid cloud services.
MQTT support is also based on another open source initiative called Paho.
I know the development team is currently focussing on getting LoRa devices on Cayenne.
IMHO, we can achieve more greatness if our creative juices are used to create novel solutions instead of re-inventing the wheel.
I wish government would embrace the open source movement too instead of battling over the best way to skin a cat. Where did that idiom come from anyway?