Has anyone had any luck connecting to thingsboard cloud MQTT broker recently?
I've tried
Code: Select all
esp_mqtt_client_config_t mqtt_cfg = {
.client_id="TbDev",
.password=mypassword,
.username=myusername,
.uri = "mqtt://cloud.thingsboard.io",
.port = 1883,
//.username = mqtt_access_token
};
I also tried using access tokens and following thingsboard example where the username is the token.
Code: Select all
const char *mqtt_url = get_mqtt_url(running_partition_label);
const uint32_t mqtt_port = get_mqtt_port(running_partition_label);
const char *mqtt_access_token = get_mqtt_access_token(running_partition_label);
esp_mqtt_client_config_t mqtt_cfg = {
.uri = mqtt_url,
.event_handle = mqtt_event_handler,
.port = mqtt_port,
.username = mqtt_access_token
};
In both cases I get
"MQTT_CLIENT: Connection refused, not authorized"
Are there any other credentials required other than access token or username/pass for a device?
I can use thingsboard from the esp-32 in Arduino SDK. I can connect to other MQTT brokers in ESP-IDF but cannot seem to get thingsboard working.