Contoh Command Mosquitto Client

AH
Ahmad Lukman Hakim

Dedicated Author of LUKMANLAB

# mqtt

Berikut adalah contoh command mosquitto client yang saya pakai untuk troubleshoot koneksi. Tujuanya adalah untuk memastikan client dengan server bisa berkomunikasi, baik melakukan publish maupun subscribe message sebuah topic.

Yang pertama kita coba subscribe terlebih dahulu ke topic tertentu:

mosquitto_sub -h IP_ADDRESS -t "test/topic" -u 'mqtt_user' -P 'mqtt_pass' -v

Kemudian kita coba publish message ke topic tersebut:

mosquitto_pub -h IP_ADDRESS -t "test/topic" -m 'hello world' -u 'mqtt_user' -P 'mqtt_pass'

Sekian...