This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Getting Log Messages from Zephyr's MQTT module

Hello together,

I try to get the asset_tracker_v2 up and running on the thingy:91.

At the moment I get an Error from AWS_iot aws_iot: mqtt_connect, error: -116

My problem is that the error code -116 is not really mentioned in zephyrs errno.

Also the mqtt_connect function uses only functions from zephyrs mqtt.c/mqtt.h. So I thought I could add some LOG_ERR("...") Statements to the mqtt. c so I could see where everything get's messed up.

But I dont really see those messages in the Output of the LTE Link monitor.

I added the LOG Makros:

CONFIG_LOG_DEFAULT_LEVEL=4
CONFIG_MQTT_LOG_LEVEL_DEFAULT=y
and when I get the Zephyr Guide to logging right, modules where registered via LOG_MODULE_REGISTER and in mqtt.c I could find 
LOG_MODULE_REGISTER(net_mqtt, CONFIG_MQTT_LOG_LEVEL);
so in my Oppinion I could Use LOG_ERR/LOG_WARN/LOG_INF statements in the mqtt.c file and should see them on the console, but I don't
any suggestions?
Thank you very much in Advance!
Best Regards 
Rudolph
Related