FAQ - Application server connection examples PSK


Introduction

On this page we would like to show some connection examples using Pre-shared-key (PSK) and error descriptions.

Set-up: 

MQTT message example:

  • Prio 1 message
  • To handset with SIP ID 1013
  • With "Fire" icon and some text
  • Nx70 IP address: 192.168.178.190, Port 8884


Information
MQTT example

mosquitto_pub -u as1 --psk-identity as1 --psk 123456789012345678901234567890ab -t 'as1/msg/xxl/msgsrv/req/setMsg' -m '{"msgId":"1","payload":{"amsgId":"23642","sip_id":"1013","msg":{"server_msg_status":"new","prio":"1","title":{"text":"Message prio 1","color":"04"},"status_icon":"0D","status_text":"accept","ttl":"600","alert_info":"msg_melody_low","overrule_silencing":"no","vibration":"no","ringtone_volume":"50","deletable":"yes","local_ignore":"yes","presentation_time":"30","body_starter":"Body starter","msg_icon":{"value":"28"},"body":[{"msg_icon":{"value":"4E","color":"04"}},{"paragraph":{"text":"Prio 1 message: some longer test to check how long the message can be","blink":"no","underline":"yes","bold":"yes","align":"left","color":"00"}},{"paragraph":{"text":"This text is only shown in detailed view","blink":"no","underline":"no","bold":"no","align":"left"}}],"reply_options":[{"option_id":"1","reply":{"text":"Msg1SK1"}},{"option_id":"2","reply":{"text":"Msg1SK2"}},{"option_id":"3","make_call":{"text":"Call","to":"1021"}}]}}}' -p 8884 -h 192.168.178.190

Syslog output - No error

MQTT New connection from 192.168.178.61 on port 8884.
Syslog New client connected from 192.168.178.61 as mosq-PQBgyaFiibZoW66I2k (c1, k60, u'as1').
...
Information
Error: Wrong port number - port 8882

mosquitto_pub -u as1 --psk-identity as1.... -p 8882 -h 192.168.178.190

Error: Connection refused

Information
Error: Wrong port number - using port 8885 for client certificates

mosquitto_pub -u as1 --psk-identity as1.... -p 8882 -h 192.168.178.190

Error: The connection was lost.

Syslog New connection from 192.168.178.61 on port 8885.

Syslog SSL routines:tls_process_client_certificate:peer did not return a certificate

Syslog Socket error on client <unknown>, disconnecting.\n

Information
Connection error: Connection Refused: identifier rejected.

mosquitto_pub -u as1 --psk-identity as1.... -p 8882 -h 192.168.178.190

Connection error: Connection Refused: identifier rejected.
Error: The connection was refused.

Syslog New connection from 192.168.7.122 on port 8884.
Syslog Socket error on client <unknown>, disconnecting.


Solution: add -I 'as1'  (Capital i)

mosquitto_pub -u as1 --psk-identity as1.... -p 8882 -h 192.168.178.190 -I 'as1'

Usage of "-i" parameter depends on the mosquitto version on host and device.
When version 2.0.11 (released on 26.11.2021) is on host and 1.5.4 on the device this additional parameter is needed

Information
Error: Handset has no License enabled

mosquitto_pub -u as1 --psk-identity as1.... -p 8882 -h 192.168.178.190

There will be no error

Syslog AML messaging disabled for this hs: 035edb3a92\n

Information
Error: MQTT username or password is wrong

mosquitto_pub -u as1 --psk-identity as1.... -p 8882 -h 192.168.178.190

Error: A TLS error occurred.