# Example wanted for node-red-contrib-protobuf

**URL:** <https://discourse.nodered.org/t/example-wanted-for-node-red-contrib-protobuf/9294>\
**Category:** General\
**Created:** [21 March 2019 21:14 UTC](https://discourse.nodered.org/t/example-wanted-for-node-red-contrib-protobuf/9294 "2019-03-21T21:14:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![robin-s-007](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@robin-s-007](https://discourse.nodered.org/u/robin-s-007)\
**Post date:** [21 March 2019 21:14 UTC](https://discourse.nodered.org/t/example-wanted-for-node-red-contrib-protobuf/9294/1 "2019-03-21T21:14:24Z")

</div>

Hello,

I am trying to decode protobuf data on incoming MQTT messages.  
For this I am trying to use the node-red-contrib-protobuf node, but sofar its driving me crazy...  
Although it produces error messages, further documentation is missing, so I do not know what to correct.  
An example flow with an inject node that simulates data and an matching .proto file would be very helpfull.

My setup/data:  
Inject node, simulating: (input to protobuf node)  
msg : Object  
object  
\_msgid: "bf2cd2cc.4e863"  
topic: ""  
payload: buffer[5][raw](http://xxx.yyy.zzz:1880/#)  
0: 0xd  
1: 0x0  
2: 0x0  
3: 0x40  
4: 0x40

Output of protobuf node:  
msg : string[79]  
"Message is not valid under selected message type. fLoadVoltage: number expected"

Protofile  
syntax = "proto2";

message SolarMeasurement {  
required float fLoadVoltage = 1;  
}

Looking at the error message the node able to read and decode the file but some raises an error.  
So I tried to decode the data on an online decoder ([https://protogen.marcgravell.com/decode](https://protogen.marcgravell.com/decode)):  
0D00004040

## Online Protobuf Decoder.

0D = field **1** , type **Fixed32**  
00-00-40-40 = **1077936128** (integer) or **3** (floating point)

According to the online form the data is OK, as it contains a float number 3.0.

So any help or tips are greatly appreciated.

Thanks in advance,

Robin

---

<div class="post-metadata">

**Author:** ![pauldeng](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pauldeng/32/574_2.png) [@pauldeng](https://discourse.nodered.org/u/pauldeng)\
**Post date:** [26 March 2019 00:48 UTC](https://discourse.nodered.org/t/example-wanted-for-node-red-contrib-protobuf/9294/2 "2019-03-26T00:48:49Z")

</div>

I think I may experienced similar issue.

Try this out if it will help: [https://github.com/defonzie/node-red-contrib-protobuf/commit/d3c30194da77b1358b23142443189a1b59ebd7a8](https://github.com/defonzie/node-red-contrib-protobuf/commit/d3c30194da77b1358b23142443189a1b59ebd7a8)
