5
18
Fork
You've already forked satellite
3

Document supported NmeaSource usage and caveats #4

Closed
opened 2022年08月29日 02:32:41 +02:00 by devrtz · 5 comments
Contributor
Copy link

While hacking on satellite to make it work with the Librem 5 (which uses gnss-share) I've come across the other NmeaSource's and was not quite sure if all of them are actually usable or if it's currently just dead code.

It would be neat to have documented what some of them are for, if and how they can be used (in the code and - where appropriate - in the README).

F.e. one thing I noticed while looking at the code (and then confirmed on my PP) is that there are some errors shown in the logs:

If MM is not running with --debug you can't send AT commands as required (?)
in quectel.py here and here

I've not confirmed where this is error is fatal or if acquiring a GPS fix (I tested mostly indoors) and showing everything in the UI is still possible,
so if this specifically is not really an issue please disregard :)

Thanks for your work on satellite!

While hacking on satellite to make it work with the [Librem 5](https://codeberg.org/devrtz/satellite/src/branch/gnss-share) (which uses [gnss-share](https://gitlab.com/postmarketOS/gnss-share)) I've come across the other `NmeaSource`'s and was not quite sure if all of them are actually usable or if it's _currently_ just dead code. It would be neat to have documented what some of them are for, if and how they can be used (in the code and - where appropriate - in the README). F.e. one thing I noticed while looking at the code (and then confirmed on my PP) is that there are some errors shown in the logs: If MM is not running with `--debug` you can't send AT commands as required (?) in quectel.py [here](https://codeberg.org/tpikonen/satellite/src/branch/main/satellite/quectel.py#L22) and [here](https://codeberg.org/tpikonen/satellite/src/branch/main/satellite/quectel.py#L30) I've not confirmed where this is error is fatal or if acquiring a GPS fix (I tested mostly indoors) and showing everything in the UI is still possible, so if this specifically is not really an issue please disregard :) Thanks for your work on satellite!

Nice to see work on extending compatibility with other platforms! Please send a PR this way when you have something ready.

GNSS-share looks like a nice idea, but out of curiosity, does satellite work on Librem5 with the ModemManager source?

I've come across the other NmeaSource's and was not quite sure if all of them are actually usable or if it's currently just dead code.

There's the base class NmeaSource, its subclass ModemManagerNmeaSource which gets the NMEAs from MM with PyDBUS. QuectelNmeaSource subclasses ModemManagerNmeaSource and does some simple talker fixing specific for Quectel modems. These are all used by default on the Pinephone.

Then there is ReplayNmeaSource which can be used for debugging the NMEA decoding stack by changing the source in the SatelliteApp.init_source().

If MM is not running with --debug you can't send AT commands as required (?)

Yeah, thanks for noticing this, I was also wondering why I don't see info about XTRA data any more :) This does not affect the rest of the program though, but the exceptions should be handled. There's an open bug on MM to get an API for XTRA data info, but it's probably not going to be fixed any time soon.

Nice to see work on extending compatibility with other platforms! Please send a PR this way when you have something ready. GNSS-share looks like a nice idea, but out of curiosity, does satellite work on Librem5 with the ModemManager source? > I've come across the other NmeaSource's and was not quite sure if all of them are actually usable or if it's currently just dead code. There's the base class `NmeaSource`, its subclass `ModemManagerNmeaSource` which gets the NMEAs from MM with PyDBUS. `QuectelNmeaSource` subclasses `ModemManagerNmeaSource` and does some simple talker fixing specific for Quectel modems. These are all used by default on the Pinephone. Then there is `ReplayNmeaSource` which can be used for debugging the NMEA decoding stack by changing the source in the `SatelliteApp.init_source()`. > If MM is not running with --debug you can't send AT commands as required (?) Yeah, thanks for noticing this, I was also wondering why I don't see info about XTRA data any more :) This does not affect the rest of the program though, but the exceptions should be handled. There's an [open bug](https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/439) on MM to get an API for XTRA data info, but it's probably not going to be fixed any time soon.
Author
Contributor
Copy link

GNSS-share looks like a nice idea, but out of curiosity, does satellite work on Librem5 with the ModemManager source?

No, on the L5 the modem GPS antenna is not connected and a separate GPS module from STM is used.

