WisMesh Setup Guide 2
Meshtastic device step-by-step setup guides for the RAKwireless RAK4631 (nRF52840), RAK11200 (ESP32) or RAK11310 (RP2040) modules as a gateway to a MQTT broker.
WisMesh MQTT Gateway Setup Guide
This is a step-by-step in setting up a WisMesh device as a gateway to a MQTT broker. It requires either of the following:
- a RAK11200 (ESP32), combined with a RAK13300 LoRa module
- a RAK4631 (nRF52840), combined with a RAK13800 Ethernet module.
- a RAK11310 (RP2040), combined with a RAK13800 Ethernet module.
Optionally, the RAK13800 Ethernet module can be enhanced to use PoE with the RAK19018 PoE module.
- The steps in this guide use the Android version of the Meshtastic app. The iOS version will be similar, but the user interface may differ.
- This guide assumes the Meshtastic nodes are already set up and connected to the Meshtastic network.
- Detailed instructions for the setup can be found in the WisMesh Basic Device Setup Guide.
Due to the different connectivity and required tools, this guide is divided into different sections:
- Set up a RAK4631 (nRF52840) module with the RAK13800 Ethernet module using the Meshtastic mobile app over BLE
- Set up a RAK11200 (ESP32) module using the Meshtastic mobile app over BLE
- Set up a RAK11310 (RP2040) module with the RAK13800 Ethernet module using the Meshtastic Web Client
- Configure the MQTT settings using the Meshtastic mobile app over BLE
- Configure the MQTT settings using the Meshtastic Web Client
Requirements
- RAK4631, RAK11200, or RAK11310 already set up as Meshtastic Node following the WisMesh Basic Device Setup Guide.
- Installed Meshtastic mobile app on an Android phone or an iOS device for use with the RAK4631 and RAK11200.
- Chrome browser to access the Meshtastic Web Client for the RAK11310.
Set Up RAK4631 (nRF52840) as Ethernet MQTT Gateway
Once the RAK4631 is set up as a Meshtastic node and has joined the network, only two steps are required to forward data from the Meshtastic network to an MQTT broker.
Enable Ethernet
- To enable the Ethernet, start by tapping the three dots in the top-right corner of the Meshtastic app. Then, choose Radio Configuration.
- Select the Network option.
- Under the Network Config, disable the Wi-Fi option.
- If the RAK13800 will be used, enable the Ethernet option and set it to IPV4 mode. Optionally, you can set up a different NTP server.
- Using the DHCP is the easiest way to connect the RAK13800 to an Ethernet network, as it automatically assign an IP address. If you need a fixed IP address, you can use STATIC option.
- With DHCP, a network scanner app can help find the assigned IP address of the WisMesh Ethernet Gateway. Alternatively, the IP address can be viewed in the debug output over the USB connection.
After integrating the new setup, the device will reboot and connect via Ethernet.
Unlike the RAK11200 with Wi-Fi, the RAK4631 uses BLE to connect to the Meshtastic mobile app.
Set Up RAK11200 (ESP32) as WiFi MQTT Gateway
Once the RAK11200 is setup as a Meshtastic Node and has joined the network, there are only two steps required to forward data from the Meshtastic Network to an MQTT Broker.
Enable Wi-Fi
- Click on the three dots on the top right side of the Meshtastic app. Then, select Radio Configuration.
- In the Radio Configuration options, choose Network.
The Network Config is for both Wi-Fi and a wired connection through Ethernet.
- Enable Wi-Fi and keep Ethernet disabled.
- Enter the Wi-Fi SSID that should be used and the Wi-Fi PSK for this Wi-Fi Network.
Optional (if available), you can scan a QR code with the Wi-Fi credentials.
The settings for the Network Time Provider (NTP) server are optional. You can use the default meshtastic.pool.ntp.org
or choose one that works better for your country.
Once the Meshtastic node is connected to the Wi-Fi network, the BLE connection to the Meshtastic mobile app is no longer available.
If you configure the device for a Wi-Fi network that you cannot access from your phone, such as an isolated guest access point on your router, you cannot access the device anymore. The only way to recover the device is to do a factory reset by reflashing the Meshtastic firmware.
Set Up RAK11310 (RP2040) as Ethernet MQTT Gateway
The Raspberry RP2040 MCU on the RAK11310 does not have Wi-Fi nor BLE connectivity. The only way to setup the device is through the Web Client.
Only Meshtastic firmware versions newer than 2.5.18 support the RAK13800 Ethernet module with the RAK11310 RP2040 Core module.
Connect the Device over USB to the Computer
It is not easy to determine the USB port the RAK11310 will use. To simplify this, it is recommended to disconnect all other devices that may be recognized as USB ports by the computer.
Connect the Device to the Web Client
- The Web Client using Web Serial API is only supported by a few browser. Refer to the Meshtastic documentation for the Web Client to find the list of supported browsers.
In this tutorial, the setup of the RAK11310 Meshtastic node is done using the Chrome browser and the hosted version of the Web Client.
Open the Web Client
- In your web browser, open the Meshtastic Web Client to start the Web Client.
Initially, the start screen will show that no devices are connected.
- Click on New Connection to set up the USB connection to the RAK11310.
- In the new window, select Serial as connection method.
- Based on the connected devices, a list will appear. Select the device corresponding to the RAK11310.
It is not easy to determine the USB port the RAK11310 will use. To simplify this, it is recommended to disconnect all other devices that may be recognized as USB ports by the computer.
If the correct USB port is selected, the Web Client screen will display initial information about the device, such as:
- Device name
- Battery status
- Meshtastic firmware version
- Navigate to Config > Radio Config > Network tab, then make sure that the Wi-Fi Config is disabled.
- Scroll down to see the IP Config and NTP Config settings.
- Using the DHCP is the easiest way to connect the RAK13800 to an Ethernet network, as it automatically assign an IP address. If you need a fixed IP address, you can use STATIC option.
- With DHCP, a network scanner app can help find the assigned IP address of the WisMesh Ethernet Gateway. Alternatively, the IP address can be viewed in the debug output over the USB connection.
- If the RAK13800 will be used, enable the Ethernet option and set it to IPV4 mode. Optionally, you can set up a different NTP server.
After integrating the new setup, the device will reboot and connect via Ethernet.
Connect to the MQTT Broker via the Meshtastic App
Setting up the MQTT broker connection with the Meshtastic mobile app works only with the RAK4631 and RAK11200 modules. For the RAK11310, refer to the Set Up RAK11310 (RP2040) as Ethernet MQTT Gateway section.
- Click on the three dots on the top right side of the Meshtastic app. Then, select Radio Configuration.
- In the Radio Configuration options, scroll down until the Module Configuration and select the MQTT.
- Toggle on the MQTT enabled and set the other parameters as desired.
- Any MQTT broker can be setup here. Depending on the broker, the settings will be different.
- The easiest option to start with is the free MQTT broker provided by Meshtastic. Refer to the Meshtastic documentation to find the URL, address, username, and password.
- Encryption enabled: refers to the option that allows data to be sent in an encrypted format after being processed by the MQTT broker. When enabled, a data processing function is required to decrypt the packets. Encryption is not enabled in this environment.
- JSON output enabled: an option that formats the data as a readable JSON packet. When enabled, the data is sent in JSON format. If not, the raw payload is sent as a byte array.
- Root topic: refers to a custom topic that helps reduce traffic. Using a custom root topic makes it easier to filter packets, whereas the default topic can make filtering more difficult. In this configuration, mesh is selected as the root topic.
- Map reporting: displays device locations on public Meshtastic maps, such as MeshMap.net. To show devices on these maps, Map reporting must be activated and a reporting interval specified.
MeshMap.net expects that the data is coming from the free Meshtastic MQTT broker.
This configuration is set up using a private MQTT broker.
An alternative setup using the free Meshtastic MQTT broker would look like this:
Connect to the MQTT Broker via the Meshtastic Web Client
- Connect the device to the Meshtastic Web Client as shown in Connect the device to the Web Client
- Once the device is connected, navigate to Config > Module Config > MQTT tab.
- Enable MQTT and set the other parameters as desired.
- Any MQTT broker can be setup here. Depending on the broker, the settings will be different.
- The easiest option to start with is the free MQTT broker provided by Meshtastic. Refer to the Meshtastic documentation to find the URL, address, username, and password.
- Encryption Enabled: refers to the option that allows data to be sent in an encrypted format after being processed by the MQTT broker. When enabled, a data processing function is required to decrypt the packets. Encryption is not enabled in this environment.
- JSON Enabled: an option that formats the data as a readable JSON packet. When enabled, the data is sent in JSON format. If not, the raw payload is sent as a byte array.
- Root topic: refers to a custom topic that helps reduce traffic. Using a custom root topic makes it easier to filter packets, whereas the default topic can make filtering more difficult. In this configuration, the default root topic is used.
This configuration is set up using the default settings, with the free Meshtastic MQTT Broker.