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

fix: Ignore modem state when getting position from MM #5532

Conversation

nicolatimeus
Copy link
Contributor

Note: We are using the Conventional Commits convention for our pull request titles. Please take a look at the PR title format document for the supported types and scopes.

Brief description of the PR. [e.g. Added null check on object to avoid NullPointerException]

The ModemManager position provider currently tries to get the location only from modems that are in the MM_MODEM_STATE_CONNECTED or MM_MODEM_STATE_REGISTERED state. This prevents to be able to get the location at least in the following cases:

  • Modem GPS is enabled in Kura web UI but IPv4 and IPv6 status is set to disabled
  • The modem is enabled for wan but it is not registered to a cellular network (e.g. the cellular antenna is not connected or cellular signal level is low)

This PR removes the filtering based on modem state to decouple the ability to get the location information from the state of the cellular connection.

@nicolatimeus nicolatimeus marked this pull request as ready for review November 8, 2024 11:14
@MMaiero MMaiero requested a review from mattdibi November 8, 2024 13:21
@mattdibi
Copy link
Contributor

mattdibi commented Nov 8, 2024

Tested on DG1014

Enabled GPS mode "managed GPS" via ESF UI resulting in:

image

root@dynagate-10-14:/home/guest# mmcli -m 0 --location-status
  ------------------------
  Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea, agps-msa, agps-msb
           |      enabled: gps-raw, gps-nmea
           |      signals: no
  ------------------------
  GPS      | refresh rate: 30 seconds
root@dynagate-10-14:/home/guest# mmcli -m 0 --location-get
  ----------------
  GPS |      nmea: $GPGSA,[REDACTED]
      |            $GPRMC,[REDACTED]
      |            $GPGSV,[REDACTED]
      |            $GPGSV,[REDACTED]
      |            $GPGSV,[REDACTED]
      |            $GPGSV,[REDACTED]
      |            $GPVTG,[REDACTED]
      |            $GPGGA,[REDACTED]
      |       utc: 152158.00
      | longitude: [REDACTED]
      |  latitude: [REDACTED]
      |  altitude: [REDACTED]

Once enabled PositionService using modemManager provider I can correctly query position via Rest API:

image

curl -k -u admin:eurotech https:/172.16.0.1/services/position/v1/position | jq .
{
  "longitude": [REDACTED],
  "latitude": [REDACTED],
  "altitude": [REDACTED],
  "speed": 0.0,
  "track": 260.1,
  "gnssType": [
    "Gps"
  ]
}

During all of this the modem connection was disabled:

image

image


Before this PR, the same call would result in:

curl -k -u admin:eurotech https:/172.16.0.1/services/position/v1/position
{"message":"Service unavailable. Position is not locked."}%  

@mattdibi mattdibi merged commit e6694b7 into eclipse-kura:develop Nov 8, 2024
5 checks passed
eclipse-kura-bot pushed a commit that referenced this pull request Nov 8, 2024
Signed-off-by: Nicola Timeus <[email protected]>
(cherry picked from commit e6694b7)
mattdibi pushed a commit that referenced this pull request Nov 9, 2024
…se-5.6.0] (#5534)

fix: Ignore modem state when getting position from MM (#5532)

Signed-off-by: Nicola Timeus <[email protected]>
(cherry picked from commit e6694b7)

Co-authored-by: nicolatimeus <[email protected]>
MMaiero pushed a commit that referenced this pull request Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants