I want to introduce the MQTT Protocol. MQTT stands for MQ Telemetry Transport it is nice lightweight publish and subscribe system where you can publice and receive message as a client and it makes it really easy to establish a communication between multiple devices.
It is a simple messaging protocol design for constrained devices and with low bandwith so it is perfect solution for internet of Things application.You can send command to controll an output or you can read that from a sensor and publish it.In MQTT there are few basic concepts that you need to understand
- Publish/subscribe - The device can publish message to yur other devices or your devices can subscribe to a particular topic to receive those messages. For example device 1 publishes on a topic, device 2 subscribe to same topic as device 1 is publishing so device 2 receive message or information from device 1 like data sensor etc. With publish and subscribe system you can do pretty much anything you could ever want it in your own mode mission projects
- Topics - Topic are the way you register interest for incoming messages or spesificy where you want to publish your message. Topic represented with strings separated by slash. The slash indicated the topic level. Example "/home/office/lamp". Please note the topic is case sensitive which make these topics different
- Broker is primary responsible for receiving all messages, filering the messages and decide who's interested in it and then publishing the message to all subscribed clients. There a several brokers you can use we're going to use mosquito broker which you will you install in the raspberry pi. You can try cloud mqtt broker like cloudMQTT etc.

Tidak ada komentar:
Posting Komentar