2016-06-23

use Ericsson H5321 gw mobile broadband as GPS, Gentoo Linux Edition


These are mostly notes for my self, but may be useful for others.

other pages say this only works with a sim inserted, it doesn't need to have an active registration though

# lsusb
0bdb:1926 Ericsson Business Mobile Networks BV

kernel modules are needed, since I did not find any documentation, these are in use on my system:

CONFIG_USB_NET_CDC_MBIM
CONFIG_USB_NET_CDC_NCM
CONFIG_USB_WDM
CONFIG_USB_ACM

Not sure if this is needed, but it works with it being there

# cat /etc/modprobe.d/cdc_ncm.conf  
options cdc_ncm prefer_mbim=N

ModemManager needs to be running, so

# systemctl enable ModemManager; systemctl start ModemManager

disable the pin on the sim

# mmcli -i 0 --pin=1234 --disable-pin

then we can activate gps via mmcli for testing:

# mmcli -m 0 --location-enable-gps-nmea
# mmcli -m 0 --location-enable-gps-raw
# mmcli -m 0 --location-get

this should ouptut stuff, once you have a fix you should get a longitude and latitude in the raw section

if you want gui stuff to work:
disable nmea and raw gps, activate unmanaged:

# mmcli -m 0 --location-enable-gps-unmanaged

this allows gpsd to open /dev/ttyACM2, while the modemmanager activates stuff on the control device (ttyACM1)
for testing without forking "-N"

# gpsd -N /dev/ttyACM2

then you need to start a client like foxtrotgps
after that, not before! you have to

# echo -e "AT*E2GPSNPD\r" >/dev/ttyACM2

to persuade the modem to really start giving you values
once you close the client (foxtrotgps) however, gpsd closes the device, which means you have to do the echo stuff again after you connect a client