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

MQTT_PUBLISHER : Mqtt_connect -116

Hi,

I am currently setting up an MQTT client via the  MQTT publisher sample on zephyr. 

My mqtt client is a NRF5340 and it is connected via ethernet with my pc and also mqtt broker on my pc.

The problem I have is as the diagram indicated below

This is some section of my proj.conf

this is some part of my config.h

I am not sure how to solve this problem so that I can form a MQTT connection between my pc and NRF5340

Parents
  • Hello,

    Not something I have tried myself, so difficult to comment. 

    I would think the problem is on the PC side, and that the nRF5340 don't have any internet access. The error code is:
    #define ETIMEDOUT 116 /**< Connection timed out */

    The try to connect have error code:
    #define EINVAL 22 /**< Invalid argument */

    So I guess it could also be that the problem is on the nRF5340 if there is an invalid argument.

    Can you tell me a bit more of your setup? Are you using a shield of some sort? Do you have any other examples you can try to check if the ethernet works as expected (e.g. ping)?

    Kenneth

  • Thank you so much.

    Yes, the problem is with the DHCP server on my pc not automatically providing an IP address. I am not sure what I really did that makes it work as I did a bunch of random stuff. But I believe the problem is because of window firewall.

Reply Children
No Data
Related