Forums - Maximum size of password in qapi_Net_MQTTc_Set_Username_Password

4 posts / 0 new
Last post
Maximum size of password in qapi_Net_MQTTc_Set_Username_Password
jagan
Join Date: 2 Jan 20
Posts: 15
Posted: Wed, 2020-01-22 01:58

Hi,

I am tyring to connect to MQTT broker using the qapi APIs (qapi_Net_MQTTc_*()). I am getting respose -20034 "Bad user name or password". 

With the same MQTT broker end point and the same credentials I am able to connect  via MQTT Explorer client. (http://mqtt-explorer.com/

Is there any limitation on the password size in "qapi_Net_MQTTc_Set_Username_Password()". For me the password size is around  512 Bytes. 

Regards,
Jagan

 

 

  • Up0
  • Down0
raja_pedada
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 300
Posted: Wed, 2020-01-22 16:43

I have tried using 512 bytes long username/password and no issuse seen locally.
Below are the instructions for QCLI_demo, kindly make sure you are using the exact sequence:
 

> net mqttc init

> net mqttc new quartz-mqtt-client 1

> net  mqttc config 0 -u adminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadminadm

> net  mqttc connect 0 192.168.1.30 -n -k 60 -w 5

> net mqttc subscribe 0 -t quartz -q 2

> net mqttc publish 0 -t quartz -q 1 -m "Hello, World!"

 

  • Up0
  • Down0
jagan
Join Date: 2 Jan 20
Posts: 15
Posted: Sat, 2020-01-25 19:43

Thanks Raja for the response. 

There was an issue in my code.  The password length was set incorrectly in my code, hence the error.  After setting correct password the issue is fixed. 

Regards,

Jagan

 

  • Up1
  • Down0
baraujo821
Join Date: 2 Apr 20
Posts: 3
Posted: Tue, 2020-06-30 04:13

Quote:
Thanks Raja for the response. 

There was an issue in my code.  The password length was set incorrectly in my code, hence the error.  After setting correct password the issue is fixed. 

Regards,

Jagan

Yeah, this is the most common problem:)

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.