Hello everyone, again. This is the fifth blog post based on the following table.
This blog explains the highlighted section in the overall architecture below.
In the previous blog, I introduced 2 unit tests in regard to gathering and sending data.
The remaining test is about MQTT broker which is for displaying real-time data in the dashboard.
MQTT broker does not directly communicate with HCP IoT Services here but it will play a role for supplementing HCP IoT Services from a displaying real-time data perspective.
So, technically, it is a separated data source for our dashboard and its purpose is different from HCP IoT Services in the architecture.
-
HCP IoT Services: Gathering and processing all data using HANA
-
MQTT Broker: Displaying real-time data without storing them in any databases
SAP Korea team used Mosquitto as our MQTT broker and we installed it on Raspberry Pi since we don’t need a public MQTT broker.
Let’s do the last unit test.
Prueba de unidad 3: MQTT
The first thing you need to do is installing Mosquitto on Raspberry Pi with WebSocket support.
Since
blog de peter6960 (Peter van der Walt)
explains the detailed steps in regard to the installation, I’ll not explain it here.
Please refer the “Installation Mosquitto with WebSocket Support” and “Enable WebSocket Support” sections in his blog.
However, I didn’t install mosquitto client and there are slight differences in editing mosquitto.conf file and loading it as below.
sudo apt-get install mosquitto
mosquitto-clients
mosquitto.conf
sudo nano /etc/mosquitto/mosquitto.conf
I added 3 lines as below.
listener 1883
listener 9001
protocol websockets
Then I load config using following command.
mosquitto -c /etc/mosquitto/mosquitto.conf
The next thing is installing Chrome extension for subscribing and publishing topics.
I installed MQTTLens but if you have any favorite tools other than Chrome extension, you can also use them.
Once you launch MQTTLens, you can add a new connection