Arduino based MQTT-SN Client
- ESP8266 ✅
- ESP32 ❎
- Arduino Mega ❎
- Arduino Uno ✅
UDP | TCP | Ethernet | WiFi | ZigBee | LoRa | BLE | |
---|---|---|---|---|---|---|---|
Arduino ESP8266 | ✅ | ✅ | ✅ | ❎* | ❎* | ||
Arduino ESP32 | ❎ | ❎ | ✅ | ❎* | ❎* | ❎ | |
Arduino Mega | ❎* | ❎* | ❎* | ❎* | ❎* | ||
Arduino Uno | ✅* | ✅* | ✅* | ❎* | ✅* |
* needs additional transmission hardware
- ✅ implemented and tested
- ❎ not implemented yet
For UDP we use the WiFiUdpMqttSnClient
example with a ESP8266
(e.g. NodeMCU v1.0).
You do not need additional hardware as mentioned in Transmission Technology to Platform Matrix. We tested it with the following Hardware:
- NodeMCU v1.0
We only need the arduino-mqtt-sn-client
library.
Perform the following steps for the ESP8266 UDP MQTT-SN Client:
- Download this library.
- Extract the archive and rename the folder to
arduino-mqtt-sn-client
then copy it to your Arduino library directory. - Restart your Arduino IDE if open.
- Select a ESP8266 board in the Arduino IDE.
- Open the example in
examples -> arduin-mqtt-sn-client -> esp8266 -> WiFiUdpMqttSnClient
. - Adapt
ssid
andpassword
to your WiFi network. - Change
gatewayIPAddress
andlocalUdpPort
to your MQTT-SN gateway's IPAddress and UDP port - Upload and try :)
For TCP we use the TcpMqttSnClient
example with a ESP8266
(e.g. NodeMCU v1.0).
You do not need additional hardware as mentioned in Transmission Technology to Platform Matrix. We tested it with the following Hardware:
- NodeMCU v1.0
We only need the arduino-mqtt-sn-client
library.
Perform the following steps for the ESP8266 TCP MQTT-SN Client:
- Download this library.
- Extract the archive and rename the folder to
arduino-mqtt-sn-client
then copy it to your Arduino library directory. - Restart your Arduino IDE if open.
- Select a ESP8266 board in the Arduino IDE.
- Open the example in
examples -> arduin-mqtt-sn-client -> esp8266 -> TcpMqttSnClient
. - Adapt
ssid
andpassword
to your WiFi network. - Change
gatewayIPAddress
andlocalTcpPort
to your MQTT-SN gateway's IPAddress and TCP port - Upload and try :)
For LoRa we use the RF95DatagramMqttSnClient
example with a Arduino Uno
. LoRa
on the physical layer and the RHDatagram
on the data link layer.
As mentioned in the Transmission Technology to Platform Matrix you need additional Hardware. We tested it with the following Hardware:
- Arduino Uno + Dragino LoRa Shield
- Arduino Uno + Dragino LoRa/GPS Shield
We only need the arduino-mqtt-sn-client
library and the airspayce RadioHead library.
Perform the following steps for the Arduino LoRa MQTT-SN Client:
- Download this library.
- Extract the archive and rename the folder to
arduino-mqtt-sn-client
then copy it to your Arduino library directory. - Download the airspayce RadioHead library from homepage. I tested it with version 1.87. Copy it into your Arduino Library directory.
- Extract the archive, then copy
RadioHead-1.87/RadioHead
into to your Arduino library directory. - Restart your Arduino IDE if open.
- Select the
Arduino/Genuino Uno
board in the Arduino IDE. - Open the example in
examples -> arduino-mqtt-sn-client -> rf95 -> RF95DatagramMqttSnClient
. - Adapt
OWN_ADDRESS
to your your MQTT-SN client'sRHDatagram
address. - Configuration LoRa by changing
FREQUENCY
,TX_POWER
andMODEM_CONFIG_CHOICE
- Change
MqttSnGateway_Address
to your MQTT-SN gateway'sRHDatagram
address. - Upload and try :)