Modem Manager GPS issue


#1

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?


#4

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?


#5

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?


#6

Well atm I am running the latest production version: Resin OS 2.7.8+rev1 (prod) on a Embeddedpi. 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?


#7

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: '*******'

#8

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.


#9

@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 which works really well and helps testing a lot.


#10

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''

#11

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.


#12

@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.
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

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

Maybe you guys have suggestions on that aswell?

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


#13

@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

#14

@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:

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 the lead developer there is very responsive and helpful.


#15

@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.


#16

@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.


#17

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?


#18

@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.

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.


#19

@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.


#20

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


#21

@RDB We use 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:

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.


#22

@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.