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

MQTT with and without security publisher client example connection issue to broker

Hi,

I am using Linux ubuntu 14.04 with kernel version 4.15.0-041500-generic for 6lowpan over BLE and  MQTT broker wit IPv6 address as inet6 address in below image

In SDK v15.0.0 I am giving m_broker_addr as in below image

Listening on port 1883 and set same in MQTT publisher example. So why publisher client cannot connect to mosquitto broker. Do I need to generate any other addresses(link local, prefixes) or I am giving wrong address in code?

Can everyone address your comments.

Thanks,

Sridhar

Parents Reply Children
  • I have added global prefix. Again the same issue is coming.

    And one thing I missed is running mosquitto -p 8883 -c ./mosquitto.conf command says 

    Error: Unknown configuration variable "psk_hint".

    Error: Unable to open configuration file.

    Error: Unknown configuration variable "psk_file".

    Error: Unable to open configuration file.

    I have added mosquitto.conf by enabling psk_hint, psk_file

    (psk_hint hello

    psk_file /home/sridhar/Desktop/ivativ/mosquitto_user/tls_key.txt)

    tls_key.txt with same id:key (436c69656e745f6964656e74697479:73656372657450534b) pair as in MQTT publisher example.

    1. May be because of the above errors, MQTT connection is not happening when pressing button 1.

    2. Also how to know MQTT broker address at the compile time for MQTT publish example? 

    Please clarify.

    Thanks

  • You should be able to run Mosquitto without enabling security, i.e. adding a TLS key. Could you try to run mosquitto_sub -t "led/state" ?
    The MQTT broker address will be the IP address of the computer running the broker, i.e.  Linux ubuntu 14.04 PC. You should be able to find the ip with the ifconfig command in terminal. 

    Best regards

    Bjørn  

Related