Page 1 of 1

Unable to connect mqtt server using only IP instead of url.

Posted: Fri Jun 11, 2021 8:49 am
by GirishHolla
Hi trying to upload to publish data in MQTT using only IP (host) address in MQTT setup configuration but its failed to upload (used mobile hotspot to connect server for MQTT). If uri is used its uploading and works fine. Any solution for this issue kindly let me know and thank you in advance.

esp_mqtt_client_config_t mqtt_cfg = { .uri =
"mqtt://", /****works fine if i use only this parameter********/
//.host = "",/**unable to upload to server using only host ********/
.port = config.port,
.username = config.usr_name,
.password = config.usr_pwd,
esp_mqtt_client_handle_t client = esp_mqtt_client_init(&mqtt_cfg);