Using GPS of Ericsson F5521gw in Ubuntu with gpsd

I already tried to use the GPS of my Ericsson F5521gw in my Lenovo L520 a couple of month ago with Ubuntu 12.04 (precise), however it didn’t work out of the box. As the release of 14.04 (trusty) was close, I decided to wait.

However it didn’t work with trusty either. Therefore I decided to dig into the problem. I came up with the following dirty workaround:

First run

$ sudo apt-get install gpsd gpsd-clients wvdial

Edit the /etc/wvdial.conf to look like this:

[Dialer Defaults]
New PPPD = yes
Stupid Mode = 1
Modem Type = USB Modem

[Dialer gps]
Modem = /dev/ttyACM2
Init1 = AT*E2GPSCTL=1,5,1
Init2 = AT*E2GPSNPD

Now we can begin to start gpsd. First establish a connection to your mobile provider with the network manager (upper right corner in Unity).

Then create a pipe somewhere and use wvdial to setup the GPS:

$ mkfifo /root/gps_pipe

$ wvdial gps

The GPS should now transmit data on /dev/ttyACM2. You can have a look at it with “$ cat /dev/ttyACM2”. Stuff the output into the pipe and start gpsd in read only mode:

$ cat /dev/ttyACM2 > /root/gps_pipe

$ gpsd -n -N -D4 -b /root/gps_pipe

If cat stops, just restart cat. If gpsd throws an error, restart it as well. It should work after a couple of attempts. If there is any better solution, you’re welcome to contact me.

[Update] Fix for the cat error: run gpsd with a user that has no write rights on the pipe. I created a pipe in tmp as root

$ mkfifo /tmp/gps_pipe

The pipe should have only read rights for others. Then I can execute gpsd as a normal user and cat does not stop:

$ gpsd -n -N -D4 -b /root/gps_pipe

I used the following ressources:

[1] http://www.thinkwiki.org/wiki/Ericsson_F3507g_Mobile_Broadband_Module

[2] http://forum.ubuntuusers.de/topic/gps-mit-ericsson-mbm-f3705g-einrichten/

[3] http://sourceforge.net/apps/mediawiki/mbm/index.php?title=MBM#GPS_Control_.28mbm-gpsd.29

[4] http://www.tjansson.dk/2009/01/using-the-builtin-gps-in-a-thinkpad-x200-under-linux/