Here is a newb MQTT tutorial for 1.3

It won’t let me upload a text file so this is the json code for my latest cleartext flow. For a use case such as yours I use the flow variables as input to a sqlite database (node-red has a nice sqlite node) which functions as a one hour store-forward buffer at times the local mesh mqtt broker can’t get internet access. An alternative would be to use a different broker with store-forward capability built in.

[{"id":"10fe1b2e9cb3feb2","type":"decode","z":"23dbb1ee.bc2e8e","name":"decode Protobuf","protofile":"a0d4288141f6a629","protoType":"ServiceEnvelope","x":295.5,"y":285,"wires":[["d3e396cf4f0a9608","d08865b41a69d85d","6f592d47b6a2eac4"]]},{"id":"40c9ee66fe7a34cb","type":"function","z":"23dbb1ee.bc2e8e","name":"function get the message as string from TEXT_MESSAGE_APP","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;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":369.5,"y":447,"wires":[["eb37fb79a45684db"]]},{"id":"c6afbb9f1665b162","type":"debug","z":"23dbb1ee.bc2e8e","name":"channelId","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":964.5,"y":250,"wires":[]},{"id":"607ef387d5701985","type":"debug","z":"23dbb1ee.bc2e8e","name":"gatewayId","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":970.5,"y":286,"wires":[]},{"id":"d3e396cf4f0a9608","type":"debug","z":"23dbb1ee.bc2e8e","name":"entire payload","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":296.5,"y":247,"wires":[]},{"id":"2339b328bb9bb1d8","type":"comment","z":"23dbb1ee.bc2e8e","name":"Decode all cleartext text and position and user messages sent by Meshtastic devices into JSON without relying on JSON conversion on the device.","info":"","x":535.5,"y":214,"wires":[]},{"id":"408d796d997bb832","type":"function","z":"23dbb1ee.bc2e8e","name":"function get the nested payload as base64","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;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":292,"y":552,"wires":[["9435a3c605efedb4","1ed6f96c8214d7b3"]]},{"id":"61995c9f8e8266b3","type":"debug","z":"23dbb1ee.bc2e8e","name":"portnum","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":964.5,"y":322,"wires":[]},{"id":"9435a3c605efedb4","type":"debug","z":"23dbb1ee.bc2e8e","name":"nested payload","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":281.5,"y":603,"wires":[]},{"id":"b832775d386f7ac9","type":"mqtt in","z":"23dbb1ee.bc2e8e","name":"","topic":"msh/+/c/#","qos":"2","datatype":"buffer","broker":"37cadac381653b1e","nl":false,"rap":true,"rh":0,"inputs":0,"x":117.5,"y":286,"wires":[["10fe1b2e9cb3feb2"]]},{"id":"d08865b41a69d85d","type":"switch","z":"23dbb1ee.bc2e8e","name":"switch manual decoding nested message based on portum","property":"payload.packet.decoded.portnum","propertyType":"msg","rules":[{"t":"eq","v":"TEXT_MESSAGE_APP","vt":"str"},{"t":"eq","v":"POSITION_APP","vt":"str"},{"t":"eq","v":"NODEINFO_APP","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":281.5,"y":505,"wires":[["40c9ee66fe7a34cb"],["408d796d997bb832"],["e2ecd1c2a56a4396"]]},{"id":"8abb1bb458af2c4f","type":"change","z":"23dbb1ee.bc2e8e","name":"","rules":[{"t":"set","p":"gatewayId","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":787.5,"y":286,"wires":[["607ef387d5701985"]]},{"id":"1ced0be28eeef0d3","type":"change","z":"23dbb1ee.bc2e8e","name":"","rules":[{"t":"set","p":"latitude","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1119.5,"y":433,"wires":[[]]},{"id":"313fd3cfe6d91850","type":"change","z":"23dbb1ee.bc2e8e","name":"","rules":[{"t":"set","p":"longitude","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1132.5,"y":470,"wires":[["d02e53cdfb565da6"]]},{"id":"33dd43e3c05f826c","type":"geofence","z":"23dbb1ee.bc2e8e","name":"geofence","mode":"circle","inside":"true","rad":69174.91569647488,"points":[],"centre":{"latitude":40.16287050252407,"longitude":-86.60385131835938},"floor":"","ceiling":"","worldmap":true,"outputs":2,"x":1202.5,"y":595,"wires":[[],["4d01eb8f1b31f039"]]},{"id":"d02e53cdfb565da6","type":"function","z":"23dbb1ee.bc2e8e","name":"trigger function to send a mapping point","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(\"fromGateway\")\n\nmsg={\"payload\":{\"name\":name,\n \"lat\":lat,\n  \"lon\":lon,\n   \"action\":\"send\",\n   \"icon\": \"car\",\n   \"label\":name\n   }}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1271.5,"y":525,"wires":[["33dd43e3c05f826c","4d01eb8f1b31f039"]]},{"id":"4d01eb8f1b31f039","type":"worldmap","z":"23dbb1ee.bc2e8e","name":"","lat":"40","lon":"-86","zoom":"7","layer":"OSMG","cluster":"","maxage":"","usermenu":"show","layers":"show","panit":"false","panlock":"false","zoomlock":"false","hiderightclick":"false","coords":"none","showgrid":"false","showruler":"false","allowFileDrop":"false","path":"/worldmap","overlist":"DR,CO,RA,DN,HM","maplist":"OSMG,OSMC,EsriC,EsriS,EsriT,EsriDG,UKOS","mapname":"","mapurl":"","mapopt":"","mapwms":false,"x":1206.5,"y":675,"wires":[]},{"id":"1ed6f96c8214d7b3","type":"decode","z":"23dbb1ee.bc2e8e","name":"decode Position Protobuf","protofile":"dbab6472b07929a0","protoType":"Position","x":658.5,"y":549,"wires":[["db1933ba36503bd9","dad9f487318f21d9"]]},{"id":"db1933ba36503bd9","type":"debug","z":"23dbb1ee.bc2e8e","name":"Position decoded","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":644.5,"y":593,"wires":[]},{"id":"dad9f487318f21d9","type":"function","z":"23dbb1ee.bc2e8e","name":"Split","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];","outputs":4,"noerr":0,"initialize":"","finalize":"","libs":[],"x":834.5,"y":501,"wires":[["1ced0be28eeef0d3","8bb97f802662976c"],["313fd3cfe6d91850","c8e135f3e542bb1b"],["602fb2020680280c","05c7099eeaac2eee"],["ed424ae3d45dd2ac","1207605d22edbe7b"]]},{"id":"8bb97f802662976c","type":"debug","z":"23dbb1ee.bc2e8e","name":"lat","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":993.5,"y":546,"wires":[]},{"id":"c8e135f3e542bb1b","type":"debug","z":"23dbb1ee.bc2e8e","name":"lon","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":989.5,"y":581,"wires":[]},{"id":"602fb2020680280c","type":"debug","z":"23dbb1ee.bc2e8e","name":"alt","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":989.5,"y":617,"wires":[]},{"id":"ed424ae3d45dd2ac","type":"debug","z":"23dbb1ee.bc2e8e","name":"time","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":989.5,"y":653,"wires":[]},{"id":"6f592d47b6a2eac4","type":"function","z":"23dbb1ee.bc2e8e","name":"Split Decoded 1","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};\nvar to = {payload:\"!\"+ msg.payload.packet.to.toString(16)};\n\nreturn [channelId, gatewayId, portnum, fr, to ];","outputs":5,"noerr":0,"initialize":"","finalize":"","libs":[],"x":577.5,"y":294,"wires":[["a5018a9be0780e79"],["8abb1bb458af2c4f"],["fda2292412d2ea1c"],["fd881fac22422773","a389f9875da672ec"],["956f09c1a5f85180"]]},{"id":"fd881fac22422773","type":"debug","z":"23dbb1ee.bc2e8e","name":"from","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":772.5,"y":358,"wires":[]},{"id":"cf066ad415df30ae","type":"debug","z":"23dbb1ee.bc2e8e","name":"to","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":956.5,"y":395,"wires":[]},{"id":"a389f9875da672ec","type":"change","z":"23dbb1ee.bc2e8e","name":"set flow.from","rules":[{"t":"set","p":"from","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":973.5,"y":358,"wires":[["8242dccd2239136b"]]},{"id":"e2ecd1c2a56a4396","type":"function","z":"23dbb1ee.bc2e8e","name":"function get the nested payload as base64","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;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":286,"y":649,"wires":[["12780b55bd9472c1"]]},{"id":"12780b55bd9472c1","type":"decode","z":"23dbb1ee.bc2e8e","name":"decode User Protobuf","protofile":"dbab6472b07929a0","protoType":"User","x":579,"y":649,"wires":[["fc12dadf851e86f9","8da97e053ff3db75"]]},{"id":"fc12dadf851e86f9","type":"function","z":"23dbb1ee.bc2e8e","name":"Split","func":"var id = { payload: msg.payload.id };\nvar longname = { payload: msg.payload.longName};\nvar shortname = { payload: msg.payload.shortName };\nvar macaddr = { payload: msg.payload.macaddr };\nvar hw_model ={payload:msg.payload.hwModel};\nvar islicensed={payload:msg.payload.isLicensed};\n\nreturn [id,longname, shortname, macaddr, hw_model, islicensed];","outputs":6,"noerr":0,"initialize":"","finalize":"","libs":[],"x":832,"y":660,"wires":[["a4fdeb22a1cd23d6","563daaa40ddfbc2e"],["2719991c200de15d","67e736d5badbc240"],["3e74109fe6a0f6d8","b0a27c91aa642f45"],["9012d33c33db0e93"],["da11bbc24e740993","528eb77ac3fd2e5e","460fc10931356a77"],["9c0313e16deb6d70","36a22ca57723dff5"]]},{"id":"8da97e053ff3db75","type":"debug","z":"23dbb1ee.bc2e8e","name":"User decoded","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":566,"y":689,"wires":[]},{"id":"a4fdeb22a1cd23d6","type":"debug","z":"23dbb1ee.bc2e8e","name":"id","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":976.5,"y":721,"wires":[]},{"id":"2719991c200de15d","type":"debug","z":"23dbb1ee.bc2e8e","name":"long_name","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1161.5,"y":730,"wires":[]},{"id":"3e74109fe6a0f6d8","type":"debug","z":"23dbb1ee.bc2e8e","name":"short_name","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1024.5,"y":764,"wires":[]},{"id":"9012d33c33db0e93","type":"debug","z":"23dbb1ee.bc2e8e","name":"macaddr","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1202.5,"y":764,"wires":[]},{"id":"da11bbc24e740993","type":"debug","z":"23dbb1ee.bc2e8e","name":"nw_model","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1376.5,"y":730,"wires":[]},{"id":"9c0313e16deb6d70","type":"debug","z":"23dbb1ee.bc2e8e","name":"is_licensed","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1391.5,"y":769,"wires":[]},{"id":"a5018a9be0780e79","type":"change","z":"23dbb1ee.bc2e8e","name":"","rules":[{"t":"set","p":"channelId","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":786.5,"y":251,"wires":[["c6afbb9f1665b162"]]},{"id":"fda2292412d2ea1c","type":"change","z":"23dbb1ee.bc2e8e","name":"","rules":[{"t":"set","p":"portnum","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":798.5,"y":321,"wires":[["61995c9f8e8266b3"]]},{"id":"956f09c1a5f85180","type":"change","z":"23dbb1ee.bc2e8e","name":"","rules":[{"t":"set","p":"to","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":780.5,"y":394,"wires":[["cf066ad415df30ae"]]},{"id":"05c7099eeaac2eee","type":"change","z":"23dbb1ee.bc2e8e","name":"","rules":[{"t":"set","p":"altitude","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1336.5,"y":433,"wires":[[]]},{"id":"1207605d22edbe7b","type":"change","z":"23dbb1ee.bc2e8e","name":"","rules":[{"t":"set","p":"time","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1350.5,"y":472,"wires":[[]]},{"id":"563daaa40ddfbc2e","type":"change","z":"23dbb1ee.bc2e8e","name":"","rules":[{"t":"set","p":"id","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1560.5,"y":555,"wires":[[]]},{"id":"67e736d5badbc240","type":"change","z":"23dbb1ee.bc2e8e","name":"","rules":[{"t":"set","p":"longName","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1595.5,"y":594,"wires":[[]]},{"id":"b0a27c91aa642f45","type":"change","z":"23dbb1ee.bc2e8e","name":"","rules":[{"t":"set","p":"shortName","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1593.5,"y":633,"wires":[[]]},{"id":"528eb77ac3fd2e5e","type":"change","z":"23dbb1ee.bc2e8e","name":"","rules":[{"t":"set","p":"hwModel","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1597.5,"y":669,"wires":[[]]},{"id":"460fc10931356a77","type":"change","z":"23dbb1ee.bc2e8e","name":"","rules":[{"t":"set","p":"macaddr","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1598.5,"y":706,"wires":[[]]},{"id":"36a22ca57723dff5","type":"change","z":"23dbb1ee.bc2e8e","name":"","rules":[{"t":"set","p":"isLicensed","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1598.5,"y":746,"wires":[[]]},{"id":"eb37fb79a45684db","type":"change","z":"23dbb1ee.bc2e8e","name":"","rules":[{"t":"set","p":"text","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":687.5,"y":447,"wires":[["553374591214eaca"]]},{"id":"8242dccd2239136b","type":"function","z":"23dbb1ee.bc2e8e","name":"toGatewayString","func":"msg.payload = \"!\" + msg.payload.toString(16);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1198.5,"y":325,"wires":[["e6fd0d68d12ab04a"]]},{"id":"202ea39d8e85aab9","type":"debug","z":"23dbb1ee.bc2e8e","name":"from as gatewayId","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1425.5,"y":366,"wires":[]},{"id":"e6fd0d68d12ab04a","type":"change","z":"23dbb1ee.bc2e8e","name":"","rules":[{"t":"set","p":"fromGateway","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1209.5,"y":366,"wires":[["202ea39d8e85aab9"]]},{"id":"553374591214eaca","type":"debug","z":"23dbb1ee.bc2e8e","name":"text message out","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":867.5,"y":446,"wires":[]},{"id":"a0d4288141f6a629","type":"protobuf-file","protopath":"E:\\Meshtastic-protobufs-master\\mqtt.proto","watchFile":true,"keepCase":false},{"id":"37cadac381653b1e","type":"mqtt-broker","name":"","broker":"192.168.2.45","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""},{"id":"dbab6472b07929a0","type":"protobuf-file","protopath":"E:\\Meshtastic-protobufs-master\\mesh.proto","watchFile":true,"keepCase":false}]
1 Like

Works like a charm, will give the store an forward a try as well. Thank you so much for this.

this is how my store using sqlite flat database looks like for storing an hour of messages. It also shows how one might use a Queue node to decode and store one message at a time. I waste space in the database by not using a relational setup, but this is faster to experiment with. You have to be careful with in and out “enum” protobuf fields cause the often spit out a string on decoding but then expect a number for encoding.

Fantastic, thanks so much for sharing, I will give this a try. Again if any chance you could share the json export that makes things so much easier.

I though I´d share my telegram integration based on node-red-contrib-telegrambot and your flow, which is pretty simple, and works fine.
Essentially I have a MQTT server running in the cloud, which communicates via a t-beam gateway connected to a 4G mobile wifi router (I am planning to change this to a RAK with ethernet to reduce power consumption) with the meshtastic network in a remote location with very limited 4G access. A telegram Bot receives and sends messages from MQTT. This bot can be invited into various chatgroups so that people far from the meshtastic location can communicate with those in the in the location with no 4G reception. So someone in town can use telegram to write directly to someone with no 4G reception, who will receive the message in the meshtastic app, and can reply from there to telegram. Hope this makes sense. This makes it much simpler to use for those with 4G reception. One issue is that the sender will always appear to be the gateway node, not the actual sender. Therefore in the function create outgoing JSON MQTT envelope I combine the sender of the original message into the forwarded message body as Senders first name on telegram : Text of message. This does not yet work the other way.
On the telegram side it is necessary to search for and open the BotFather bot on telegram and start it by sending the command /start.
Then create a new bot using /newbot and name it.
Finally, If you want the bot to be able to forward and read messages from chats its invited into, it is necessary to disable the privacy settings using /setprivacy.
There are some issues - messages are sent in multiples dependant on the number of gateways connected to the network, and the sender from meshtastic needs to add their name to outgoing messages if telegram users are to know who sent the message.
In the Red-done flow you´ll have to insert your own details for MQTT server address and the location of the protobufs as per @gparduino ´s excellent instructions. In the telegram related nodes you´ll have to add your chatid (search for getidsbot on telegram to get those details) and bot names to get it to work.

I will try and attach the relevant json file in the next message as its got too many characters for this one and we are unable to upload .json files (edit: not posible due to file type and character length restrictions, have messaged forum admin to see if something can be done about this).

@gparduino should the decode protobuf only decode the primary channel or is it also set up to decode other, secondary channels?
When sending on a secondary channel such as msh/2/json/secondary the decode protobuf throws a series of errors such as

“Wire format is invalid: RangeError: index out of range: 3 + 32 > 25”

I thought this was because the MQTT input node in your example is msh/+/c/#, which works fine for receiving messages sendt on msh/2/json/primary but not for messages on msh/2/json/secondary.

If I change the input to msh/+/json/primary instead, then it also throws these “Wire format is invalid: RangeError: xxxxx” errors.

Sending on msh/2/c/secondary and receiving on msh/+/c# still results in the Wire format is invalid: RangeError, so I’m a bit stumped, do you have any ideas?

hey guys
im quite new to this stuff and tried to get the flow from gparduino working.

This is the result?

13.3.2023, 18:01:21node: decode Protobufmsg : string[100]

“Wire format is invalid: Error: no such Type or Enum ‘MeshPacket’ in Type .meshtastic.ServiceEnvelope”

Some help would be greatly appreciated.

thanks

Hi,
I’m having the same issue with the flow. I’m very new to all this so don’t know where to start…
Thanks

1 Like

This has worked perfectly but as I was building my system I have run into a problem with sending text messages over mqtt using JSON - the bug is described here. The feedback from the developers is that JSON is problematic, at least in some instances. Therefore I am trying to send a message using protobuf instead. As the message is picked up from a telegram receive node, it is not in the proper format for the protobuf encode node (as far as I understand). I have looked at the protobuf documentation but am struggling to convert the output of the telegram receive node into a format that the protobuf encode node will accept. I have posted on the discord server for some guidance with no luck. If @gparduino or anyone with else with knowledge of the proper format to feed into the protobuf encode node could point me in the right direction please? I can see the example made for the Position app in the November 2022 entry above but couldn’t find one for the message app. The info I want to encode and send to the msh/weather/c channel are the “first_name” and “text” fields

The format from the Telegram receive node is:

{“chatId”:-123456789,“type”:“message”,“content”:{“message_id”:1234,“from”:{“id”:1234567844,“is_bot”:true,“first_name”:“weather”,“username”:“weather”},“chat”:{“id”:-123456789,“title”:“weather”,“type”:“group”,“all_members_are_administrators”:true},“date”:1686055705,“text”:“2023-06-06T12:00:00Z: weather 1h: lightrain; Temp 1h: 6.4°C ; Rain 1h: 0.2mm ; wind 1h: W ; Strength: 6.5m/s , up to 10.8m/s ; Fog: 0% Lightening: 0.4%”},“options”:{“chat_id”:-123456789,“text”:“2023-06-06T12:00:00Z: weather 1h: lightrain; Temp 1h: 6.4°C ; Rain 1h: 0.2mm ; wind 1h: V ; Strength: 6.5m/s , up to 10.8m/s ; Fog: 0% Lightening: 0.4%”},“sentMessageId”:1234}

any help greatly appreciated!

1 Like

Hello can you share your flow please,
I am interested of telegram nodes.

2 Likes