ESP-MQTT
-
- Posts: 2
- Joined: Mon Apr 01, 2019 5:17 pm
ESP-MQTT
I am using "espmqtt" library and trying to build my code in esp-idf-v3.1.3. I am able to build the code(using example code inside the library "mqtt_tcp") and connect to CLOUD-MQTT server. But I am unable to send or receive any data. I am using both Eclipse ide (for esp32) and mysys32 to compile my code. Any help would be appreciable.
-
- Posts: 69
- Joined: Thu Nov 01, 2018 8:32 am
Re: ESP-MQTT
Hi,
The best starting point would be idf 3.2, where esp-mqtt is integrated as component.
If you have to stick with 3.1, then you can easily
* checkout 3.2 separately and copy folders `example/protocols/mqtt/tcp` and `components/mqtt` to your idf 3.1.3 tree
* go to `components/mqtt/esp-mqtt` and checkout `ESP-MQTT_FOR_IDF_3.1`
* modify the example code per your broker settings:
The best starting point would be idf 3.2, where esp-mqtt is integrated as component.
If you have to stick with 3.1, then you can easily
* checkout 3.2 separately and copy folders `example/protocols/mqtt/tcp` and `components/mqtt` to your idf 3.1.3 tree
* go to `components/mqtt/esp-mqtt` and checkout `ESP-MQTT_FOR_IDF_3.1`
* modify the example code per your broker settings:
Code: Select all
esp_mqtt_client_config_t mqtt_cfg = {
.uri = "mqtt://m24.cloudmqtt.com:PORT",
.password = "PASSWORD",
.username = "USERNAME",
.event_handle = mqtt_event_handler,
};
-
- Posts: 2
- Joined: Mon Apr 01, 2019 5:17 pm
Re: ESP-MQTT
Thank you very much for your feedback and fast response.
Who is online
Users browsing this forum: No registered users and 127 guests