Red-Node error: MeshPacket in the ServiceEnvelope

So I am using the example from MQTT | Meshtastic specifically where the author shows the source code for the mqtt decoding. When I get it running under node-red i get the following error whenever a packet comes across the network:

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

which is in the decode protobuf gadget right after the MQTT node.

What is required to get this fixed?

I’m having the same problem. The MQTT setup seems correct as the messages are coming through and showing in the debug node on the flow, but I get the same error as the OP. I initially had the wrong path to the mqtt.proto file and that gave a different error. That’s sorted now so I reckon it must be either the encoding on the device or decoding that isn’t correct. How do I start looking into this? Any tips?

I never did get it to work. You have to switch to JSON in the device, ci very it within python and then completely rewrite the code. This version was never meant to work with V2.x of Meshtastic

Ah, ok. Thanks for that!

I just figured this out. You need to include more proto files. in node red you need to comma delim when you need to reference multiple files. for example. mqtt.proto , mesh.proto , portnums.proto .

Since the protocol references types from different files you need to include all the files for the messages you are decoding. I only needed those three but I was just decoding a specific message.