So we end up with a /dev/gnss0 and gnss-share (written by craftyguy from pmOS) has basically 2 functions (afaik):

  • Allow multiple simultaneous consumers of the NMEA data (e.g. if you run cat /dev/gnss0 in 2 terminals neither of the 2 running cats 🐱 will get complete NMEA sentences, but they end up randomly split up)
  • It has facilities for downloading/uploading almanac/ephemeris from/to the GPS module
> GNSS-share looks like a nice idea, but out of curiosity, does satellite work on Librem5 with the ModemManager source? No, on the L5 the modem GPS antenna is not connected and a separate GPS module from STM is used. So we end up with a `/dev/gnss0` and `gnss-share` (written by craftyguy from pmOS) has basically 2 functions (afaik): - Allow multiple simultaneous consumers of the NMEA data (e.g. if you run `cat /dev/gnss0` in 2 terminals neither of the 2 running `cat`s 🐱 will get complete NMEA sentences, but they end up randomly split up) - It has facilities for downloading/uploading almanac/ephemeris from/to the GPS module
Author
Contributor
Copy link

There's an open bug on MM to get an API for XTRA data info, but it's probably not going to be fixed any time soon.

This sounds like it should be doable in a few hours, if already familiar with MM
or in a weekend, if not ;)

> There's an open bug on MM to get an API for XTRA data info, but it's probably not going to be fixed any time soon. This **sounds** like it should be doable in a few hours, if already familiar with MM or in a weekend, if not ;)

This sounds like it should be doable in a few hours, if already familiar with MM
or in a weekend, if not ;)

Well, I have enough experience with the MM codebase to not touch it if I don't really have to :)

[gnss-share] has facilities for downloading/uploading almanac/ephemeris from/to the GPS module

Maybe the XTRA data query could also be performed in gnss-share using devices then? A modem-manager backend for gnss-share could also be written, so that satellite would not have to deal with MM at all (the current PyDBUS MM interface is a bit of a hack).

> This sounds like it should be doable in a few hours, if already familiar with MM or in a weekend, if not ;) Well, I have enough experience with the MM codebase to not touch it if I don't really have to :) > [gnss-share] has facilities for downloading/uploading almanac/ephemeris from/to the GPS module Maybe the XTRA data query could also be performed in gnss-share using devices then? A modem-manager backend for gnss-share could also be written, so that satellite would not have to deal with MM at all (the current PyDBUS MM interface is a bit of a hack).
Author
Contributor
Copy link

A modem-manager backend for gnss-share could also be written

geoclue already talks to MM (or at least Recommends it in Debian),
so I'm not sure what "gnss-share" would gain if it were to grow a MM-based backend.
(but of course that is up to gnss-share maintainers).

Maybe the XTRA data query could also be performed in gnss-share using devices then?

Potentially, I'm not quite familiar what exactly XTRA is (and how it differs/relates to almanac/ephemeris).
If it's just a matter of writing something to /dev/gnss0 this could probably also be done. I'm not sure if writes to the unix socket get propagated to /dev/gnss0.

If on the other hand the XTRA data is almanac/ephemeris, then I don't think the satellite application needs to do anything here (at least for the gnss-share case) as I would consider this to be a system configuration/integration issue.

> A modem-manager backend for gnss-share could also be written geoclue already talks to MM (or at least `Recommends` it in Debian), so I'm not sure what "gnss-share" would gain if it were to grow a MM-based backend. (but of course that is up to gnss-share maintainers). > Maybe the XTRA data query could also be performed in gnss-share using devices then? Potentially, I'm not quite familiar what exactly `XTRA` is (and how it differs/relates to almanac/ephemeris). If it's just a matter of writing **something** to `/dev/gnss0` this could probably also be done. I'm not sure if writes to the unix socket get propagated to `/dev/gnss0`. If on the other hand the `XTRA` data **is** almanac/ephemeris, then I don't think the satellite application needs to do anything here (at least for the gnss-share case) as I would consider this to be a system configuration/integration issue.
Sign in to join this conversation.
No Branch/Tag specified
main
0.9.2
0.9.1
0.9.0
0.5.0
0.4.3
0.4.2
0.4.1
0.4.0
0.3.1
0.3.0
0.2.8
0.2.7
0.2.6
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.1.1
0.1.0
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
tpikonen/satellite#4
Reference in a new issue
tpikonen/satellite
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?