If MQTT is already a lightweight protocol and it uses small amount of power and bandwidth, then why do we have MQTT-SN? When is it appropriate to use MQTT and when MQTT-SN?
MQTT-SN (MQTT for sensor networks) is an optimized version of the IoT communications protocol, MQTT (Message Queuing Telemetry Transport), designed specifically for efficient operation in large low-power IoT sensor networks.
An MQTT broker is a server that receives all messages from the clients and then routes the messages to the appropriate destination clients. An MQTT client is any device (from a micro controller up to a fully-fledged server) that runs an MQTT library and connects to an MQTT broker over a network.
MQTT is used for data exchange between constrained devices and server applications. It keeps bandwidth requirements to an absolute minimum, handles unreliable networks, requires little implementation effort for developers, and is, therefore, ideal for machine-to-machine (M2M) communication.
There are few advantages in MQTT-SN (SN for Sensors Network) over MQTT, especially for embedded devices.
home/livingroom/socket2/meter
in memory for each publish message.If you are running out of resources, or you do not have Ethernet/Wifi in your device, use MQTT-SN.
MQTT-SN (wher SN means Sensors Network) is different from MQTT. MQTT goes over TCP/IP and it can used for LAN communication or over Internet and the Cloud (if you have a client inside your network but the broker is outside on Internet). MQTT-SN can be used on more protocols suited for sensors network like ZigBee, Z-Wave and so on. The specification is different from MQTT ... so it isn't MQTT not over TCP/IP. It's more lightweight and needs a bridge to translate MQTT-SN messages into MQTT messages.
Paolo.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With