PageSourceSearch

https://meshtastic-bice.vercel.app/assets/js/2dd70af5.868193e2.js

js meshtastic-bice.vercel.app collected 2026-10-03 07:21:00 UTC 49,146 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkmeshtastic=self.webpackChunkmeshtastic||[]).push([["23873"],{98992(e,n,t){t.r(n),t.d(n,{metadata:()=>o,default:()=>p,frontMatter:()=>d,contentTitle:()=>r,toc:()=>l,assets:()=>c});var o=JSON.parse('{"id":"software/integrations/mqtt/nodered","title":"Node-RED","description":"Using MQTT with Node-RED","source":"@site/versioned_docs/version-2.7/software/integrations/mqtt/nodered.mdx","sourceDirName":"software/integrations/mqtt","slug":"/software/integrations/mqtt/nodered","permalink":"/docs/2.7/software/integrations/mqtt/nodered","draft":false,"unlisted":false,"tags":[],"version":"2.7","lastUpdatedBy":"rcarteraz","sidebarPosition":3,"frontMatter":{"id":"nodered","title":"Node-RED","sidebar_label":"Node-RED","sidebar_position":3},"sidebar":"Sidebar","previous":{"title":"Python","permalink":"/docs/2.7/software/integrations/mqtt/mqtt-python"},"next":{"title":"Home Assistant","permalink":"/docs/2.7/software/integrations/mqtt/home-assistant"}}'),s=t(91987),i=t(67008),a=t(87622);let d={id:"nodered",title:"Node-RED",sidebar_label:"Node-RED",sidebar_position:3},r,c={},l=[{value:"Using MQTT with Node-RED",id:"using-mqtt-with-node-red",level:2},{value:"Enabling MQTT",id:"enabling-mqtt",level:3},{value:"Using Node-RED with Meshtastic",id:"using-node-red-with-meshtastic",level:3},{value:"1. Using JSON-encoded messages",id:"1-using-json-encoded-messages",level:4},{value:"2. Using protobuf-encoded messages with the Meshtastic decode node",id:"2-using-protobuf-encoded-messages-with-the-meshtastic-decode-node",level:4},{value:"3. Using protobuf-encoded messages with a protobuf decode node and the Meshtastic protobuf definitions",id:"3-using-protobuf-encoded-messages-with-a-protobuf-decode-node-and-the-meshtastic-protobuf-definitions",level:4}];function h(e){let n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",em:"em",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",ul:"ul",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h2,{id:"using-mqtt-with-node-red",children:"Using MQTT with Node-RED"}),"\n",(0,s.jsx)(n.p,{children:"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."}),"\n",(0,s.jsxs)(n.p,{children:["I will use this platform as a practical example on how to interface with the ",(0,s.jsx)(a.A,{term:"MQTT",definition:"A lightweight messaging protocol designed for small sensors and mobile devices, enabling efficient data transmission in the Meshtastic network for Internet connectivity and integration with IoT platforms. See https://en.wikipedia.org/wiki/MQTT. In Meshtastic, MQTT is used to connect a node to the internet, and can be used to connect multiple meshes to each other.",routePath:"/docs/terms/",children:"MQTT"})," features of Meshtastic. Everything can be done from GUI's without using command line."]}),"\n",(0,s.jsx)(n.h3,{id:"enabling-mqtt",children:"Enabling MQTT"}),"\n",(0,s.jsxs)(n.p,{children:["Use ",(0,s.jsx)(n.a,{href:"http://client.meshtastic.org/",children:"http://client.meshtastic.org/"})," , the python ",(0,s.jsx)(a.A,{term:"CLI",definition:"A text-based interface used for interacting with software or devices like Meshtastic.",routePath:"/docs/terms/",children:"CLI"}),", or an Apple or Android app to connect to your device and adjust these settings."]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Settings--\x3e Radio Config--\x3e Network"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["On the node that will act as the gateway between the mesh and ",(0,s.jsx)(a.A,{term:"MQTT",definition:"A lightweight messaging protocol designed for small sensors and mobile devices, enabling efficient data transmission in the Meshtastic network for Internet connectivity and integration with IoT platforms. See https://en.wikipedia.org/wiki/MQTT. In Meshtastic, MQTT is used to connect a node to the internet, and can be used to connect multiple meshes to each other.",routePath:"/docs/terms/",children:"MQTT"})," enable a network connection (i.e. Wifi, Ethernet)."]}),"\n",(0,s.jsx)(n.li,{children:"Save"}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Settings--\x3e Module Config--\x3e ",(0,s.jsx)(a.A,{term:"MQTT",definition:"A lightweight messaging protocol designed for small sensors and mobile devices, enabling efficient data transmission in the Meshtastic network for Internet connectivity and integration with IoT platforms. See https://en.wikipedia.org/wiki/MQTT. In Meshtastic, MQTT is used to connect a node to the internet, and can be used to connect multiple meshes to each other.",routePath:"/docs/terms/",children:"MQTT"})," config"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Configure the ",(0,s.jsx)(a.A,{term:"MQTT",definition:"A lightweight messaging protocol designed for small sensors and mobile devices, enabling efficient data transmission in the Meshtastic network for Internet connectivity and integration with IoT platforms. See https://en.wikipedia.org/wiki/MQTT. In Meshtastic, MQTT is used to connect a node to the internet, and can be used to connect multiple meshes to each other.",routePath:"/docs/terms/",children:"MQTT"})," gateway's network configuration."]}
1),"\n",(0,s.jsx)(n.li,{children:"Verify Encryption Enabled is OFF."}),"\n",(0,s.jsx)(n.li,{children:"(optional) Turn JSON Output Enabled ON."}),"\n",(0,s.jsx)(n.li,{children:"Save"}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"Channel Editor"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Go to Channel Editor and enable Uplink and Downlink on the channels you wish to publish to ",(0,s.jsx)(a.A,{term:"MQTT",definition:"A lightweight messaging protocol designed for small sensors and mobile devices, enabling efficient data transmission in the Meshtastic network for Internet connectivity and integration with IoT platforms. See https://en.wikipedia.org/wiki/MQTT. In Meshtastic, MQTT is used to connect a node to the internet, and can be used to connect multiple meshes to each other.",routePath:"/docs/terms/",children:"MQTT"}),"."]}),"\n",(0,s.jsx)(n.li,{children:"Save"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"using-node-red-with-meshtastic",children:"Using Node-RED with Meshtastic"}),"\n",(0,s.jsx)(n.p,{children:"There are three common approaches:"}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsx)(n.li,{children:"Using JSON-encoded messages"}),"\n",(0,s.jsxs)(n.li,{children:["Using ",(0,s.jsx)(a.A,{term:"Protobuf",definition:"A method developed by Google for serializing structured data, used in Meshtastic for efficient communication protocol between devices.",routePath:"/docs/terms/",children:"protobuf"}),"-encoded messages with the Meshtastic decode node"]}),"\n",(0,s.jsxs)(n.li,{children:["Using ",(0,s.jsx)(a.A,{term:"Protobuf",definition:"A method developed by Google for serializing structured data, used in Meshtastic for efficient communication protocol between devices.",routePath:"/docs/terms/",children:"protobuf"}),"-encoded messages with a ",(0,s.jsx)(a.A,{term:"Protobuf",definition:"A method developed by Google for serializing structured data, used in Meshtastic for efficient communication protocol between devices.",routePath:"/docs/terms/",children:"protobuf"})," decode node and the Meshtastic ",(0,s.jsx)(a.A,{term:"Protobuf",definition:"A method developed by Google for serializing structured data, used in Meshtastic for efficient communication protocol between devices.",routePath:"/docs/terms/",children:"protobuf"})," definitions"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"The JSON output only publishes the following subset of the messages on a Meshtastic network:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Text Message"}),"\n",(0,s.jsxs)(n.li,{children:["Telemetry","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Device Metrics"}),"\n",(0,s.jsx)(n.li,{children:"Environment Metrics"}),"\n",(0,s.jsx)(n.li,{children:"Power Metrics"}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.li,{children:"Node Info"}),"\n",(0,s.jsx)(n.li,{children:"Position"}),"\n",(0,s.jsx)(n.li,{children:"Waypoint"}),"\n",(0,s.jsx)(n.li,{children:"Neighbor Info"}),"\n"]}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsx)(n.p,{children:"JSON is intended to be a convenience for consuming data in other applications like Home Assistant."}),"\n"]}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(a.A,{term:"Protobuf",definition:"A method developed by Google for serializing structured data, used in Meshtastic for efficient communication protocol between devices.",routePath:"/docs/terms/",children:"Protobufs"})," are mesh native."]}),"\n"]}),"\n",(0,s.jsx)(n.h4,{id:"1-using-json-encoded-messages",children:"1. Using JSON-encoded messages"}),"\n",(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsxs)(n.p,{children:["JSON is not supported on the ",(0,s.jsx)(a.A,{term:"nRF52",definition:"A microcontroller chipset made by Nordic, used by several devices such as the RAK Meshtastic Starter Kit and the Lilygo T-Echo. Lower power usage than ESP32.",routePath:"/docs/terms/",children:"nRF52"})," platform."]})}),"\n",(0,s.jsxs)(n.p,{children:["Make sure that option ",(0,s.jsx)(n.em,{children:"JSON Output Enabled"})," is set in ",(0,s.jsx)(a.A,{term:"MQTT",definition:"A lightweight messaging protocol designed for small sensors and mobile devices, enabling efficient data transmission in the Meshtastic network for Internet connectivity and integration with IoT platforms. See https://en.wikipedia.org/wiki/MQTT. In Meshtastic, MQTT is used to connect a node to the internet, and can be used to connect multiple meshes to each other.",routePath:"/docs/terms/",children:"MQTT"}),' module options and you have a channel called "',(0,s.jsx)(a.A,{term:"MQTT",definition:"A lightweight messaging protocol designed for small sensors and mobile devices, enabling efficient data transmission in the Meshtastic network for Internet connectivity and integration with IoT platforms. See https://en.wikipedia.org/wiki/MQTT. In Meshtastic, MQTT is used to connect a node to the internet, and can be used to connect multiple meshes to each other.",routePath:"/docs/terms/",children:"mqtt"}),'".']}),"\n",(0,s.jsxs)(n.p,{children:["Below is a valid JSON envelope for information sent by ",(0,s.jsx)(a.A,{term:"MQTT",definition:"A lightweight messaging protocol designed for small sensors and mobile devices, enabling efficient data transmission in the Meshtastic network for Internet connectivity and integration with IoT platforms. See https://en.wikipedia.org/wiki/MQTT. In Meshtastic, MQTT is used to connect a node to the internet, and can be used to connect multiple meshes to each other.",routePath:"/docs/terms/",children:"MQTT"})," to a device for broadcast onto the mesh. The ",(0,s.jsx)(n.code,{children:"to"})," field is optional and can be omitted for broadcast. The ",(0,s.jsx)(n.code,{children:"channel"})," field is also optional and can be omitted to send to the primary channel."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-json",children:'{\n  "from":<node number of the transmitter>,\n  "to": <node number of the receiver for a DM (optional)>,\n  "channel": <channel index (optional)>,\n  "type":"sendtext",\n  "payload": text or a json object go here\n}\n'})}),"\n",(0,s.jsx)(n.h4,{id:"2-using-protobuf-encoded-messages-with-the-meshtastic-decode-node",children:"2. Using protobuf-encoded messages with the Meshtastic decode node"}),"\n",(0,s.jsxs)(n.p,{children:["Install Node-Red plug-in:\n",(0,s.jsx)(n.a,{href:"https://flows.nodered.org/node/@meshtastic/node-red-contrib-meshtastic",children:"https://flows.nodered.org/node/@meshtastic/node-red-contrib-meshtastic"})]}),"\n",(0,s.jsx)(n.p,{children:"More info is in the plug-in source repository."}),"\n",(0,s.jsxs)(n.p,{children:["There is an example flow using this mechanism available\n",(0,s.jsx)(n.a,{href:"https://github.com/scruplelesswizard/meshtastic-node-red",children:"https://github.com/scruplelesswizard/meshtastic-node-red"})]}),"\n",(0,s.jsx)(n.h4,{id:"3-using-protobuf-encoded-messages-with-a-protobuf-decode-node-and-the-meshtastic-protobuf-definitions",children:"3. Using protobuf-encoded messages with a protobuf decode node and the Meshtastic protobuf definitions"}),"\n",(0,s.jsxs)(n.p,{children:["If you don't want to depend on JSON decoding on the device, you can decode the ",(0,s.jsx)(a.A,{term:"Protobuf",definition:"A method developed by Google for serializing structured data, used in Meshtastic for efficient communication protocol between devices.",routePath:"/docs/terms/",children:"protobuf"})," messages off-device. To do that you will need to get the .proto files from ",(0,s.jsx)(n.a,{href:"https://github.com/meshtastic/protobufs",children:"https://github.com/meshtastic/protobufs"}),'. They function as a schema and are required for decoding in Node-RED. Save the files where the node-RED application can access them and note the file path of the "',(0,s.jsx)(a.A,{term:"MQTT",definition:"A lightweight messaging protocol designed for small sensors and mobile devices, enabling efficient data transmission in the Meshtastic network for Internet connectivity and integration with IoT platforms. See https://en.wikipedia.org/wiki/MQTT. In Meshtastic, MQTT is used to connect a node to the internet, and can be used to connect multiple meshes to each other.",routePath:"/docs/terms/",children:"mqtt"}),'.proto" file.']}),"\n",(0,s.jsxs)(n.p,{children:["Install Node-RED plug-ins to your Node-RED application for an embedded ",(0,s.jsx)(a.A,{term:"MQTT",definition:"A lightweight messaging protocol designed for small sensors and mobile devices, enabling efficient data transmission in the Meshtastic network for Internet connectivity and integration with IoT platforms. See https://en.wikipedia.org/wiki/MQTT. In Meshtastic, MQTT is used to connect a node to the internet, and can be used to connect multiple meshes to each other.",routePath:"/docs/terms/",children:"MQTT"})," server and a ",(0,s.jsx)(a.A,{term:"Protobuf",definition:"A method developed by Google for serializing structured data, used in Meshtastic for efficient communication protocol between devices.",routePath:"/docs/terms/",children:"protobuf"})," decoder.\n",(0,s.jsx)(n.a,{href:"https://flows.nodered.org/node/node-red-contrib-aedes",children:"https://flows.nodered.org/node/node-red-contrib-aedes"}),"\n",(0,s.jsx)(n.a,{href:"https://flows.nodered.org/node/node-red-contrib-protobuf",children:"https://flows.nodered.org/node/node-red-contrib-protobuf"})]}),"\n",(0,s.jsxs)(n.p,{children:["Drag, drop, and wire the nodes like this. For this example, I ran Node-RED on a Windows machine. Note that file paths might be specified differently on different platforms. ",(0,s.jsx)(a.A,{term:"MQTT",definition:"A lightweight messaging protocol designed for small sensors and mobile devices, enabling efficient data transmission in the Meshtastic network for Internet connectivity and integration with IoT platforms. See https://en.wikipedia.org/wiki/MQTT. In Meshtastic, MQTT is used to connect a node to the internet, and can be used to connect multiple meshes to each other.",routePath:"/docs/terms/",children:"MQTT"}),' server wild cards are usually the same. A "+" is a single level wildcard for a specific topic level. A "#" is a multiple level wildcard that can be used at the end of a topic filter. The debug messages shown are what happens when the inject button sends a JSON message with a topic designed to be picked up by the specified Meshtastic device and then having it rebroadcast the message.']}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:t(38826).A+"",children:(0,s.jsx)("img",{src:"/documents/mqtt/NodeRedTwo.webp",alt:"Node-RED flow wiring the MQTT and Meshtastic nodes",style:{zoom:"50%"}})}),"\n",(0,s.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:t(99108).A+"",children:(0,s.jsx)("img",{src:"/documents/mqtt/NodeRedThree.webp",alt:"Node-RED debug output from the wired flow",style:{zoom:"50%"}})}),"\n",(0,s.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:t(69495).A+"",children:(0,s.jsx)("img",{src:"/documents/mqtt/NR_nodes.webp",alt:"Node-RED node palette for the Meshtastic flow",style:{zoom:"50%"}})})]}),"\n",(0,s.jsxs)(n.p,{children:["The aedes broker must be set up on the same flow as the other nodes. By activating the Publish debug node, you can see all the published messages.\n",(0,s.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:t(1911).A+"",children:(0,s.jsx)("img",{src:"/documents/mqtt/Broker1.webp",alt:"Node-RED aede
1s MQTT broker node with publish debug output",style:{zoom:"50%"}})}),"\nReceiving a json ",(0,s.jsx)(a.A,{term:"MQTT",definition:"A lightweight messaging protocol designed for small sensors and mobile devices, enabling efficient data transmission in the Meshtastic network for Internet connectivity and integration with IoT platforms. See https://en.wikipedia.org/wiki/MQTT. In Meshtastic, MQTT is used to connect a node to the internet, and can be used to connect multiple meshes to each other.",routePath:"/docs/terms/",children:"mqtt"})," message is very simple.\n",(0,s.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:t(95149).A+"",children:(0,s.jsx)("img",{src:"/documents/mqtt/Consume.webp",alt:"Node-RED flow consuming a JSON MQTT message",style:{zoom:"50%"}})}),"\nInjecting a json message to be sent by a device is also very simple. You do need the correct envelope.\n",(0,s.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:t(29692).A+"",children:(0,s.jsx)("img",{src:"/documents/mqtt/Inject.webp",alt:"Node-RED inject node sending a JSON message to a device",style:{zoom:"50%"}})}),"\nForwarding a text message from one device, through a broker, to another broker/device/channel would look like this.\n",(0,s.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:t(15662).A+"",children:(0,s.jsx)("img",{src:"/documents/mqtt/Forward.webp",alt:"Node-RED flow forwarding a text message between brokers",style:{zoom:"50%"}})}),"\nIf you want to decode text and position messages without json, it gets complicated:\n",(0,s.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:t(36453).A+"",children:(0,s.jsx)("img",{src:"/documents/mqtt/DecodeNewest.webp",alt:"Node-RED flow decoding text and position messages without JSON",style:{zoom:"50%"}})}),"\nIf you are interested in my flow for this it is here:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-json",children:'[\n  {\n    "id": "10fe1b2e9cb3feb2",\n    "type": "decode",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "decode Protobuf",\n    "protofile": "a0d4288141f6a629",\n    "protoType": "ServiceEnvelope",\n    "x": 295.5,\n    "y": 285,\n    "wires": [["d3e396cf4f0a9608", "d08865b41a69d85d", "6f592d47b6a2eac4"]]\n  },\n  {\n    "id": "40c9ee66fe7a34cb",\n    "type": "function",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "function get the message as string from TEXT_MESSAGE_APP",\n    "func": "msg.payload = msg.payload.packet.decoded.payload;\\n\\nlet bufferObj = Buffer.from(msg.payload, \\"base64\\");\\nlet decodedString = bufferObj.toString(\\"utf8\\");\\nmsg.payload = decodedString;\\n\\nreturn msg;",\n    "outputs": 1,\n    "noerr": 0,\n    "initialize": "",\n    "finalize": "",\n    "libs": [],\n    "x": 410.5,\n    "y": 450,\n    "wires": [["553374591214eaca"]]\n  },\n  {\n    "id": "553374591214eaca",\n    "type": "debug",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "text message out",\n    "active": true,\n    "tosidebar": true,\n    "console": false,\n    "tostatus": false,\n    "complete": "payload",\n    "targetType": "msg",\n    "statusVal": "",\n    "statusType": "auto",\n    "x": 762.5,\n    "y": 449,\n    "wires": []\n  },\n  {\n    "id": "c6afbb9f1665b162",\n    "type": "debug",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "channelId",\n    "active": false,\n    "tosidebar": true,\n    "console": false,\n    "tostatus": false,\n    "complete": "payload",\n    "targetType": "msg",\n    "statusVal": "",\n    "statusType": "auto",\n    "x": 785.5,\n    "y": 257,\n    "wires": []\n  },\n  {\n    "id": "607ef387d5701985",\n    "type": "debug",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "gatewayId",\n    "active": false,\n    "tosidebar": true,\n    "console": false,\n    "tostatus": false,\n    "complete": "payload",\n    "targetType": "msg",\n    "statusVal": "",\n    "statusType": "auto",\n    "x": 792.5,\n    "y": 293,\n    "wires": []\n  },\n  {\n    "id": "d3e396cf4f0a9608",\n    "type": "debug",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "entire payload",\n    "active": false,\n    "tosidebar": true,\n    "console": false,\n    "tostatus": false,\n    "complete": "payload",\n    "targetType": "msg",\n    "statusVal": "",\n    "statusType": "auto",\n    "x": 296.5,\n    "y": 247,\n    "wires": []\n  },\n  {\n    "id": "2339b328bb9bb1d8",\n    "type": "comment",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "Decode all cleartext text and position messages sent by Meshtastic devices into JSON without relying on JSON conversion on the device.",\n    "info": "",\n    "x": 515.5,\n    "y": 214,\n    "wires": []\n  },\n  {\n    "id": "408d796d997bb832",\n    "type": "function",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "function get the nested payload as base64",\n    "func": "msg.payload = msg.payload.packet.decoded.payload;\\n\\nlet bufferObj = Buffer.from(msg.payload, \\"base64\\");\\n//let decodedString = bufferObj.toString(\\"hex\\");\\nmsg.payload = bufferObj;\\nmsg.topic=\\"\\";\\n//if you don\'t zero out the protubufTopic it will try to\\n//decode it as part of the mqtt service envelope instead\\n//of two-stage decoding\\nmsg.protobufType=null;\\n\\nreturn msg;",\n    "outputs": 1,\n    "noerr": 0,\n    "initialize": "",\n    "finalize": "",\n    "libs": [],\n    "x": 349,\n    "y": 552,\n    "wires": [["9435a3c605efedb4", "1ed6f96c8214d7b3"]]\n  },\n  {\n    "id": "61995c9f8e8266b3",\n    "type": "debug",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "portnum",\n    "active": false,\n    "tosidebar": true,\n    "console": false,\n    "tostatus": false,\n    "complete": "payload",\n    "targetType": "msg",\n    "statusVal": "",\n    "statusType": "auto",\n    "x": 784.5,\n    "y": 330,\n    "wires": []\n  },\n  {\n    "id": "9435a3c605efedb4",\n    "type": "debug",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "nested payload",\n    "active": false,\n    "tosidebar": true,\n    "console": false,\n    "tostatus": false,\n    "complete": "true",\n    "targetType": "full",\n    "statusVal": "",\n    "statusType": "auto",\n    "x": 281.5,\n    "y": 603,\n    "wires": []\n  },\n  {\n    "id": "b832775d386f7ac9",\n    "type": "mqtt in",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "",\n    "topic": "msh/+/c/#",\n    "qos": "2",\n    "datatype": "buffer",\n    "broker": "37cadac381653b1e",\n    "nl": false,\n    "rap": true,\n    "rh": 0,\n    "inputs": 0,\n    "x": 117.5,\n    "y": 286,\n    "wires": [["10fe1b2e9cb3feb2"]]\n  },\n  {\n    "id": "d08865b41a69d85d",\n    "type": "switch",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "switch manual decoding nested message based on portnum",\n    "property": "payload.packet.decoded.portnum",\n    "propertyType": "msg",\n    "rules": [\n      { "t": "eq", "v": "TEXT_MESSAGE_APP", "vt": "str" },\n      { "t": "eq", "v": "POSITION_APP", "vt": "str" }\n    ],\n    "checkall": "true",\n    "repair": false,\n    "outputs": 2,\n    "x": 281.5,\n    "y": 505,\n    "wires": [["40c9ee66fe7a34cb"], ["408d796d997bb832"]]\n  },\n  {\n    "id": "8abb1bb458af2c4f",\n    "type": "change",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "",\n    "rules": [\n      {\n        "t": "set",\n        "p": "gatewayId",\n        "pt": "flow",\n        "to": "payload",\n        "tot": "msg"\n      }\n    ],\n    "action": "",\n    "property": "",\n    "from": "",\n    "to": "",\n    "reg": false,\n    "x": 1021.5,\n    "y": 288,\n    "wires": [[]]\n  },\n  {\n    "id": "1ced0be28eeef0d3",\n    "type": "change",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "",\n    "rules": [\n      {\n        "t": "set",\n        "p": "latitude",\n        "pt": "flow",\n        "to": "payload",\n        "tot": "msg"\n      }\n    ],\n    "action": "",\n    "property": "",\n    "from": "",\n    "to": "",\n    "reg": false,\n    "x": 1026.5,\n    "y": 407,\n    "wires": [[]]\n  },\n  {\n    "id": "313fd3cfe6d91850",\n    "type": "change",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "",\n    "rules": [\n      {\n        "t": "set",\n        "p": "longitude",\n        "pt": "flow",\n        "to": "payload",\n        "tot": "msg"\n      }\n    ],\n    "action": "",\n    "property": "",\n    "from": "",\n    "to": "",\n    "reg": false,\n    "x": 1036.5,\n    "y": 450,\n    "wires": [["d02e53cdfb565da6"]]\n  },\n  {\n    "id": "33dd43e3c05f826c",\n    "type": "geofence",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "geofence",\n    "mode": "circle",\n    "inside": "true",\n    "rad": 69174.91569647488,\n    "points": [],\n    "centre": {\n      "latitude": 40.16287050252407,\n      "longitude": -86.60385131835938\n    },\n    "floor": "",\n    "ceiling": "",\n    "worldmap": true,\n    "outputs": 2,\n    "x": 1202.5,\n    "y": 595,\n    "wires": [[], ["4d01eb8f1b31f039"]]\n  },\n  {\n    "id": "d02e53cdfb565da6",\n    "type": "function",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "trigger function to send a mapping point",\n    "func": "let lat = parseFloat(flow.get(\\"latitude\\"));\\nlet lon = parseFloat(flow.get(\\"longitude\\"));\\nlat=lat * 0.0000001;\\nlon=lon * 0.0000001;\\nlet name = flow.get(\\"from\\")\\n\\nmsg={\\"payload\\":{\\"name\\":name,\\n \\"lat\\":lat,\\n  \\"lon\\":lon,\\n   \\"action\\":\\"send\\",\\n   \\"icon\\": \\"car\\",\\n   \\"label\\":name\\n   }}
1\\n\\nreturn msg;",\n    "outputs": 1,\n    "noerr": 0,\n    "initialize": "",\n    "finalize": "",\n    "libs": [],\n    "x": 1181.5,\n    "y": 520,\n    "wires": [["33dd43e3c05f826c", "4d01eb8f1b31f039"]]\n  },\n  {\n    "id": "4d01eb8f1b31f039",\n    "type": "worldmap",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "",\n    "lat": "40",\n    "lon": "-86",\n    "zoom": "7",\n    "layer": "OSMG",\n    "cluster": "",\n    "maxage": "",\n    "usermenu": "show",\n    "layers": "show",\n    "panit": "false",\n    "panlock": "false",\n    "zoomlock": "false",\n    "hiderightclick": "false",\n    "coords": "none",\n    "showgrid": "false",\n    "showruler": "false",\n    "allowFileDrop": "false",\n    "path": "/worldmap",\n    "overlist": "DR,CO,RA,DN,HM",\n    "maplist": "OSMG,OSMC,EsriC,EsriS,EsriT,EsriDG,UKOS",\n    "mapname": "",\n    "mapurl": "",\n    "mapopt": "",\n    "mapwms": false,\n    "x": 1206.5,\n    "y": 675,\n    "wires": []\n  },\n  {\n    "id": "1ed6f96c8214d7b3",\n    "type": "decode",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "decode Position Protobuf",\n    "protofile": "dbab6472b07929a0",\n    "protoType": "Position",\n    "x": 667.5,\n    "y": 548,\n    "wires": [["db1933ba36503bd9", "dad9f487318f21d9"]]\n  },\n  {\n    "id": "db1933ba36503bd9",\n    "type": "debug",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "Position decoded",\n    "active": false,\n    "tosidebar": true,\n    "console": false,\n    "tostatus": false,\n    "complete": "true",\n    "targetType": "full",\n    "statusVal": "",\n    "statusType": "auto",\n    "x": 673.5,\n    "y": 607,\n    "wires": []\n  },\n  {\n    "id": "dad9f487318f21d9",\n    "type": "function",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "Split",\n    "func": "var lat = { payload: msg.payload.latitudeI };\\nvar lon = { payload: msg.payload.longitudeI };\\nvar alt = { payload: msg.payload.altitude };\\nvar tm = { payload: msg.payload.time };\\n\\nreturn [lat,lon,alt,tm];",\n    "outputs": 4,\n    "noerr": 0,\n    "initialize": "",\n    "finalize": "",\n    "libs": [],\n    "x": 875.5,\n    "y": 549,\n    "wires": [\n      ["1ced0be28eeef0d3", "8bb97f802662976c"],\n      ["313fd3cfe6d91850", "c8e135f3e542bb1b"],\n      ["602fb2020680280c"],\n      ["ed424ae3d45dd2ac"]\n    ]\n  },\n  {\n    "id": "8bb97f802662976c",\n    "type": "debug",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "lat",\n    "active": true,\n    "tosidebar": true,\n    "console": false,\n    "tostatus": false,\n    "complete": "payload",\n    "targetType": "msg",\n    "statusVal": "",\n    "statusType": "auto",\n    "x": 1017.5,\n    "y": 583,\n    "wires": []\n  },\n  {\n    "id": "c8e135f3e542bb1b",\n    "type": "debug",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "lon",\n    "active": true,\n    "tosidebar": true,\n    "console": false,\n    "tostatus": false,\n    "complete": "payload",\n    "targetType": "msg",\n    "statusVal": "",\n    "statusType": "auto",\n    "x": 1018.5,\n    "y": 618,\n    "wires": []\n  },\n  {\n    "id": "602fb2020680280c",\n    "type": "debug",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "alt",\n    "active": true,\n    "tosidebar": true,\n    "console": false,\n    "tostatus": false,\n    "complete": "payload",\n    "targetType": "msg",\n    "statusVal": "",\n    "statusType": "auto",\n    "x": 1017.5,\n    "y": 654,\n    "wires": []\n  },\n  {\n    "id": "ed424ae3d45dd2ac",\n    "type": "debug",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "time",\n    "active": true,\n    "tosidebar": true,\n    "console": false,\n    "tostatus": false,\n    "complete": "payload",\n    "targetType": "msg",\n    "statusVal": "",\n    "statusType": "auto",\n    "x": 1018.5,\n    "y": 688,\n    "wires": []\n  },\n  {\n    "id": "6f592d47b6a2eac4",\n    "type": "function",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "Split Decoded 1",\n    "func": "var channelId = { payload: msg.payload.channelId};\\nvar gatewayId = { payload: msg.payload.gatewayId};\\nvar portnum = { payload: msg.payload.packet.decoded.portnum};\\nvar fr= {payload: \\"!\\" + msg.payload.packet.from.toString(16)};\\nvar to = {payload:\\"!\\"+ msg.payload.packet.to.toString(16)};\\n\\nreturn [channelId, gatewayId, portnum, fr, to ];",\n    "outputs": 5,\n    "noerr": 0,\n    "initialize": "",\n    "finalize": "",\n    "libs": [],\n    "x": 577.5,\n    "y": 294,\n    "wires": [\n      ["c6afbb9f1665b162"],\n      ["607ef387d5701985", "8abb1bb458af2c4f"],\n      ["61995c9f8e8266b3"],\n      ["fd881fac22422773", "a389f9875da672ec"],\n      ["cf
1066ad415df30ae"]\n    ]\n  },\n  {\n    "id": "fd881fac22422773",\n    "type": "debug",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "from",\n    "active": true,\n    "tosidebar": true,\n    "console": false,\n    "tostatus": false,\n    "complete": "payload",\n    "targetType": "msg",\n    "statusVal": "",\n    "statusType": "auto",\n    "x": 772.5,\n    "y": 365,\n    "wires": []\n  },\n  {\n    "id": "cf066ad415df30ae",\n    "type": "debug",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "to",\n    "active": false,\n    "tosidebar": true,\n    "console": false,\n    "tostatus": false,\n    "complete": "payload",\n    "targetType": "msg",\n    "statusVal": "",\n    "statusType": "auto",\n    "x": 771.5,\n    "y": 399,\n    "wires": []\n  },\n  {\n    "id": "a389f9875da672ec",\n    "type": "change",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "set flow.from",\n    "rules": [\n      { "t": "set", "p": "from", "pt": "flow", "to": "payload", "tot": "msg" }\n    ],\n    "action": "",\n    "property": "",\n    "from": "",\n    "to": "",\n    "reg": false,\n    "x": 1012.5,\n    "y": 364,\n    "wires": [[]]\n  },\n  {\n    "id": "a0d4288141f6a629",\n    "type": "protobuf-file",\n    "protopath": "E:\\\\Meshtastic-protobufs-master\\\\mqtt.proto",\n    "watchFile": true,\n    "keepCase": false\n  },\n  {\n    "id": "37cadac381653b1e",\n    "type": "mqtt-broker",\n    "name": "",\n    "broker": "192.168.2.45",\n    "port": "1883",\n    "clientid": "",\n    "autoConnect": true,\n    "usetls": false,\n    "protocolVersion": "4",\n    "keepalive": "60",\n    "cleansession": true,\n    "birthTopic": "",\n    "birthQos": "0",\n    "birthPayload": "",\n    "birthMsg": {},\n    "closeTopic": "",\n    "closeQos": "0",\n    "closePayload": "",\n    "closeMsg": {},\n    "willTopic": "",\n    "willQos": "0",\n    "willPayload": "",\n    "willMsg": {},\n    "userProps": "",\n    "sessionExpiry": ""\n  },\n  {\n    "id": "dbab6472b07929a0",\n    "type": "protobuf-file",\n    "protopath": "E:\\\\Meshtastic-protobufs-master\\\\mesh.proto",\n    "watchFile": true,\n    "keepCase": false\n  }\n]\n'})}),"\n",(0,s.jsxs)(n.p,{children:["(documents/",(0,s.jsx)(a.A,{term:"MQTT",definition:"A lightweight messaging protocol designed for small sensors and mobile devices, enabling efficient data transmission in the Meshtastic network for Internet connectivity and integration with IoT platforms. See https://en.wikipedia.org/wiki/MQTT. In Meshtastic, MQTT is used to connect a node to the internet, and can be used to connect multiple meshes to each other.",routePath:"/docs/terms/",children:"mqtt"}),"/Flow.txt)"]}),"\n",(0,s.jsxs)(n.p,{children:["Node-RED can rapidly (minutes vs days) put together some pretty impressive output when paired with meshtastic. Here is the output of that flow geofencing and mapping via ",(0,s.jsx)(a.A,{term:"MQTT",definition:"A lightweight messaging protocol designed for small sensors and mobile devices, enabling efficient data transmission in the Meshtastic network for Internet connectivity and integration with IoT platforms. See https://en.wikipedia.org/wiki/MQTT. In Meshtastic, MQTT is used to connect a node to the internet, and can be used to connect multiple meshes to each other.",routePath:"/docs/terms/",children:"mqtt"})," data.\n",(0,s.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:t(23785).A+"",children:(0,s.jsx)("img",{src:"/documents/mqtt/Mapping.webp",alt:"Node-RED geofencing and mapping output from MQTT data",style:{zoom:"50%"}})})]}),"\n",(0,s.jsxs)(n.p,{children:["Advanced use, such as encoding Position and sending it to a device via ",(0,s.jsx)(a.A,{term:"MQTT",definition:"A lightweight messaging protocol designed for small sensors and mobile devices, enabling efficient data transmission in the Meshtastic network for Internet connectivity and integration with IoT platforms. See https://en.wikipedia.org/wiki/MQTT. In Meshtastic, MQTT is used to connect a node to the internet, and can be used to connect multiple meshes to each other.",routePath:"/docs/terms/",children:"MQTT"})," without using JSON can get a little complicated. An example of how it can be done is below.\n",(0,s.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:t(18795).A+"",children:(0,s.jsx)("img",{src:"/documents/mqtt/EncodingPosition.webp",alt:"Node-RED flow encoding a position and sending it over MQTT",style:{zoom:"50%"}})}),"\nThe flow is:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-json",children:'[\n  {\n    "id": "32ca608d9e7c5236",\n    "type": "inject",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "",\n    "props": [{ "p": "payload" }, { "p": "topic", "vt": "str" }],\n    "repeat": "",\n    "crontab": "",\n    "once": false,\n    "onceDelay": 0.1,\n    "topic": "",\n    "payload": "",\n    "payloadType": "date",\n    "x": 96.5,\n    "y": 1952,\n    "wires": [["2b536512e8c7aef2"]]\n  },\n  {\n    "id": "20bbd2d1408b8dc5",\n    "type": "change",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "",\n    "rules": [\n      {\n        "t": "set",\n        "p": "channelId_outbound",\n        "pt": "flow",\n        "to": "LongFast",\n        "tot": "str"\n      }\n    ],\n    "action": "",\n    "property": "",\n    "from": "",\n    "to": "",\n    "reg": false,\n    "x": 772,\n    "y": 2027,\n    "wires": [[]]\n  },\n  {\n    "id": "c6cb373157be01d6",\n    "type": "change",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "",\n    "rules": [\n      {\n        "t": "set",\n        "p": "gatewayId_outbound",\n        "pt": "flow",\n        "to": "\\"!55c7312c\\"",\n        "tot": "str"\n      }\n    ],\n    "action": "",\n    "property": "",\n    "from": "",\n    "to": "",\n    "reg": false,\n    "x": 772,\n    "y": 2066,\n    "wires": [[]]\n  },\n  {\n    "id": "24199ec7eaf89c1a",\n    "type": "change",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "",\n    "rules": [\n      {\n        "t": "set",\n        "p": "portnum_outbound",\n        "pt": "flow",\n        "to": "3",\n        "tot": "num"\n      }\n    ],\n    "action": "",\n    "property": "",\n    "from": "",\n    "to": "",\n    "reg": false,\n    "x": 774,\n    "y": 2106,\n    "wires": [[]]\n  },\n  {\n    "id": "de38ad5ef343623a",\n    "type": "change",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "",\n    "rules": [\n      {\n        "t": "set",\n        "p": "from_outbound",\n        "pt": "flow",\n        "to": "1439117612",\n        "tot": "num"\n      }\n    ],\n    "action": "",\n    "property": "",\n    "from": "",\n    "to": "",\n    "reg": false,\n    "x": 781,\n    "y": 2146,\n    "wires": [[]]\n  },\n  {\n    "id": "d435e8abe0852f93",\n    "type": "change",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "",\n    "rules": [\n      {\n        "t": "set",\n        "p": "to_outbound",\n        "pt": "flow",\n        "to": "4294967295",\n        "tot": "num"\n      }\n    ],\n    "action": "",\n    "property": "",\n    "from": "",\n    "to": "",\n    "reg": false,\n    "x": 790,\n    "y": 2188,\n    "wires": [[]]\n  },\n  {\n    "id": "1f8d172708898860",\n    "type": "function",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "Assemble Position protobuf",\n    "func": "msg.protobufType=null;\\nmsg.payload =\\n{\\n    \\"packet\\": {\\n        \\"from\\": flow.get(\\"from_outbound\\"),\\n        \\"to\\": flow.get(\\"to_outbound\\"),   \\n        \\"decoded\\":{\\n            //how ENUMS are handled here\\n            //portnum is decoded as string but encoded as 
1number\\n            //in the encode/decode node-red nodes based on protobuf.js\\n            \\"portnum\\": flow.get(\\"portnum_outbound\\"),\\n            \\"payload\\": msg.payload         \\n        }         \\n    },\\n\\n    \\"channelId\\": flow.get(\\"channelId_outbound\\"),\\n    \\"gatewayId\\": flow.get(\\"gatewayId_outbound\\"),\\n};\\nreturn msg;\\n//info on how to get json data into protobuf \\"bytes\\" field\\n//https://github.com/protobufjs/protobuf.js/wiki/Changes-in-ProtoBuf.js-3.8",\n    "outputs": 1,\n    "noerr": 0,\n    "initialize": "",\n    "finalize": "",\n    "libs": [],\n    "x": 1086,\n    "y": 2019,\n    "wires": [["b8ccf1cfe8bf40a3"]]\n  },\n  {\n    "id": "b8ccf1cfe8bf40a3",\n    "type": "encode",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "",\n    "protofile": "a0d4288141f6a629",\n    "protoType": "ServiceEnvelope",\n    "x": 1287,\n    "y": 2020,\n    "wires": [["dbc78f035c9c2b56", "a002c148f3a06bac"]]\n  },\n  {\n    "id": "03a7e69ca6d471fe",\n    "type": "debug",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "show hex string",\n    "active": true,\n    "tosidebar": true,\n    "console": false,\n    "tostatus": false,\n    "complete": "true",\n    "targetType": "full",\n    "statusVal": "",\n    "statusType": "auto",\n    "x": 1319,\n    "y": 2180,\n    "wires": []\n  },\n  {\n    "id": "dbc78f035c9c2b56",\n    "type": "function",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "dump payload as hex string",\n    "func": "var hex=Buffer.from(msg.payload,\\"hex\\");\\nmsg.payload=hex.toString(\\"hex\\");\\nreturn msg;",\n    "outputs": 1,\n    "noerr": 0,\n    "initialize": "",\n    "finalize": "",\n    "libs": [],\n    "x": 1096,\n    "y": 2178,\n    "wires": [["03a7e69ca6d471fe"]]\n  },\n  {\n    "id": "2b536512e8c7aef2",\n    "type": "function",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "Inject lat lon alt",\n    "func": "msg.payload={\\n    \\"latitudeI\\": 399600000,\\n        \\"longitudeI\\": -862600000,\\n            \\"altitude\\": 100\\n}\\nreturn msg;",\n    "outputs": 1,\n    "noerr": 0,\n    "initialize": "",\n    "finalize": "",\n    "libs": [],\n    "x": 277.5,\n    "y": 1953,\n    "wires": [["9443a9a980e54c75"]]\n  },\n  {\n    "id": "9443a9a980e54c75",\n    "type": "encode",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "encode Position as protobuf",\n    "protofile": "dbab6472b07929a0",\n    "protoType": "Position",\n    "x": 506,\n    "y": 1953,\n    "wires": [["5c36d3a7f4dca14e"]]\n  },\n  {\n    "id": "5c36d3a7f4dca14e",\n    "type": "change",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "",\n    "rules": [\n      {\n        "t": "set",\n        "p": "nested_outbound",\n        "pt": "flow",\n        "to": "payload",\n        "tot": "msg"\n      }\n    ],\n    "action": "",\n    "property": "",\n    "from": "",\n    "to": "",\n    "reg": false,\n    "x": 776,\n    "y": 1952,\n    "wires": [\n      [\n        "20bbd2d1408b8dc5",\n        "c6cb373157be01d6",\n        "24199ec7eaf89c1a",\n        "de38ad5ef343623a",\n        "d435e8abe0852f93",\n        "04d0c4a5f3485c6f"\n      ]\n    ]\n  },\n  {\n    "id": "04d0c4a5f3485c6f",\n    "type": "function",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "dump payload as base64 string",\n    "func": "var hex=Buffer.from(msg.payload,\\"base64\\");\\nmsg.payload=hex.toString(\\"base64\\");\\nreturn msg;",\n    "outputs": 1,\n    "noerr": 0,\n    "initialize": "",\n    "finalize": "",\n    "libs": [],\n    "x": 1082,\n    "y": 1952,\n    "wires": [["1f8d172708898860"]]\n  },\n  {\n    "id": "a002c148f3a06bac",\n    "type": "decode",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "test decode Protobuf",\n    "protofile": "a0d4288141f6a629",\n    "protoType": "ServiceEnvelope",\n    "x": 1249,\n    "y": 1860,\n    "wires": [["4b6fc79398d05782"]]\n  },\n  {\n    "id": "4b6fc79398d05782",\n    "type": "debug",\n    "z": "23dbb1ee.bc2e8e",\n    "name": "test entire payload",\n    "active": true,\n    "tosidebar": true,\n    "console": false,\n    "tostatus": false,\n    "complete": "payload",\n    "targetType": "msg",\n    "statusVal": "",\n    "statusType": "auto",\n    "x": 1458,\n    "y": 1859,\n    "wires": []\n  },\n  {\n    "id": "a0d4288141f6a629",\n    "type": "protobuf-file",\n    "protopath": "E:\\\\Meshtastic-protobufs-master\\\\mqtt.proto",\n    "watchFile": true,\n    "keepCase": false\n  },\n  {\n    "id": "dbab6472b07929a0",\n    "type": "protobuf-file",\n    "protopath": "E:\\\\Meshtastic-protobufs-master\\\\mesh.proto",\n    "watchFile": true,\n    "keepCase": false\n  }\n]\n'})}),"\n",(0,s.jsxs)(n.p,{children:['Sending a position to a device for broadcast to the mesh is much easier with JSON. It requires the message to be published to a channel called "',(0,s.jsx)(a.A,{term:"MQTT",definition:"A lightweight messaging protocol designed for small sensors and mobile devices, enabling efficient data transmission in the Meshtastic network for Internet connectivity and integration with IoT platforms. See https://en.wikipedia.org/wiki/MQTT. In Meshtastic, MQTT is used to connect a node to the internet, and can be used to connect multiple meshes to each other.",routePath:"/docs/terms/",children:"mqtt"}),'". You can let the message send out to a different channel by setting the ',(0,s.jsx)(n.code,{children:"channel"})," field to a channel index (0-7). Then use the ",(0,s.jsx)(a.A,{term:"MQTT",definition:"A lightweight messaging protocol designed for small sensors and mobile devices, enabling efficient data transmission in the Meshtastic network for Internet connectivity and integration with IoT platforms. See https://en.wikipedia.org/wiki/MQTT. In Meshtastic, MQTT is used to connect a node to the internet, and can be used to connect multiple meshes to each other.",routePath:"/docs/terms/",children:"MQTT"}),' Service Envelope type: "sendposition". A valid ',(0,s.jsx)(a.A,{term:"MQTT",definition:"A lightweight messaging protocol designed for small sensors and mobile devices, enabling efficient data transmission in the Meshtastic network for Internet connectivity and integration with IoT platforms. See https://en.wikipedia.org/wiki/MQTT. In Meshtastic, MQTT is used to connect a node to the internet, and can be used to connect multiple meshes to each other.",routePath:"/docs/terms/",children:"MQTT"})," envelope and message to broadcast lat, lon, altitude (optional) and time (optional) looks like this:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-json",children:'{\n  "from": 2130636288,\n  "type": "sendposition",\n  "payload": {\n    "latitude_i": 399600000,\n    "longitude_i": -862600000,\n    "altitude": 100,\n    "time": 1670201543\n  }\n}\n'})}),"\n",(0,s.jsxs)(n.p,{children:["An example of doing this in Node-RED:\n",(0,s.jsx)(n.a,{target:"_blank","data-noBrokenLinkCheck":!0,href:t(86663).A+"",children:(0,s.jsx)("img",{src:"/documents/mqtt/PosJSON.webp",alt:"Node-RED flow building a position JSON message",style:{zoom:"50%"}})})]})]})}function p(e={}){let{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},1911(e,n,t){t.d(n,{A:()=>o});let o=t.p+"assets/files/Broker1-dab9ca99262387411ca12887c3ba5cb4.webp"},95149(e,n,t){t.d(n,{A:()=>o});let o=t.p+"assets/files/Consume-b594495b1e8df68b91c3a81172e07fb6.webp"},36453(e,n,t){t.d(n,{A:()=>o});let o=t.p+"assets/files/DecodeNewest-2c862dc4006e6e8e989ef200a8bb4f79.webp"},18795(e,n,t){t.d(n,{A:()=>o});let o=t.p+"assets/files/EncodingPosition-209d2667774cfb2a2182ecb9e14559df.webp"},15662(e,n,t){t.d(n,{A:()=>o});let o=t.p+"assets/files/Forward-0efe58ce74053704ed10d8696735c515.webp"},29692(e,n,t){t.d(n,{A:()=>o});let o=t.p+"assets/files/Inject-aa16ec7eea0262aba4154126b2128f75.webp"},23785(e,n,t){t.d(n,{A:()=>o});let o=t.p+"assets/files/Mapping-522ff1fee7bea9a01852d28917a0ee27.webp"},69495(e,n,t){t.d(n,{A:()=>o});
1let o=t.p+"assets/files/NR_nodes-9cd148a2f75cebb0daab00fe27b9896a.webp"},99108(e,n,t){t.d(n,{A:()=>o});let o=t.p+"assets/files/NodeRedThree-86e08e4d306441ba48652abe8f5aa35e.webp"},38826(e,n,t){t.d(n,{A:()=>o});let o=t.p+"assets/files/NodeRedTwo-394a33cc4499e80d5a8ee85168246165.webp"},86663(e,n,t){t.d(n,{A:()=>o});let o=t.p+"assets/files/PosJSON-80b35c40e52e8aaa14eda2c593e47ead.webp"},67008(e,n,t){t.d(n,{R:()=>a,x:()=>d});var o=t(71763);let s={},i=o.createContext(s);function a(e){let n=o.useContext(i);return o.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),o.createElement(i.Provider,{value:n},e.children)}},87622(e,n,t){t.d(n,{A:()=>a});var o=t(71763),s=t(37773),i=t(91987);function a({term:e,definition:n,abbreviation:t,routePath:d="/glossary",children:r}){let[c,l]=(0,o.useState)(!1),[h,p]=(0,o.useState)(null),[f,m]=(0,o.useState)("top"),u=(0,o.useRef)(null),b=(0,o.useRef)(null),g=(0,o.useCallback)(()=>{let e;if(!u.current||!b.current)return;let n=u.current.getBoundingClientRect(),t=b.current.getBoundingClientRect(),o=window.innerWidth,s=window.innerHeight,i=document.querySelector(".navbar"),a=i?i.getBoundingClientRect().bottom:0,d=n.top-a>=t.height+8,r=s-n.bottom>=t.height+8,c=d||!r?"top":"bottom";e="top"===c?n.top-t.height-8:n.bottom+8;let l=n.left+n.width/2-t.width/2;l=Math.max(8,Math.min(l,o-t.width-8)),m(c),p({top:Math.max(a+4,e),left:l})},[]);(0,o.useEffect)(()=>{let e;if(!c)return;let n=requestAnimationFrame(()=>{e=requestAnimationFrame(()=>{g()})}),t=()=>g(),o=()=>g();return window.addEventListener("scroll",t,!0),window.addEventListener("resize",o),()=>{cancelAnimationFrame(n),e&&cancelAnimationFrame(e),window.removeEventListener("scroll",t,!0),window.removeEventListener("resize",o)}},[c,g]);let w=(0,s.P_)("docusaurus-plugin-glossary"),y=(0,o.useMemo)(()=>{if(n&&"string"==typeof n&&n.length>0)return n;let t=(w&&w.terms||[]).find(n=>"string"==typeof n.term&&n.term.toLowerCase()===String(e).toLowerCase());return t&&t.definition?t.definition:void 0},[n,w,e]),T=(0,o.useMemo)(()=>{let n=t;if(!n){let t=(w&&w.terms||[]).find(n=>"string"==typeof n.term&&n.term.toLowerCase()===String(e).toLowerCase());n=t&&t.abbreviation}if("string"!=typeof n)return;let o=n.trim();if(o&&o.toLowerCase()!==String(e).toLowerCase())return o},[t,w,e]),x=(0,o.useMemo)(()=>d&&"string"==typeof d&&d.length>0?d:w&&w.routePath||"/glossary",[w,d]),v=r||e,M=e.toLowerCase().replace(/\s+/g,"-");return(0,i.jsxs)("span",{ref:u,className:"glossaryTermWrapper_ud7W",children:[(0,i.jsx)("a",{href:`${x}#${M}`,className:"glossaryTerm_x2nJ",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onFocus:()=>l(!0),onBlur:()=>l(!1),"aria-describedby":`tooltip-${M}`,children:v}),y&&(0,i.jsxs)("span",{ref:b,id:`tooltip-${M}`,className:`tooltip_WjgA ${c?"tooltipVisible_AjfD":""} ${"top"===f?"tooltipTop_uMN4":"tooltipBottom_U9P5"} tooltipFloating_nLk7`,role:"tooltip",style:c&&h?{top:`${h.top}px`,left:`${h.left}px`}:void 0,children:[(0,i.jsx)("strong",{children:e}),T?` (${T}). `:"",y]})]})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.