Simple Cayenne on ESP

Hi.

I would add Cayenne to my project.

Unfortunately, I don’t know which library to use. Everywhere is full of examples but ready for given boards and systems.

I already have my system working on ESP and NRF24. Connects to WiFi, sends to Thingspeak and other things. I would like to add the option to send it to Cayenne. I just don’t know which library to use and what functions.

for esp8266 you can use this code https://github.com/myDevicesIoT/Cayenne-MQTT-Arduino/blob/master/examples/Connections/ESP8266/ESP8266.ino

I connect via wifi.begin and I don’t want to change it.

When use Cayenne.begin (username, password, clientID) kills ESP

Another option is to use PubSubClient.h and publish the data manually. Here are the docs on manually publishing https://developers.mydevices.com/cayenne/docs/cayenne-mqtt-api/#cayenne-mqtt-api-manually-publishing-subscribing

any specific reason?

Yes. I have deep sleep support, channel data download and BSSID etc.

I thought it would be a simple and quick topic. That I would add one or two lines of code to send to Cayenne. The topic can be closed.

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

this works for me.

1 Like