Created
April 14, 2022 06:24
-
-
Save ArrEssJay/95cb07c6f11335a2f5613e64f0930de1 to your computer and use it in GitHub Desktop.
UBX GNSS data -> telegraf using pyubx2 outputting JSON
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The lambda function coerces pyubx2 into outputting JSON. Requires importing the `jsons` library | |
[[inputs.execd]] | |
command = ["gnssdump", \ | |
"port=/dev/ttyACM0", \ | |
"baudrate=921600", | |
"protfilter=2", \ | |
"verbosity=0", \ | |
"ubxhandler=lambda msg: print(jsons.dumps((lambda msg: {key:value for (key,value) in dict(msg.__dict__, **{'msg':msg.identity}).items() if not key.startswith('_') } )(msg)))", \ | |
"msgfilter=NAV-PVT"] | |
data_format = "json" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment