Closed prayagvakharia closed 7 years ago
what are the logs saying?
Server Log when Web client is trying to ping:
{"pid":55534,"hostname":"ubuntu","name":"MoscaServer","level":20,"msg":"pingreq","time":1468655466651,"client":"mqttjs_07e06b30","v":1}
{"pid":55534,"hostname":"ubuntu","name":"MoscaServer","level":20,"msg":"setting keepalive timeout","time":1468655466651,"timeout":15000,"client":"mqttjs_07e06b30","v":1}
{"pid":55534,"hostname":"ubuntu","name":"MoscaServer","level":20,"msg":"pingreq","time":1468655469064,"client":"mqttjs_03d38594","v":1}
{"pid":55534,"hostname":"ubuntu","name":"MoscaServer","level":20,"msg":"setting keepalive timeout","time":1468655469064,"timeout":15000,"client":"mqttjs_03d38594","v":1}
{"pid":55534,"hostname":"ubuntu","name":"MoscaServer","level":20,"msg":"pingreq","time":1468655476661,"client":"mqttjs_07e06b30","v":1}
{"pid":55534,"hostname":"ubuntu","name":"MoscaServer","level":20,"msg":"setting keepalive timeout","time":1468655476661,"timeout":15000,"client":"mqttjs_07e06b30","v":1}
{"pid":55534,"hostname":"ubuntu","name":"MoscaServer","level":30,"msg":"keepalive timeout","time":1468655477291,"client":"mqttjs_8cbd71a3","v":1}
{"pid":55534,"hostname":"ubuntu","name":"MoscaServer","level":20,"msg":"closing client, reason: keepalive timeout","time":1468655477291,"client":"mqttjs_8cbd71a3","v":1}
{"pid":55534,"hostname":"ubuntu","name":"MoscaServer","level":30,"msg":"closed","time":1468655477291,"client":"mqttjs_8cbd71a3","v":1}
Client Disconnected := mqttjs_8cbd71a3
Published := { topic: '$SYS/BJ-rLwvw/disconnect/clients',
payload: 'mqttjs_8cbd71a3',
messageId: 'BkauwPvw',
qos: undefined,
retain: undefined }
{"pid":55534,"hostname":"ubuntu","name":"MoscaServer","level":20,"msg":"setting keepalive timeout","time":1468655478347,"timeout":15000,"client":"mqttjs_8cbd71a3","v":1}
{"pid":55534,"hostname":"ubuntu","name":"MoscaServer","level":30,"msg":"client connected","time":1468655478348,"client":"mqttjs_8cbd71a3","v":1}
Client Connected := mqttjs_8cbd71a3
Published := { topic: '$SYS/BJ-rLwvw/new/clients',
payload: 'mqttjs_8cbd71a3',
messageId: 'rJCuwvPP',
qos: undefined,
retain: undefined }
Logs when Node Client trying to ping server:
{"pid":55630,"hostname":"ubuntu","name":"MoscaServer","level":20,"msg":"setting keepalive timeout","time":1468655622592,"timeout":15000,"client":"mqttjs_773baeee","v":1}
{"pid":55630,"hostname":"ubuntu","name":"MoscaServer","level":30,"msg":"client connected","time":1468655622596,"client":"mqttjs_773baeee","v":1}
Client Connected := mqttjs_773baeee
{"pid":55630,"hostname":"ubuntu","name":"MoscaServer","level":20,"msg":"setting keepalive timeout","time":1468655622617,"timeout":15000,"client":"mqttjs_773baeee","v":1}
{"pid":55630,"hostname":"ubuntu","name":"MoscaServer","level":20,"msg":"subscribe received","time":1468655622618,"packet":{"messageId":31951,"qos":1,"subscriptions":[{"topic":"mqtt/demo","qos":0}]},"client":"mqttjs_773baeee","v":1}
{"pid":55630,"hostname":"ubuntu","name":"MoscaServer","level":20,"msg":"setting keepalive timeout","time":1468655622620,"timeout":15000,"client":"mqttjs_773baeee","v":1}
{"pid":55630,"hostname":"ubuntu","name":"MoscaServer","level":30,"msg":"subscribed to topic","time":1468655622624,"topic":"mqtt/demo","qos":0,"client":"mqttjs_773baeee","v":1}
Subscribed := undefined
Published := { topic: '$SYS/rk5Z_PvD/new/clients',
payload: 'mqttjs_773baeee',
messageId: 'HJyz_PDv',
qos: undefined,
retain: undefined }
{"pid":55630,"hostname":"ubuntu","name":"MoscaServer","level":20,"msg":"published packet","time":1468655622660,"packet":{"messageId":"Bkx1GdPvD","topic":"mqtt/demo"},"client":"mqttjs_773baeee","v":1}
Published := { topic: 'mqtt/demo',
payload: <Buffer 48 65 6c 6c 6f 20 66 72 6f 6d 20 6e 6f 64 65 20 63 6c 69 65 6e 74>,
messageId: 'Bkx1GdPvD',
qos: 0,
retain: false }
Published := { topic: '$SYS/rk5Z_PvD/new/subscribes',
payload: '{"clientId":"mqttjs_773baeee","topic":"mqtt/demo"}',
messageId: 'SJbyzuvvw',
qos: undefined,
retain: undefined }
If you remove the mongodb configuration, does this work?
No luck with escap mongoDB configuration.
Also i have tried one more thing: remove setting from web client so now i am able to publish message from web client to node client. but reverse node client to web client still i am not able to subscribe any messages.
only change i did is remove settings from web client.
One more thing i have observed is:
when i run node client it will setup subscribe topic:
Published := { topic: '$SYS/BklFFSnt/new/subscribes',
payload: '{"clientId":"mqttjs_b01acd2d","topic":"mqtt/demo"}',
messageId: 'H1WgqYr3F',
qos: undefined,
retain: undefined }
but when run web client there is no subscribes topic is created.
Which browser are you testing this with?
Closing for low activity
I am trying web client to connect with mosca. it will connect successfully but not able to publish or subscribe any topic via web.
Server:
Web Client:
Node Client:
Not sure whats going wrong i have tried with http, ws too.
i am using mosca -V : 2.0.1 node -v : v6.2.2
Thanks