From db2f070fb4c3cc413337eac761b72f275ae4b895 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Mon, 31 Oct 2022 09:00:38 -0700 Subject: [PATCH 1/2] Encryption updates --- docs/software/mqtt/index.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/software/mqtt/index.mdx b/docs/software/mqtt/index.mdx index d112f92d..a3207548 100644 --- a/docs/software/mqtt/index.mdx +++ b/docs/software/mqtt/index.mdx @@ -7,9 +7,9 @@ sidebar_position: 4 ## Bridging networks -Meshtastic networks in different locations beyond the reach of LoRa can be easily bridged together using MQTT. The simplest option is to connect your mesh to the official Meshtastic MQTT broker. This makes your devices appear on the world map, and provides a copy of your mesh traffic, translated into JSON. All you have to do to join the public MQTT server is to Enable MQTT and set uplink and downlink on the channels that you want to share over MQTT. +Meshtastic networks in different locations beyond the reach of LoRa can be easily bridged together using MQTT. The simplest option is to connect your mesh to the official Meshtastic MQTT broker. This makes your devices appear on the world map, and provides a copy of your mesh traffic, translated into JSON. All you have to do to join the public MQTT server is to Enable MQTT and set uplink and downlink on the channels that you want to share over MQTT. The default device configuration using the public MQTT Server is encrypted. -You can also share channel settings with a remote network and enable encryption for MQTT, encryption is off by default for MQTT. You can also specify your own private MQTT broker and specify authentication for that broker to bridge several mesh networks together, via the internet (or just a local IP network). +You can also share channel settings with a remote network. If you use the default meshtastic MQTT server, packets are always encrypted. If you use a custom MQTT broker (ie set `mqtt.address`), the `mqtt.encryption_enabled` setting applies, which by default is false. You can also specify your own private MQTT broker and specify authentication for that broker to bridge several mesh networks together, via the internet (or just a local IP network). You can find the settings available for MQTT [here](https://meshtastic.org/docs/settings/moduleconfig/mqtt). @@ -19,7 +19,7 @@ Using or emitting packets directly in/from smart home control software such as H When MQTT is enabled, the Meshtastic device simply uplinks and/or downlinks every raw protobuf packet that it sees to the MQTT broker. In addition, some packet types are serialized or deserialized from/to JSON messages for easier use in consumers. All packets are sent to the broker, whether they originate from another device on the mesh, or the gateway node itself. -Packets may be encrypted. If you use the default meshtastic MQTT server, packets are always encrypted. If you use a custom MQTT broker (ie set `mqtt_server`), the `mqtt_encryption_enabled` setting applies, which by default is false. +Packets may be encrypted. If you use the default meshtastic MQTT server, packets are always encrypted. If you use a custom MQTT broker (ie set `mqtt.address`), the `mqtt.encryption_enabled` setting applies, which by default is false. IMPORTANT: When MQTT is turned on, you are potentially broadcasting your entire mesh traffic onto the public internet. This includes messages and position information. From 58b80dd343a8e47175c3ce639dc178e71f42cdcb Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Mon, 31 Oct 2022 10:45:51 -0700 Subject: [PATCH 2/2] Add envelope details --- docs/software/mqtt/index.mdx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/software/mqtt/index.mdx b/docs/software/mqtt/index.mdx index a3207548..61f71062 100644 --- a/docs/software/mqtt/index.mdx +++ b/docs/software/mqtt/index.mdx @@ -227,6 +227,15 @@ if __name__ == '__main__': ### Using MQTT with Node-RED +Below is a valid json envelope for information sent by MQTT to a device for broadcast onto the mesh. + ``` + { + "sender":"whatever you want to be the SENDER", + "type":"sendtext", + "payload": text or a json object go here + } + ``` + Node-RED is a free cross-platform programming tool for wiring together hardware, APIs, and online services developed originally by IBM for IOT. It is widely used for home automation by many non-professional programmers and runs well on Pi's. Node-red has many plug-in modules written by the community. I will use this platform as a practical example on how to interface with the MQTT features of Meshtastic. Everything can be done from GUI's without using command line. Step one: use http://client.meshtastic.org/ one of the Apple apps or the CLI to connect to your device and adjust these settings.