How to subscribe to multiple topics using mqtt in js?
伊谢尔伦
伊谢尔伦 2017-05-19 10:28:56
0
1
1052

If you want to obtain the numerical changes of sensors in real time, each sensor has a unique data_id.
The front end is using mqtt to combine multiple data_ids into an array and subscribe as a topic.
But it only successfully subscribes The first data_id was retrieved, but the others did not respond.
What should I do if I want to subscribe to multiple topics on the front end?

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(1)
PHPzhong

It is not recommended that js directly subscribe to mqtt. The server should subscribe to mqtt. In addition, multiple client ids are required to subscribe to multiple topics.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template