0183 heading

$HCHDM,138.01,M Is this a valid NMEA 0183 sentence (Heading Magnetic)? kplex seems to ignore it.
9 Replies
PaddyB
PaddyB11mo ago
it's missing the checksum, should be $HCHDM,138.01,M*12. There's an online calculator > https://nmeachecksum.eqth.net/ Also, you can put data into the signalk data fiddler to see what's inside . WHy are you using kplex? Signalk can do everything kplex does.
No description
barnaclebill
barnaclebillOP11mo ago
Thanks! I'm generating heading data from a magnetic sensor using python. I'm sending the $HCHDM sentences to stdout. I thought kplex would be the only way to get it piped into SK.
Teppo Kurki
Teppo Kurki11mo ago
you can manually edit settings.json to launch a subprocess and its stdout will be piped into the data provider pipeline
Teppo Kurki
Teppo Kurki11mo ago
consider producing directly signalk json, no need to generate 0183
Teppo Kurki
Teppo Kurki11mo ago
or you can create plugin that does pretty much the same https://github.com/SignalK/sk-plugin-python-demo
GitHub
GitHub - SignalK/sk-plugin-python-demo: Demonstration of a SK serve...
Demonstration of a SK server plugin in Python. Contribute to SignalK/sk-plugin-python-demo development by creating an account on GitHub.
Teppo Kurki
Teppo Kurki11mo ago
plugin route has the advantage that you can turn it on and off. no need to publish to npm, you can develop it locally and npm link to the server. or npm pack and install from the resulting .tgz. if you put your code in github you can install the plugin from there, you'll have a version controlled back of the code when embarking on something like this you can also ask for different ways to go about it, as there are multiple solutions server provider and plugin solution launch the script for you, so you don't need to manage that part yourself
barnaclebill
barnaclebillOP11mo ago
Thanks, good info. The plugin sounds like the best option. I'm confused about the last part of plugin.py. The first part generates SK every second; I will fill in "environment.compass". What is the purpose of reading JSON from stdin, parsing, and writing to stderr?
Teppo Kurki
Teppo Kurki11mo ago
Just demo code. The input is the plugin config

Did you find this page helpful?