0183 heading
$HCHDM,138.01,M
Is this a valid NMEA 0183 sentence (Heading Magnetic)? kplex seems to ignore it.
9 Replies
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.
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.
you can manually edit settings.json to launch a subprocess and its stdout will be piped into the data provider pipeline
GitHub
signalk-server/settings/commandline-provider-settings.json at maste...
An implementation of a Signal K central server for boats. - SignalK/signalk-server
consider producing directly signalk json, no need to generate 0183
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.
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
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?
Just demo code. The input is the plugin config