Problem accessing GPS data from a 4G Sierra Wireless AirPrime module

Hello,
I'm writing you because I'm trying to get some data from the integrated GPS module in a Sierra Wireless 4G module (AirPrime MC7304 - https://source.sierrawireless.com/devices/mc-series/mc7304/).
In particular, I mounted the mPCIe card in a PC Engines APU3C4 board (https://www.pcengines.ch/apu3c4.htm).
After adding a new interface in /etc/config/network, with the right APN of my provider:

config interface 'wwan'
        option proto 'qmi'
        option device '/dev/cdc-wdm0'
        option apn 'web.coopvoce.it'
        option ifname 'wwan0'

And unlocking my SIM with:

uqmi -d /dev/cdc-wdm0 --verify-pin1 xxxx

Everything seems to work correctly, as I get an IP address on wwan0 and I can reach the Internet using 4G.
Also the data status shows that I'm "connected":

root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --get-data-status
"connected"

Now I'm trying to access also the GPS data from this device (which should also support A-GPS), if possible, using gpsd and cgps (which I installed through opkg install gpsd-clients).

However, I can't seem to locate any GPS interface in /dev thus I cannot tell gpsd which interface to use (normally, with USB GPS devices I would expect something like /dev/ttyUSB0).

Do you know how can I access the GPS data in this case? Should I set something using uqmi?

Thank you very much in advance!

You need NMEA port enabled. Check your port composition with AT!USBCOMP? or similar command for your model, mine is 7455.

Edit: your model equivalent is AT!UDUSBCOMP
you can also try AT!CUSTOM="NMEAENABLE",1

1 Like

Thank you very much for your reply!
As I'm not an expert at all (it's the first time I'm dealing with a 4G module on OpenWrt), do you know how can I issue in the right way the AT commands to my Sierra Wireless module? Should I write them to the cdc-wdm0 device?

You can use any terminal like picocom for example.
I guess you should have some /dev/ttyUSB* ports, please check. In my case the AT-command port is ttyUSB1 as I recall.

1 Like

Hello,
I'm very sorry for the big delay in replying you, but unfortunately I could not experiment with the Sierra Wireless 4G module anymore until today.

Thank you very much!
After installing few packages (including kmod-usb-net-sierrawireless, kmod-usb-serial-wwan, kmod-usb-serial-sierrawireless and kmod-usb-serial-qualcomm) I was able to locate three /dev/ttyUSB* devices, of which /dev/ttyUSB2 seem to be the right one to send the AT commands (the other two does not seem to accept any input).

The problem I'm facing now is that it seems to hang very often. Sometimes I'm able to type ati and see some information about the modem, sometimes I'm not even able to do so and after writing at the serial program just hangs (I tried both with screen and minicom).
I was able to write few times AT!UDUSBCOMP (having to re-type twice most of the letters just to see them printed on the serial terminal emulator, as if the serial device was taking my input very slowly), but the program just froze after pushing Return on my keyboard.

Do you know why I'm observing this strange behaviour, which is making it practically impossible to send AT commands?
Am I doing something wrong?
Could it be due to a partially faulty MC7304 mPCIe module?

This is part of my dmesg output, if it could be useful:

[    6.983114] nf_conntrack version 0.5.0 (16384 buckets, 65536 max)
[    7.009638] usbcore: registered new interface driver usbserial
[    7.015988] usbcore: registered new interface driver usbserial_generic
[    7.023048] usbserial: USB Serial support registered for generic
[    7.036523] xt_time: kernel timezone is -0000
[    7.042117] usbcore: registered new interface driver cdc_ether
[    7.049435] usbcore: registered new interface driver cdc_ncm
[    7.056189] usbcore: registered new interface driver ch341
[    7.062023] usbserial: USB Serial support registered for ch341-uart
[    7.073346] PPP generic driver version 2.4.2
[    7.078638] NET: Registered protocol family 24
[    7.085262] qmi_wwan 1-1.4:1.8: cdc-wdm0: USB WDM device
[    7.092308] qmi_wwan 1-1.4:1.8 wwan0: register 'qmi_wwan' at usb-0000:00:13.0-1.4, WWAN/QMI device, 3e:4b:30:19:f8:29
[    7.109258] qmi_wwan 1-1.4:1.10: cdc-wdm1: USB WDM device
[    7.116527] qmi_wwan 1-1.4:1.10 wwan1: register 'qmi_wwan' at usb-0000:00:13.0-1.4, WWAN/QMI device, 3e:4b:30:19:f8:29
[    7.127778] usbcore: registered new interface driver qmi_wwan
[    7.135201] usbcore: registered new interface driver rndis_host
[    7.142071] usbcore: registered new interface driver sierra
[    7.148023] usbserial: USB Serial support registered for Sierra USB modem
[    7.157211] usbcore: registered new interface driver cdc_mbim
[    7.163995] usbcore: registered new interface driver option
[    7.169886] usbserial: USB Serial support registered for GSM modem (1-port)
[    7.179679] usbcore: registered new interface driver qcserial
[    7.185797] usbserial: USB Serial support registered for Qualcomm USB modem
[    7.193647] qcserial 1-1.4:1.0: Qualcomm USB modem converter detected
[    7.200694] usb 1-1.4: Qualcomm USB modem converter now attached to ttyUSB0
[    7.208887] qcserial 1-1.4:1.2: Qualcomm USB modem converter detected
[    7.215986] usb 1-1.4: Qualcomm USB modem converter now attached to ttyUSB1
[    7.225503] qcserial 1-1.4:1.3: Qualcomm USB modem converter detected
[    7.232529] usb 1-1.4: Qualcomm USB modem converter now attached to ttyUSB2
[    7.240243] kmodloader: done loading kernel modules from /etc/modules.d/*
[    9.075084] IPv6: ADDRCONF(NETDEV_UP): eth2: link is not ready
[    9.081182] 8021q: adding VLAN 0 to HW filter on device eth2
[    9.141135] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    9.147308] 8021q: adding VLAN 0 to HW filter on device eth0
[   12.000613] igb 0000:03:00.0 eth2: igb: eth2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX
[   12.010353] IPv6: ADDRCONF(NETDEV_CHANGE): eth2: link becomes ready

Thank you very much in advance!

I can only imagine some software conflict.
Try to temporary delete all the configuration related to your modem, reboot and try using a terminal again.
I have mPCIe to USB adapter, so I can always test a card outside of the router.

1 Like

Thank you very much for your suggestion!
It turned out that I had installed an exra kmod-usb-serial-ch341 package, which was actually not needed. I was not very convinced that it could work, but after uninstalling it I'm finally able to type the AT commands.
I will try again enabling GPS very soon, following your suggestions.

Just out of curiosity, where did you find the mPCIe to USB adapter?

In a common place :wink:
Just search for 'pcie usb wwan' on Aliexpress

1 Like

All right! Thank you!
I was looking for an adapter and I saw there are actually some on the site you mentioned, plus some on Amazon, and I was wondering where did you actually find yours, which, as far as I understood from your posts, seems to work well.