I'm looking to use benthos/protocol
# umh-support
b
I'm looking to use benthos/protocol converter to translate MQTT SpB to vanilla MQTT. Any suggestions? This would fullfill applying the Shultz method.
j
sparkplug b is nothing else than raw MQTT + protobuf. YOu should be able to go ahead with it by using MQTT as an input, and then a protobug component: https://docs.redpanda.com/redpanda-connect/components/processors/protobuf/ You could do that using either a protocol converter (easier) or a custom data flow component (basically just a benthos container with UI, requires enabling the advanced mode)
would need to think how to get the sparkplugb proto file inside of the benthos container
maybe we could ship it by default within benthos-umh?
b
Absolutely! SpB is great for L2 and down, but it’s a problem once you want to go higher up the stack. There are two methods being used to bridge the layers, that being the Shultz method and the Parris method. Shultz is better imo, but to do it requires a custom pipeline. Benthos SpB to Vanilla would be game changing.
d
i also think "sparkplug b support" would be an added selling value its not that impressive but it will get a broader public for sure @Jasperlg you're ignition/sparkplug b expert, what do you think?
j
I jsut wanted to quickly make the .proto file available in benthos-umh by default, but it is not possible currently due to licensing issues. The official .proto file is under EPL 2.0 license, which makes it unusable in commercial code. I assume all the vendor on the market simply don't care about it, but because our code is OSS as well, we need to carefully check all licenses to not get sued. However, the standard also explains the .proto file, so one could re-create the .proto file from the text based explanations. if anyone wants to do it, or provide us with a non EPL 2.0 licensed .proto file, feel free to open a PR on benthos-umh. Sources: - https://www.eclipse.org/legal/epl-2.0/ - https://www.eclipse.org/tahu/spec/sparkplug_spec.pdf
or am I struggling to understand the EPL properly here?
ok, went on a 30min rabbit hole of EPL and the interpretion of the eclipse foundation of derivative work is, that as long as I dont modify the proto file I can link it in commercially programs
I included it. With the next benthos release, you can simply do a
Copy code
yaml
pipeline:
  processors:
    - protobuf:
        operator: to_json
        message: Payload
        import_paths: [ /proto ]
to convert a sparkplug-b message into json
j
You convert them RAW? So they will get GROUP/NODE/DDATA/DEVICE topic structure?
I'm not so familiar with Benthos. What is the use case? Is it subscribing to spb and converting in to vanilla MQTT? Imo you need a place where you convert it to a regular structure. for example GROUP/NODE/DEVICE needs a place in the UNS structure, so you'd need a conversion to Enterprise/Site/Area/Line/Device, and I don't like using Shultz or Parris method, I think that is a bit a janky way of doing things, certainly, because node is not referring to any of your hierarchical structure, but to your application that is connected to the device you're reading data out.
b
Completely agree that there needs to be a conversion pipeline to standardize SpB into the UNS/S95. In this case, you don't have to have NODE be represented in the UNS. Right now, SpB solves a major problem in the industrial space: Device control (SCA), legacy integration, and enhanced data and state integrity (DA). There isn't any other MQTT companion spec out there that can do this (unless you want to take a chance with OPC-UA pt14). So we're stuck with SpB until something better comes out, but in the meantime we need a way to normalize SpB into S95. Getting the payload converted from protobuf to JSON is all I can ask for.
j
I’ll release the new benthos version today and let you guys try it. Would be great if you could write a couple of sentences if it works, so that we can write a small article about it.
Anyone tried out the spark plug b?
d
@Jasperlg
j
Tried out in what way? I use Sparkplug B all the time
d
The UMH Benthos has a direct integration with sparkplug
it can take tags/sparkplug messages and put them on the UMH UNS i doubt if you have tested this cause you dont have a UMH instance (as far as i know)
b
It can decode the payload from protobuf. There is still some processing required to format it to comply with UMH tho.