/sparkplugclidecoder

Decodes sparkplug msgs received from stdin

Primary LanguageGoGNU General Public License v3.0GPL-3.0

sparkplugclidecoder


Sparkplug cli decoder allow you to debug in command line a stream of messages received in the standard input in hexadecimal format. Currently only tested with mosquitto_sub

Usage

usage: sparkplugclidecoder [<flags>]

Flags:
      --help                 Show context-sensitive help (also try --help-long and --help-man).
  -s, --sep=""               adds a separator between messages: <newline>sep<newline>
  -f, --format="prototext"   Output format: prototext, protojson
  -t, --maxBufferSize=65536  size of the buffer

Examples

Tells mosquitto_sub to write the sparkplug message as hexadecimal string so sparkplugclidecoder reads from it and prints the decoded in prototext

> mosquitto_sub -L mqtt://localhost:1883/testtopic/# -F %x | sparkplugclidecoder

timestamp:  1621956521303
metrics:  {
  name:  "Device Control/Scan Rate ms"
  timestamp:  1621956521303
  datatype:  3
  int_value:  6000
}
seq:  165

Installation

go install github.com/dubyte/sparkplugclidecoder@latest

Binary releases