MQTT Client on RB
Objective:
This guide describes the testing method of mqtt client for the Rugged Board i.MX6UL.
Materials:
Hardware:
Rugged Board i.MX6UL
ubuntu pc
Software:
Not Require
Procedure:
Step 1: Add the below additional packages in yocto and use compiled rootfs.
mosquitto
tcpdump
Step 2: Download the source from below link and cross compile it.
→ Run the toolchain of rugged board i.mx6ul to cross compile the application source.
Step 3: Edit the publish and subscribe files of mqtt applications as below
→ Here give the ip address of board as below and save the file.
→ Same for subscribe file too
→ Here give the ip address of board as below
Step 4: Save and compile using below commands
Step 5: After compilation, copy the libraries from below path to usr/lib in the board
→ Copy the these two applications with name of "MQTTClient_subscribe", "MQTTClient_publish" from below path to "home/root" of the board.
Step 6: Edit the mosquitto configuration file as below in the board
→ Add below lines in and save the file.
Note: here 1883 is port and 192.168.3.11 is board ip address.
Step 7: Run the below command in the board.
→ ssh to the board ip address as "ssh root@192.168.3.11" from your PC.
→ And run the below binary to get the data
→ Then run the below binary to sent the data in other terminal(do ssh to the board)
Below are the test logs for above commands:
Output logs of ./MQTTClient_subscribe:
Output logs for ./MQTTClient_publish:
Last updated