Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: PGN 127258 - Magnetic Variation. #86

Open
alnavasa opened this issue Oct 13, 2023 · 2 comments
Open

Feature request: PGN 127258 - Magnetic Variation. #86

alnavasa opened this issue Oct 13, 2023 · 2 comments

Comments

@alnavasa
Copy link

Hi, I would need to output this specific PGN so my AIS transmitter gets magnetic variation. It already gets magnetic heading from the NMEA2000 existing compass, but to transmit true heading it needs the magnetic variation, to do the math and then transmit it.

When I have other GPS (MFD) on on the NMEA2000 network it transmits perfectly, but I need the value on the NMEA 2000 network for when the other GPS (MFD) is off, so it can keep transmitting heading.

@alnavasa
Copy link
Author

something like this?
I have pretty much zero coding knowledge, just edited form other code, dont know if its right or wrong, and how to implement it.


module.exports = (app, plugin) => {
  return {
    pgns: [ 127258 ],
    title: 'Angle (127258)',
    optionKey: 'ANGLE',
    keys: ["navigation.magneticVariation"],

    callback: (angle) => {
      try {
        return [
          {
            pgn: 127258,
            "Magnetic Variation": angle,
          }
        ]
      } catch ( err ) {
        console.error(err)
      }
    }
  }
}


@alnavasa
Copy link
Author

@tkurki

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants