Can’t publish any data to Cayenne dashboard on

a few years ago, in 2019 I’ve made a device with NUCLEO + mbed os and it was connecting to Cayenne dashboard, and sent some data like temperature, humidity, etc.

Now I returned to this project, but my device can’t send any data to Cayenne. It’s connecting to [], it’s visible as online on dashbord, but portal disconnects my device after first command publishing any data. If device doesn’t publish any data it may stay connected for a long time.

In my program I’ve used Cayenne-MQTT-mbed - The Cayenne MQTT mbed Library

Maybe something has been changed from past days when my device was working well with Cayenne? I don’t know.

// Subscribe to required topics.
if ((error = mqttClient.subscribe(COMMAND_TOPIC, CAYENNE_ALL_CHANNELS)) != CAYENNE_SUCCESS) {
printf(“Subscription to Command topic failed, error: %d\n”, error);
return error;
if ((error = mqttClient.subscribe(CONFIG_TOPIC, CAYENNE_ALL_CHANNELS)) != CAYENNE_SUCCESS) {
printf(“Subscription to Config topic failed, error:%d\n”, error);
return error;

// Send device info.
printf(“Publishing SYS_VERSION failed, error:%d\n”, error);
return error;

Every command has been ended with error=-1 and after that my device becomes offline on dashboard. I’ve tried only single subscribe command, or single publishData command and nothing changed.

Do you have any advice? Is there anybody who uses this API, and it works with mbed os? I’ve sarched with Google but can’t find examples with mbed os.