Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error creating MQTTTask #13

Open
ZanzyTHEbar opened this issue Dec 21, 2023 · 3 comments
Open

Error creating MQTTTask #13

ZanzyTHEbar opened this issue Dec 21, 2023 · 3 comments

Comments

@ZanzyTHEbar
Copy link

[INFO - BaseMQTT]: MQTT broker found at: 192.168.0.242:1883
[INFO - BaseMQTT]: Broker 192.168.0.242:1883
{
   "mqtt": {
        "enabled": true,
        "server": "192.168.0.242",
        "port": 1883,
        "id_name": "LEDController",
        "reconnect_mqtt": false,
        "reconnect_retires": 10,
        "reconnect_time_ms": 10000,
        "enable_user_and_pass": false,
        "user_name": "",
        "user_password": "",
        "enable_certificates": false,
        "ca_file": "",
        "cert_file": "",
        "key_file": "",
        "enable_websockets": false,
        "websocket_path": "",
        "mqtt_task_stack_size": 7168,
        "pub_topic": [],
        "sub_topic": [
            "device/report"
        ]
  }
}
[INFO - BaseMQTT]: MQTT Server: 192.168.0.242
[  4646][I][MQTTClient.cpp:670] addTopicSub(): [MQTTClient] Adding topic device/report to the subTopics list
[  4651][W][MQTTClient.cpp:699] addTopicSub(): [MQTTClient] MQTT client not connected, topic device/report will be subscribed when connected
[  4664][I][MQTTClient.cpp:153] setup(): [MQTTClient] Connecting to broker: mqtt://192.168.0.242:1883
[  4672][W][MQTTClient.cpp:197] setup(): [MQTTClient] [APP] Free memory: 261928 bytes
E (4441) MQTT_CLIENT: Error create mqtt task

Not exactly sure what the issue is. I have confirmed that the broker is online and functioning and even tested PubSubClient as a control, it worked fine.

Any advise is appreciated. It seems that the MQTT task is failing.

@paclema
Copy link
Owner

paclema commented Dec 22, 2023

It seems most likely that the configuration is correct but there is not enough memory available to run the ESP-IDF MQTT component which tries to create a Frertos task. You could try to reduce the mqtt_task_stack_size, re-arrange the memory size for other tasks you have, or try the same configuration with another board in order to increase the memory available to be able to create this necessary MQTT task.

@ZanzyTHEbar
Copy link
Author

Thank you, i thought the same as well, just doesnt make sense. I have 260kb left .. will look into it. Thank you for your time.

@ZanzyTHEbar
Copy link
Author

ZanzyTHEbar commented Dec 27, 2023

I can confirm that changing the task stack size makes 0 difference. I've tried various sizes, as low as 1024, and nothing helps. same exact error. I've implemented other asynchronous MQTT client libs, and they work fine. At this point, i have nothing else that i can try other than to move away from this library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants