Closed aseitasi15 closed 1 year ago
I am using MQTT broker version 3.11 on AWS IOT.
There is no problem publishing data in ESP32. However, if I do the same part in the task of FreeRTOS, the data will not be published. Are there any hints to resolve this issue?
Here is the simple test code I tested.
static void task(void *pvParam) { while(1){ bool result = client.publish("topic_pub", "data here"); Serial.println(result); vTaskDelay(100); } }
The library is not thread-safe, you need to ensure that only one thread is using the client. Otherwise, publishing form another thread should work.
Closing as stale, please reopen if issue persists.
I am using MQTT broker version 3.11 on AWS IOT.
There is no problem publishing data in ESP32. However, if I do the same part in the task of FreeRTOS, the data will not be published. Are there any hints to resolve this issue?
Here is the simple test code I tested.
static void task(void *pvParam) { while(1){ bool result = client.publish("topic_pub", "data here"); Serial.println(result); vTaskDelay(100); } }