# MQTT-SN Gateway
# Introduction
The MQTT-SN gateway is based on the MQTT-SN v1.2 (opens new window).
# Quick Start
In EMQX 5.0, MQTT-SN gateways can be configured and enabled through the Dashboard.
It can also be enabled via the HTTP API or emqx.conf, e.g:
TIP
Configuring the gateway via emqx.conf requires changes on a per-node basis, but configuring it via Dashboard or the HTTP API will take effect across the cluster.
The MQTT-SN gateway only supports UDP and DTLS type listeners, for a complete list of configurable parameters refer to: Gateway Configuration - Listeners
# Authentication
Since the connection message of MQTT-SN protocol only given the Client ID of Client, there is no Username and Password. Therefore, the MQTT-SN gateway only supports HTTP Server Authentication.
The client information generation rules are as follows:
- Client ID: using the Client ID field of CONNECT message.
- Username: undefined
- Password: undefined
For example, to create an HTTP authentication for MQTT-SN gateway via HTTP API or emqx.conf:
# Publish/Subscribe
The MQTT-SN protocol already defines the publish/subscribe behavior, e.g:
- The PUBLISH message of the MQTT-SN protocol is used as a publishing operation, whose topic and QoS are specified by this message.
- The SUBSCRIBE message of the MQTT-SN protocol is used as a subscribing operation, whose topic and QoS are both specified by this message.
- The UNSUBSCRIBE message of the MQTT-SN protocol is used as an unsubscribe operation, whose topic is specified by this message.
There are no special authorization configurations within MQTT-SN gateway, and its permission control for topics needs to be configured Authorization.
# User Interfaces
- Detailed configuration options: Configuration - Stomp Gateway
- Detailed HTTP APIs Description: HTTP API - Gateway