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

GPS Example #4

Open
johnnyman727 opened this issue May 25, 2014 · 3 comments
Open

GPS Example #4

johnnyman727 opened this issue May 25, 2014 · 3 comments

Comments

@johnnyman727
Copy link
Contributor

I propose that we change the GPS example such that it doesn't print out the entire list of detected satellites. Instead it prints out how many satellites have a fix out of the requisite for a coordinate fix.

@ekolker
Copy link
Member

ekolker commented May 26, 2014

This is hard and/or misleading because the data with the information about the satellites' signal strengths spans multiple NMEA messages from the GPS...and ultimately may not mean anything useful. It would be easier (I think) to just report the number of visible satellites.

More fundamentally, individual satellite's don't get a fix, per se. At some point, their signal is sufficiently strong such that they can be used to calculate a fix, and you need 4+ of such satellites in order to actually get a fix.
In other words, there's a difference between knowing

  • that satellites are in the sky/visible
  • which satellites are in the sky/visible
  • getting a sufficiently strong signal from said sats such that, given 4 visible sats, you'd be able to get a fix

@tcr
Copy link
Member

tcr commented May 26, 2014

Proposing output like...

$ tessel run gps-example.js
Waiting for satellites...
1 satellites visible, 0 fixed.
5 satellites visible, 0 fixed.
6 satellites visible, 0 fixed.
8 satellites visible, 1 fixed.
12 satellites visible, 3 fixed.
12 satellites visible, 4 fixed.
Achieved lock on 4 visible satellites.
[[actual info]]

@ekolker
Copy link
Member

ekolker commented May 26, 2014

Producing that output would require parsing two different kinds of messages: one that contains the number of visible satellites and a series of a different kind of message (usually 3 messages back to back, if memory serves) which have information for signal strength and possibly for azimuth/elevation.

This should all happen in the example file as opposed to the module's library because saving state like that by default is a bad idea. E.g.: you have a good fix, then go into a tunnel and receive/rely on incorrect or outdated information the next time you ask the module for coordinates.

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

3 participants