I am using the IDF MQTT5 example project, and have built it unmodified and can connect to Mosquito
I (47716) mqtt5_example: Other event id:7
I (47726) main_task: Returned from app_main()
I (49036) mqtt5_example: MQTT_EVENT_CONNECTED
I now want to change the broker to HIVEHQ but am battling to get the HIVHQ URI accepted.
I have opened an account at HIVEHQ and can connect and use it successfully with a Python Paho test app I wrote using MQTT5 and TLS so I know the broker side is good.
I started by changing the line:
.broker.address.uri = CONFIG_BROKER_URL,
to my hive URI
.broker.address.uri = "d72b0b51da08402e86d06db5db25f244.s1.eu.hivemq.cloud",
It seems the URI cannot be passed in this format and my logs show:
[Codebox=text file=Untitled.txt]E (27296) mqtt_client: Error parse uri = d72b0b51da08402e86d06db5db25f244.s1.eu.hivemq.cloud[/Codebox]
or this format
.broker.address.uri = "mqtt://d72b0b51da08402e86d06db5db25f244.s1.eu.hivemq.cloud",
my logs:
E (39766) esp-tls: [sock=54] select() timeout
E (39766) transport_base: Failed to open a new connection: 32774
E (39766) mqtt_client: Error transport connect
So I tried commenting out
// .broker.address.uri = CONFIG_BROKER_URL,
and adding
.broker.address.hostname = "d72b0b51da08402e86d06db5db25f244.s1.eu.hivemq.cloud", .broker.address.port = 8883, .broker.address.transport = MQTT_TRANSPORT_OVER_TCP,
my logs:
E (21096) mqtt_client: esp_mqtt_handle_transport_read_error: transport_read(): EOF
E (21096) mqtt_client: esp_mqtt_handle_transport_read_error: transport_read() error: errno=128
So I went back to eclipse broker and tried:
.broker.address.uri = CONFIG_BROKER_URL, .broker.address.port = 8883, .broker.address.transport = MQTT_TRANSPORT_OVER_TCP,
my logs:
W (30676) mqtt_client: Transport config set, but overridden by scheme from URI: transport = 1, uri scheme = mqtt
E (30686) mqtt5_client: Client was not initialized
Can someone please help with a working solution for my HIVEHQ account
Thanks