This is a guide on how to setup a basic Meshtastic channel message discord bot using node red and MQTT. (This is based on home assistant install but you can do this with standalone node red/MQTT broker) My preffered MQTT Broker(you can use whatever you want): EMQX (https://github.com/emqx/emqx)
- Discord Message Logging with short name appended to beginning
- Node Location Map Plotting
- Ingestion from MQTT
- Protobufs decoding
- Message deduplication by ID
- Annotate integer-based node ids to hex
- Annotate packets with known NodeInfo
- Split for all current port numbers
- Writing Mesh, Packet, Device, Environment and Position measurements to InfluxDB
- Debug nodes for all outputs
- After importing the flow, go to your config section (cog in the top right of editor) and change the credentials of your MQTT broker and Discord Token. (You do not need to update InfluxDB as I am just using that as a logging database for nodes I can go into how that works in another guide if anyone wants a tutorial!
-
Make sure you have setup an MQTT broker. If you are running home assistant use either Mosquitto broker through the Addon store by default or EMQX with the community add on repository added.
-
Install Node red. you can do it through home assistant add on store if you have the community add on repository added
-
Once you have installed node red, install these palattes (palletes can be found by going to the hamburger menu in the top right and going to manage palletes)
@meshtastic/node-red-contrib-meshtastic
node-red-contrib-discord-advanced
-
Create an MQTT in node that points towards your MQTT broker server (click on the pencil and create a new connection for your MQTT broker), and pick the topic that you want to follow(remember # is wildcard)
-
Connect a decode meshtastic node
-
Connect a DiscordMessageManager node, put your desired channel ID and add your discord token by clicking on the pencil icon and adding it there. (Explanation on how to create the discord bot and token coming later but its very easy)
-
You should now recieve messgaes to your discord server as long as you have MQTT enabled on the channels you are using and you have setup everything correctly.
-
More to come with this tutorial.....
Original Flow/Segmentation template that I used to make this: https://github.com/scruplelesswizard/meshtastic-node-red