connect to multiple mqtt brokers TLS/non TLS
Posted: Mon Aug 17, 2020 8:18 am
Hi,
I am having some troubles understanding, why I cannot connect to two independent MQTT brokers at the same time.
One broker is configured with TLS, and the other is not.
If i comment out one or the other, it works fine, else I get this:
Any ideas?
I am having some troubles understanding, why I cannot connect to two independent MQTT brokers at the same time.
One broker is configured with TLS, and the other is not.
Code: Select all
// Device manager configuration
esp_mqtt_client_config_t mqtt_device_manager_cfg = {
.uri = MQTT_DEVICE_MANAGER_URI,
.port = MQTT_DEVICE_MANAGER_PORT,
.username = (const char*) device_UUID,
.password = MQTT_DEVICE_MANAGER_PASSWORD,
.client_id = (const char*) device_UUID,
.disable_clean_session = 1,
.cert_pem = client_cert_pem
};
device_manager_mqtt_client = esp_mqtt_client_init(&mqtt_device_manager_cfg);
esp_mqtt_client_register_event(device_manager_mqtt_client, ESP_EVENT_ANY_ID, mqtt_device_manager_event_handler, NULL);
esp_mqtt_client_start(device_manager_mqtt_client);
// MQTT configuration
esp_mqtt_client_config_t mqtt_cfg = {
.uri = MQTT_URI,
.port = MQTT_PORT,
.username = MQTT_USERNAME,
.password = MQTT_PASSWORD,
};
mqtt_client = esp_mqtt_client_init(&mqtt_cfg);
esp_mqtt_client_register_event(mqtt_client, ESP_EVENT_ANY_ID, mqtt_event_handler, NULL);
esp_mqtt_client_start(mqtt_client);
Code: Select all
E (14272) TRANS_TCP: tcp_poll_read select error 113, errno = Software caused connection abort, fd = 55
E (14282) MQTT_CLIENT: mqtt_message_receive: transport_read() error: errno=0
E (14282) TRANS_SSL: ssl_poll_read select error 113, errno = Software caused connection abort, fd = 54
E (14292) MQTT_CLIENT: esp_mqtt_connect: mqtt_message_receive() returned -1
E (14302) MQTT_CLIENT: Poll read error: 0, aborting connection