# Modem Manager GPS issue

**URL:** <https://forums.balena.io/t/modem-manager-gps-issue/2444>\
**Category:** Product support\
**Created:** [January 23, 2018, 10:55am UTC](https://forums.balena.io/t/modem-manager-gps-issue/2444 "2018-01-23T10:55:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![RDB](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@RDB](https://forums.balena.io/u/RDB)\
**Post date:** [January 23, 2018, 10:55am UTC](https://forums.balena.io/t/modem-manager-gps-issue/2444/1 "2018-01-23T10:55:13Z")

</div>

Hi All,  
I have a m-PCI-E modem type: Simcom 7100E working with modem manger in Resin Host OS.

```
$ mmcli -L
Found 1 modems:
        /org/freedesktop/ModemManager1/Modem/0 [QUALCOMM INCORPORATED] SIMCOM_SIM7100E

```

Now this modem should have GPS capabilities. But when issuing the command:

```
$ mmcli -m 0 --location-status
/org/freedesktop/ModemManager1/Modem/0
  ----------------------------
  Location | capabilities: '3gpp-lac-ci'
           | enabled: '3gpp-lac-ci'
           | signals: 'no'

```

It is not showing this capability. Same goes for this command:

mmcli -m 0 --location-get

```
/org/freedesktop/ModemManager1/Modem/0
  -------------------------
  3GPP location | Mobile country code: '204'
                  | Mobile network code: '*'
                  | Location area code: ' ****'
                  | Cell ID: ' *********'
  -------------------------
  GPS NMEA traces | Not available
  -------------------------
  Raw GPS | Not available
  -------------------------
  CDMA BS | Not available

```

Is there a way we can update modem manager so it will recognize the GPS capabilities?

---

<div class="post-metadata">

**Author:** ![shaunmulligan](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/shaunmulligan/32/34_2.png) [@shaunmulligan](https://forums.balena.io/u/shaunmulligan)\
**Post date:** [January 23, 2018, 11:06am UTC](https://forums.balena.io/t/modem-manager-gps-issue/2444/4 "2018-01-23T11:06:37Z")

</div>

Hey @RDB , what version of resinOS and board are you testing this on. On resinOS 2.9.6 which we are releasing today we have upgraded ModemManager to 1.6.10 (which is latest stable I believe).

I have seen that certain capabilities require newer kernel versions and some are just not interpreted by MM correctly, for instance the my Quectel EC20 LTE modem should work with Assisted GPS, but modem Manager is never capable of detecting the capability even on my ubuntu machine with kernel 4.13 and latest modemManager. Have you tested this functionality on your laptop and confirmed it working?

---

<div class="post-metadata">

**Author:** ![izavits](https://avatars.discourse-cdn.com/v4/letter/i/7feea3/32.png) [@izavits](https://forums.balena.io/u/izavits)\
**Post date:** [January 23, 2018, 11:08am UTC](https://forums.balena.io/t/modem-manager-gps-issue/2444/5 "2018-01-23T11:08:00Z")

</div>

Hello,  
I see that there are some location options that perhaps are useful.  
Have you tried --location-enable-3gpp?  
If yes, maybe the command you are looking for is --location-get-3gpp?

---

<div class="post-metadata">

**Author:** ![RDB](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@RDB](https://forums.balena.io/u/RDB)\
**Post date:** [January 23, 2018, 11:11am UTC](https://forums.balena.io/t/modem-manager-gps-issue/2444/6 "2018-01-23T11:11:23Z")

</div>

Well atm I am running the latest production version: **Resin OS 2.7.8+rev1 (prod)** on a [Embeddedpi](http://embeddedpi.com). I have tried the dev version aswell. I have not tested it on a laptop. Since i don’t have the possibility to install the modem. Or is there a converter to usb somehow?

---

<div class="post-metadata">

**Author:** ![RDB](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@RDB](https://forums.balena.io/u/RDB)\
**Post date:** [January 23, 2018, 11:14am UTC](https://forums.balena.io/t/modem-manager-gps-issue/2444/7 "2018-01-23T11:14:05Z")

</div>

> [@izavits](#):
>
> Hello,
> 
> I see that there are some location options that perhaps are useful.
> 
> Have you tried --location-enable-3gpp?
> 
> If yes, maybe the command you are looking for is --location-get-3gpp?

Well that command give the location services of the GSM network i think:

```
$ mmcli -m 0 --location-get-3gpp
/org/freedesktop/ModemManager1/Modem/0
  -------------------------
  3GPP location | Mobile country code: '204'
                  | Mobile network code: '*'
                  | Location area code: ' ****'
                  | Cell ID: ' *******'

```

---

<div class="post-metadata">

**Author:** ![izavits](https://avatars.discourse-cdn.com/v4/letter/i/7feea3/32.png) [@izavits](https://forums.balena.io/u/izavits)\
**Post date:** [January 23, 2018, 11:25am UTC](https://forums.balena.io/t/modem-manager-gps-issue/2444/8 "2018-01-23T11:25:07Z")

</div>

So, I would also try the following in order to make sure that location gathering info is enabled:

mmcli -m 0   
–location-enable-gps-raw   
–location-enable-gps-nmea

Besides the above, I would try with the new resinOS as soon as it gets released and also I’d recommend trying on a laptop as Shaun says to make sure that it works.

---

<div class="post-metadata">

**Author:** ![shaunmulligan](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/shaunmulligan/32/34_2.png) [@shaunmulligan](https://forums.balena.io/u/shaunmulligan)\
**Post date:** [January 23, 2018, 11:27am UTC](https://forums.balena.io/t/modem-manager-gps-issue/2444/9 "2018-01-23T11:27:10Z")

</div>

@RDB, ah yeah if its a PCIe modem, then yeah you need a convert like this: [https://www.amazon.co.uk/Vanpower-Mini-Wireless-Adapter-Module/dp/B078Z5T52F/ref=sr\_1\_2?ie=UTF8&qid=1516706690&sr=8-2&keywords=pcie+modem+to+usb](https://www.amazon.co.uk/Vanpower-Mini-Wireless-Adapter-Module/dp/B078Z5T52F/ref=sr_1_2?ie=UTF8&qid=1516706690&sr=8-2&keywords=pcie+modem+to+usb) which works really well and helps testing a lot.

---

<div class="post-metadata">

**Author:** ![RDB](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@RDB](https://forums.balena.io/u/RDB)\
**Post date:** [January 23, 2018, 11:41am UTC](https://forums.balena.io/t/modem-manager-gps-issue/2444/10 "2018-01-23T11:41:02Z")

</div>

Tried the suggested commands, but with no result:

```
$ mmcli -m 0 --location-enable-gps-raw
error: couldn't setup location gathering: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Unsupported: Cannot enable unsupported location sources: 'gps-raw''

```

and:

```
$ mmcli -m 0 --location-enable-gps-nmea
error: couldn't setup location gathering: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Unsupported: Cannot enable unsupported location sources: 'gps-nmea''
```

---

<div class="post-metadata">

**Author:** ![izavits](https://avatars.discourse-cdn.com/v4/letter/i/7feea3/32.png) [@izavits](https://forums.balena.io/u/izavits)\
**Post date:** [January 23, 2018, 11:46am UTC](https://forums.balena.io/t/modem-manager-gps-issue/2444/11 "2018-01-23T11:46:11Z")

</div>

So, I don’t know if I can suggest anything else at this point, besides what Shaun has already said.

What I understand though is that the 3GPP location source will always be enabled by default if it is supported by the modem, while the GPS-specific ones will always be disabled by default. The reason is probably that the GPS location is usually an additional module in the modem, with high power consumption, while the others come for free. So I’d try with a laptop to make sure that everything works there first. Then I’d make sure I have a proper power supply for my device. Then, I’d try again with the new resin OS version.

---

<div class="post-metadata">

**Author:** ![RDB](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@RDB](https://forums.balena.io/u/RDB)\
**Post date:** [January 23, 2018, 11:52am UTC](https://forums.balena.io/t/modem-manager-gps-issue/2444/12 "2018-01-23T11:52:34Z")

</div>

@shaunmulligan Thnx. I will look into the converter.

@izavits i will try the latest resinOS first as i see i can download it now.  
What i do know is that the modem does work with gps functions on the factory base img of [embeddedpi.com](http://embeddedpi.com).  
But that wasn’t with modem manager but with direct commands like described here:  
[http://www.embeddedpi.com/documentation/3g-4g-modems/simcom-5360e-modem-gps-configuration](http://www.embeddedpi.com/documentation/3g-4g-modems/simcom-5360e-modem-gps-configuration)

The problem is if i will try this with the direct commands that i don’t know how to get the custom udev rules in the hostOS, and without breaking the modem functionality at all. Like i described in another post: [Cellular Modem connectivity issues on boot](https://forums.balena.io/t/cellular-modem-connectivity-issues-on-boot/711/59?u=rdb)

Maybe you guys have suggestions on that aswell?

And are there working of the box Modems with GPS on Resin?

---

<div class="post-metadata">

**Author:** ![RDB](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@RDB](https://forums.balena.io/u/RDB)\
**Post date:** [January 23, 2018, 12:08pm UTC](https://forums.balena.io/t/modem-manager-gps-issue/2444/13 "2018-01-23T12:08:02Z")

</div>

@izavits @shaunmulligan Oke i have installed the latest resinOS: Resin OS 2.9.6+rev1 (prod) and tried the following commands without new results:

mmcli -m 0 --location-status  
mmcli -m 0 --location-enable-gps-raw  
mmcli -m 0 --location-enable-gps-nmea

```
mmcli -m 0 --location-get

/org/freedesktop/ModemManager1/Modem/0
  -------------------------
  3GPP location | Mobile country code: '204'
                  | Mobile network code: '*'
                  | Location area code: ' ****'
                  | Cell ID: ' *******'
  -------------------------
  GPS NMEA traces | Not available
  -------------------------
  Raw GPS | Not available
  -------------------------
  CDMA BS | Not available
```

---

<div class="post-metadata">

**Author:** ![shaunmulligan](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/shaunmulligan/32/34_2.png) [@shaunmulligan](https://forums.balena.io/u/shaunmulligan)\
**Post date:** [January 23, 2018, 12:22pm UTC](https://forums.balena.io/t/modem-manager-gps-issue/2444/14 "2018-01-23T12:22:43Z")

</div>

@RDB , the on thing you can try is to set the GPS in unmanaged mode, using `--location-enable-gps-unmanaged` flag and then you can send AT commands to the modem using the following:

```auto
mmcli -m 0 --command="AT+CGPSINFO"

```

You will obviously also need to pass all the commands mentioned in the link above. You should then be able to read the GPS nema sentences from the /dev/ttyUSB\* ( Not sure which number port it will be)

I would also encourage you to raise this question on the modemManager [mailing list](https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel) the lead developer there is very responsive and helpful.

---

<div class="post-metadata">

**Author:** ![RDB](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@RDB](https://forums.balena.io/u/RDB)\
**Post date:** [January 23, 2018, 12:45pm UTC](https://forums.balena.io/t/modem-manager-gps-issue/2444/15 "2018-01-23T12:45:30Z")

</div>

@shaunmulligan Thnx for the suggestion. I will subscribe to the mailing list and see if i can get some help from there. Also i will try to do a manual GPS connection with the AT commands to see if that works.

---

<div class="post-metadata">

**Author:** ![RDB](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@RDB](https://forums.balena.io/u/RDB)\
**Post date:** [January 23, 2018, 1:51pm UTC](https://forums.balena.io/t/modem-manager-gps-issue/2444/16 "2018-01-23T13:51:42Z")

</div>

@shaunmulligan I tried to add this line to the docker file:

```
### copy custom udev rules to container
COPY udev-rules/ /etc/udev/rules.d/

```

and then run:

`$ udevadm trigger`

Then the modem rules are triggered and visible:

```
lrwxrwxrwx 1 root root 7 Jan 23 13:47 modemS3 -> ttyUSB3
lrwxrwxrwx 1 root root 7 Jan 23 13:47 modemS2 -> ttyUSB2
lrwxrwxrwx 1 root root 7 Jan 23 13:47 modemS1 -> ttyUSB1
lrwxrwxrwx 1 root root 7 Jan 23 13:47 modemS0 -> ttyUSB0
lrwxrwxrwx 1 root root 7 Jan 23 13:47 modemPPP -> ttyUSB3
lrwxrwxrwx 1 root root 7 Jan 23 13:47 modemGPS -> ttyUSB1
lrwxrwxrwx 1 root root 7 Jan 23 13:47 modemAT -> ttyUSB2

```

But the downside is that the host OS is losing the modem connection and not recovering from it. So the best thing would be to add the custom udev rules to the hostOS, but i havent seen a solution on how to do this.

Is there a way to add it to the hostOS? So it won’t lose the modem on a restart of the container but still keeps the udev rules. I think i really need those to be sure to always find the right ttyUSB\* for the GPS, since they can shuffle on a reboot.

---

<div class="post-metadata">

**Author:** ![rytterlund](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@rytterlund](https://forums.balena.io/u/rytterlund)\
**Post date:** [January 23, 2018, 7:51pm UTC](https://forums.balena.io/t/modem-manager-gps-issue/2444/17 "2018-01-23T19:51:52Z")

</div>

Hi @RDB.  
I’m also trying to get an embeddedpi to work with modemmanager, however not with the same modem as you. I’m using the Quectel EC20 mini-PCi modem @shaunmulligan mentioned. I can see it listed as an usb device, but not with “mmcli -L”. Did you do anything special to get modemmanager to recognise it?

---

<div class="post-metadata">

**Author:** ![RDB](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@RDB](https://forums.balena.io/u/RDB)\
**Post date:** [January 24, 2018, 7:57am UTC](https://forums.balena.io/t/modem-manager-gps-issue/2444/18 "2018-01-24T07:57:03Z")

</div>

@rytterlund what image are you using? I think i did got it working with Resin OS 2.7.8+rev1but not with the versions before. But iam not sure.

And do you have a app container running? Maybe you can try to put it in Localmode. Then no app container is running. Because of the base img containers running on start the command: _udevadm trigger_ and this is making the modem manger not to recognize the modem anymore. [This is the problem iam running into](https://forums.balena.io/t/cellular-modem-connectivity-issues-on-boot/711/16).

So i think what you can do is to run localmode or run a really basic app. And then try if modem manger is recognizing the modem on the HostOS.

---

<div class="post-metadata">

**Author:** ![rytterlund](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@rytterlund](https://forums.balena.io/u/rytterlund)\
**Post date:** [January 24, 2018, 10:35pm UTC](https://forums.balena.io/t/modem-manager-gps-issue/2444/19 "2018-01-24T22:35:00Z")

</div>

@RDB, you are right. I got modemmanger to recognise the modem when I’m not starting or installing anything in the container. The GPS is working as well, at least the NMEA.

---

<div class="post-metadata">

**Author:** ![RDB](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@RDB](https://forums.balena.io/u/RDB)\
**Post date:** [January 25, 2018, 10:09am UTC](https://forums.balena.io/t/modem-manager-gps-issue/2444/20 "2018-01-25T10:09:41Z")

</div>

@rytterlund Oke nice!  
But how do you get your GPS readings available in your container?

---

<div class="post-metadata">

**Author:** ![sdehaes](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@sdehaes](https://forums.balena.io/u/sdehaes)\
**Post date:** [January 25, 2018, 12:38pm UTC](https://forums.balena.io/t/modem-manager-gps-issue/2444/21 "2018-01-25T12:38:46Z")

</div>

@RDB We use [https://github.com/pyserial/pyserial](https://github.com/pyserial/pyserial) to read the raw GPS messages from the right ttyUSB\* device.

Using the udev rules from the embeddedPI website we found that the right udev rules can be got with this snippet of code:

```auto
GPS_DEVICE="/dev/$(ls /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4\:1.1 | grep ttyUSB)"
AT_DEVICE="/dev/$(ls /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4\:1.2 | grep ttyUSB)"

```

The last number in the path corresponds to the bInterfaceNumber defined in the udev rules.

---

<div class="post-metadata">

**Author:** ![RDB](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@RDB](https://forums.balena.io/u/RDB)\
**Post date:** [January 25, 2018, 1:37pm UTC](https://forums.balena.io/t/modem-manager-gps-issue/2444/22 "2018-01-25T13:37:34Z")

</div>

@sdehaes Thanks, i have a slightly different udev rules file so i had to adjust them a bit.

What i also noticed is that when i run the command udevadm trigger with a 10 sec delay the custom rules are triggered and added correctly and the device keeps hold of the modem. I still have to test this some more, but it might be a working solution.

Edit: I have tested some more but i don’t think adding the delay it is stable enough.

[Next page](https://forums.balena.io/t/modem-manager-gps-issue/2444.md?page=2)
