This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GPS longitude error
#5
(2019-09-03, 12:14 AM)mikedeflieslife Wrote: I have no experience of using Node Red, is there a template to follow to do what I need?

This solution was published by sbender from the Signal K Team on the signalk-dev forum and it is really good. If the prefered gps is working it filters every other gps. If prefered gps is offline it feallback to other gps.
I think about adding this to the openplotter gui tools.
(https://app.slack.com/client/T02ENM6QA/C...225.072600)

It prefers N2K src=150. (It uses a subflow. If you didn't work with nodered subflow google it to be able to edit the prefered gps)

Code:
[{"id":"1a05e1f9.8eca1e","type":"subflow","name":"Prefer N2k GPS","info":"","category":"","in":[{"x":40,"y":40,"wires":[{"id":"d6944a31.d96088"}]}],"out":[{"x":380,"y":40,"wires":[{"id":"d6944a31.d96088","port":0}]}]},{"id":"d6944a31.d96088","type":"function","z":"1a05e1f9.8eca1e","name":"prefer Antenna","func":"\nconst timeout = 5\nconst prefered = '150'\nlet lastSeen = context.get('lastSeen')\n\n//node.error(`${JSON.stringify(msg.source)}`)\n\nif ( msg.source.src === prefered )\n{\n    node.send(msg)\n    context.set('lastSeen', Date.now())\n    //node.error('go it')\n} else if ( !lastSeen ) {\n    node.send(msg)\n    //node.error('no last')\n} else if ( Date.now() - lastSeen > (timeout *1000)) {\n    node.send(msg)\n    //node.error('timeout')\n}\n\n","outputs":1,"noerr":0,"x":220,"y":40,"wires":[[]]},{"id":"f8b48a68.917e28","type":"tab","label":"Input Filters","disabled":false,"info":""},{"id":"e61d660a.610a38","type":"signalk-input-handler","z":"f8b48a68.917e28","name":"navigation.position","context":"vessels.self","path":"navigation.position","source":"","x":130,"y":140,"wires":[["a638f26c.ad395"]]},{"id":"9397e0dc.6e543","type":"signalk-input-handler-next","z":"f8b48a68.917e28","name":"","x":780,"y":140,"wires":[]},{"id":"12c2f5e6.84575a","type":"signalk-input-handler","z":"f8b48a68.917e28","name":"navigation.datetime","context":"vessels.self","path":"navigation.datetime","source":"","x":130,"y":80,"wires":[["a638f26c.ad395"]]},{"id":"64f51379.986e4c","type":"signalk-input-handler","z":"f8b48a68.917e28","name":"navigation.speedOverGround","context":"vessels.self","path":"navigation.speedOverGround","source":"","x":160,"y":200,"wires":[["a638f26c.ad395"]]},{"id":"a638f26c.ad395","type":"subflow:1a05e1f9.8eca1e","z":"f8b48a68.917e28","name":"","x":500,"y":140,"wires":[["9397e0dc.6e543"]]},{"id":"25454890.bf3828","type":"signalk-input-handler","z":"f8b48a68.917e28","name":"navigation.courseOverGroundTrue","context":"vessels.self","path":"navigation.courseOverGroundTrue","source":"","x":180,"y":260,"wires":[["a638f26c.ad395"]]}]
Reply


Messages In This Thread
GPS longitude error - by mikedeflieslife - 2019-06-18, 10:22 AM
RE: GPS longitude error - by e-sailing - 2019-06-18, 11:35 AM
RE: GPS longitude error - by svkatielee - 2019-06-18, 01:06 PM
RE: GPS longitude error - by mikedeflieslife - 2019-09-03, 12:14 AM
RE: GPS longitude error - by e-sailing - 2019-09-03, 07:13 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)