gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-users] Dell/Ericsson Mobile Broadband Modem with GPS?


From: TJ
Subject: [gpsd-users] Dell/Ericsson Mobile Broadband Modem with GPS?
Date: Sun, 16 Jun 2013 12:07:03 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6

I'm having some problems figuring out how to have gpsd work with an Ericsson 
Mobile Broadband Modem, the F5521GW, also known as a Dell DW5550.

The device is a mini PCI-express adapter (and is therefore permanently 
installed). This has implications since hot-plug doesn't come into play.

It requires initiating with an AT* command once connected to the device.

The Dell-branded version of the device presents as:

$ sudo lsusb -d 413c:818d -v | grep GPS
    iConfiguration          4 WMC Device with GPS
      iInterface             17 Dell Wireless 5550 HSPA+ Mobile Broadband 
Mini-Card GPS Port
      iInterface             18 Dell Wireless 5550 HSPA+ Mobile Broadband 
Mini-Card GPS Port

The cdc_acm module creates three tty nodes (other devices in the same product 
range present only two).

$ grep -i ACM /var/log/dmesg
[   12.378447] cdc_acm 2-5:1.1: ttyACM0: USB ACM device
[   12.379351] cdc_acm 2-5:1.3: ttyACM1: USB ACM device
[   12.386542] cdc_acm 2-5:1.9: ttyACM2: USB ACM device
[   12.396405] usbcore: registered new interface driver cdc_acm
[   12.396409] cdc_acm: USB Abstract Control Model driver for USB modems and 
ISDN adapters

The devices present as /dev/ttyACM{0,1,2}. Any of them can be used to control 
and talk to the sub-devices. Conventionally the cellular modem is usually 
addressed on ttyACM0 and control messages sent
on ttyACM1. This leaves ttyACM2 available for GPS use at the same time the 
cellular modem is in use.

*Any* port can be used to talk to the GPS receiver (not just ttyACM2).

Activating the device is a three stage process:

# enable modem functions
echo "AT+CFUN=1" | sudo dd of=/dev/ttyACM1
# enable GPS with updates at 2 second intervals
echo "AT*E2GPSCTL=1,2,1" | sudo dd of=/dev/ttyACM1

# connect to the GPS receiver port and send the start command
$ screen -L /dev/ttyACM2

*EMRDY: 1

AT*E2GPSNPD
OK
$GPGSV,3,1,11,15,77,212,19,24,51,265,24,26,40,132,22,18,34,292,16*73
... continuous GPS data


I am trying to find a way to have gpsd send this activation command but so far 
have failed via a device-hook using the control socket to send a command since 
gpsd has dropped privileges and does not
have permission to write to the socket (the script returns error code 98 when 
it does not have write permissions to the socket):

Jun 16 11:36:28 XPSm1530 gpsd[10044]: gpsd:IO: <= client(0): 
?WATCH={"raw":2}\x0d\x0a
Jun 16 11:36:28 XPSm1530 gpsd[10044]: gpsd:INFO: running /etc/gpsd/device-hook 
/dev/ttyACM2 ACTIVATE
Jun 16 11:36:28 XPSm1530 gpsd[10044]: gpsd:INFO: /etc/gpsd/device-hook returned 
98
Jun 16 11:36:28 XPSm1530 gpsd[10044]: gpsd:INFO: opening GPS data source type 2 
at '/dev/ttyACM2'
Jun 16 11:36:29 XPSm1530 gpsd[10044]: gpsd:INFO: speed 9600, 8N1
Jun 16 11:36:29 XPSm1530 gpsd[10044]: gpsd:IO: => GPS: $PASHQ,RID*28\x0d\x0a
Jun 16 11:36:29 XPSm1530 gpsd[10044]: gpsd:IO: => GPS: @F0.3=1*67\x0d\x0a
Jun 16 11:36:29 XPSm1530 gpsd[10044]: gpsd:IO: => GPS: @F2.2=1*64\x0d\x0a
Jun 16 11:36:29 XPSm1530 gpsd[10044]: gpsd:IO: writing oncore control type Cj
Jun 16 11:36:29 XPSm1530 gpsd[10044]: gpsd:IO: => GPS: 
@@Cj)\x0d\x0aRID*28\x0d\x0a


gpsd then goes on probing the device trying to figure out what it is without 
success.

----- /etc/gpsd/device-hook -----
#!/bin/sh
DEVICE=$1
ACTION=$2

if [ -r /etc/default/gpsd ]; then
 . /etc/default/gpsd
fi

if [ -z "$GPSD_SOCKET" ]; then
  exit 99
fi

# logging
echo "$(date +%x-%X) $DEVICE $ACTION $GPSD_SOCKET $(id -u) $(id -g)" >> 
/tmp/device-hook.log

if [ ! -w "$GPSD_SOCKET" ]; then
 exit 98
fi

if [ "x$ACTION" = "xACTIVATE" ]; then
 if [ "x$DEVICE" = "x/dev/ttyACM2" ]; then
  # power up
  cat > /dev/ttyACM1 <<EOT
AT+CFUN=1
AT*E2GPSCTL=1,5,1
EOT
  echo "!$DEVICE=AT*E2GPSNPD" | nc -q 1 -U $GPSD_SOCKET
 fi

elif [ "x$ACTION" = "xDEACTIVATE" ]; then
 if [ "x$DEVICE" = "x/dev/ttyACM2" ]; then
  # power down
  cat > /dev/ttyACM1 <<EOT
AT+CFUN=4
EOT
 fi

else
 exit 0
fi
----------

I can manually send the control command but gpsd doesn't seem to be handling 
the response correctly:

$ echo '!/dev/ttyACM2=AT*E2GPSNPD' | sudo nc -q 1 -U /var/run/gpsd.sock
OK

Jun 16 11:40:48 XPSm1530 gpsd[10044]: gpsd:INFO: control socket connect on fd 10
Jun 16 11:40:48 XPSm1530 gpsd[10044]: gpsd:IO: <= control(10): 
!/dev/ttyACM2=AT*E2GPSNPD\x0a
Jun 16 11:40:48 XPSm1530 gpsd[10044]: gpsd:INFO: <= control(10): writing to 
/dev/ttyACM2
Jun 16 11:40:49 XPSm1530 gpsd[10044]: gpsd:SPIN: close(10) of control socket
Jun 16 11:40:49 XPSm1530 gpsd[10044]: gpsd:UNK: select waits
Jun 16 11:40:49 XPSm1530 gpsd[10044]: gpsd:SPIN: select() {3 5 6 8 9} -> { 9 } 
at 1371379249.010845 (errno 0)
Jun 16 11:40:49 XPSm1530 gpsd[10044]: gpsd:UNK: polling 9
Jun 16 11:40:49 XPSm1530 gpsd[10044]: gpsd:UNK: Read 11 chars to buffer offset 
0 (total 11):
AT*E2GPSNPD28\x0d\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a58\x0d\x0a\x0a)\x0d\x0a
Jun 16 11:40:49 XPSm1530 gpsd[10044]: gpsd:SPIN: packet_get() fd 9 -> 11 (0)
Jun 16 11:40:49 XPSm1530 gpsd[10044]: gpsd:UNK: ISGPS syncing at byte 222: 
0x50925e25
Jun 16 11:40:49 XPSm1530 gpsd[10044]: gpsd:UNK: ISGPS syncing at byte 222: 
0xa124bc4a
Jun 16 11:40:49 XPSm1530 gpsd[10044]: gpsd:UNK: ISGPS syncing at byte 222: 
0x42497894
Jun 16 11:40:49 XPSm1530 gpsd[10044]: gpsd:UNK: ISGPS syncing at byte 222: 
0x8492f128
Jun 16 11:40:49 XPSm1530 gpsd[10044]: gpsd:UNK: ISGPS syncing at byte 222: 
0x0925e250
Jun 16 11:40:49 XPSm1530 gpsd[10044]: gpsd:UNK: ISGPS syncing at byte 222: 
0x124bc4a0
Jun 16 11:40:49 XPSm1530 gpsd[10044]: gpsd:UNK: ISGPS lock never achieved


And using the hex-encoded raw variant:

$ echo '&/dev/ttyACM2=41542a45324750534e5044' | sudo nc -q 1 -U 
/var/run/gpsd.sock
OK

Jun 16 11:48:01 XPSm1530 gpsd[10044]: gpsd:INFO: control socket connect on fd 10
Jun 16 11:48:01 XPSm1530 gpsd[10044]: gpsd:IO: <= control(10): 
&/dev/ttyACM2=41542a45324750534e5044\x0a
Jun 16 11:48:01 XPSm1530 gpsd[10044]: gpsd:INFO: <= control(10): writing 11 
bytes fromhex(AT*E2GPSNPD) to /dev/ttyACM2
Jun 16 11:48:02 XPSm1530 gpsd[10044]: gpsd:SPIN: close(10) of control socket
Jun 16 11:48:02 XPSm1530 gpsd[10044]: gpsd:UNK: select waits
Jun 16 11:48:02 XPSm1530 gpsd[10044]: gpsd:SPIN: select() {3 5 6 8 9} -> { 9 } 
at 1371379682.984802 (errno 0)
Jun 16 11:48:02 XPSm1530 gpsd[10044]: gpsd:UNK: polling 9
Jun 16 11:48:02 XPSm1530 gpsd[10044]: gpsd:UNK: Read 11 chars to buffer offset 
0 (total 11):
AT*E2GPSNPD\x0a\x0a\x0d\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a58\x0d\x0a\x0a)\x0d\x0a
Jun 16 11:48:02 XPSm1530 gpsd[10044]: gpsd:SPIN: packet_get() fd 9 -> 11 (0)
Jun 16 11:48:02 XPSm1530 gpsd[10044]: gpsd:UNK: ISGPS syncing at byte 32: 
0x50925e25
Jun 16 11:48:02 XPSm1530 gpsd[10044]: gpsd:UNK: ISGPS syncing at byte 32: 
0xa124bc4a
Jun 16 11:48:02 XPSm1530 gpsd[10044]: gpsd:UNK: ISGPS syncing at byte 32: 
0x42497894
Jun 16 11:48:02 XPSm1530 gpsd[10044]: gpsd:UNK: ISGPS syncing at byte 32: 
0x8492f128
Jun 16 11:48:02 XPSm1530 gpsd[10044]: gpsd:UNK: ISGPS syncing at byte 32: 
0x0925e250
Jun 16 11:48:02 XPSm1530 gpsd[10044]: gpsd:UNK: ISGPS syncing at byte 32: 
0x124bc4a0
Jun 16 11:48:02 XPSm1530 gpsd[10044]: gpsd:UNK: ISGPS lock never achieved

Talking to the GPS receiver using the E2GPS* commands might enable a simple 
probe for the device:

$ screen -L /dev/ttyACM2

*EMRDY: 1

AT*E2GPSCTL?
*E2GPSCTL: 1,5,1

AT*E2GPSSTAT?
*E2GPSSTAT: 0,2,0,1,0

AT*E2GPSPOS?
*E2GPSPOS: 1,"0.920019","W","52.941860","N","4","51.159092","59.189495"

AT*EEGPSEEDATA?
*EEGPSEEDATA: 0

AT*EEGPSEESTAT?
*EEGPSEESTAT: 0,0,0,0,0,0,0,0

AT*EEGPSEETEST?
*

OK

AT*EGPSSAT?
*EGPSSAT: 0

OK


The device reports its command-list as:

$ echo "AT* " >/dev/ttyACM2
*
A
&C
+CACM
+CAMM
+CAOC
+CBST
+CCFC
+CCHC
+CCHO
+CCLK
+CCWA
+CCWE
+CDIP
+CEAP
+CEER
+CERP
+CFUN
+CGACT
+CGATT
+CGCLASS
+CGCMOD
+CGDATA
+CGDCONT
+CGDSCONT
+CGEQMIN
+CGEQNEG
+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KESET
*EFBS
*EFDORM
*EGNCI
*EGPSSAT
*EGSCI
*EHNET
*EIAAUR
*EIAAUW
*EIAC
*EIACSR
*EIACSW
*EIAD
*EIADNSV6R
*EIADNSV6W
*EIAIPCPR
*EIAIPCPW
*EIALCPR
*EIALCPW
*EIAPSR
*EIAPSSR
*EIAPSSW
*EIAPSW
*EIAR
*EIARUTD
*EIARUTR
*EIARUTW
*EIAW
*EINA
*ELIN
*EMBBR
*EMIBRR
*EMRDY
*EMTLRP
*ENAP
*EONLCMDMODE
*EPBC
*EPBR
*EPBW
*EPEE
*EPHD
*EPIN
*EPINR
*EPKTC
*EPSB
*EREG
*ERINFO
*ESIMR
*ESIMSR
*ESMODE
*ESOM
*ESTKIDLSCR
*ESTKLAN
*ESTKMENU
*ESTKRES
*ESTKS
*ESTKUSRACT
*ESUPLCP
*ESUPLSP
*ETCHF96
*ETZR
*EUPLINK
*EWNCI
*EWSCI
&F
+FCLASS
+GCAP
+GMI
+GMM
+GMR
H
I
+ICF
+IFC
+ILRR
+IPR
L
M
*MEM
O
P
+PACSP
Q
S0
S10
S2
S3
S4
S5
S6
S7
S8
*STKC
*STKE
*STKR
T
V
+VTD
+VTS
&W
X
Z

OK

$ sudo lsusb -d 413c:818d -v | grep -B3  iInterface
      bInterfaceClass         2 Communications
      bInterfaceSubClass      8 Wireless Handset Control
      bInterfaceProtocol      0
      iInterface              5 Dell Wireless 5550 HSPA+ Mobile Broadband 
Mini-Card Device
--
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol      1 AT-commands (v.25ter)
      iInterface              6 Dell Wireless 5550 HSPA+ Mobile Broadband 
Mini-Card Modem
--
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0
      iInterface              7 Dell Wireless 5550 HSPA+ Mobile Broadband 
Mini-Card Modem
--
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol      1 AT-commands (v.25ter)
      iInterface              8 Dell Wireless 5550 HSPA+ Mobile Broadband 
Mini-Card Data Modem
--
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0
      iInterface              9 Dell Wireless 5550 HSPA+ Mobile Broadband 
Mini-Card Data Modem
--
      bInterfaceClass         2 Communications
      bInterfaceSubClass      9 Device Management
      bInterfaceProtocol      1
      iInterface             10 Dell Wireless 5550 HSPA+ Mobile Broadband 
Mini-Card Device Management
--
      bInterfaceClass         2 Communications
      bInterfaceSubClass     13
      bInterfaceProtocol      0
      iInterface             11 Dell Wireless 5550 HSPA+ Mobile Broadband 
Mini-Card Network Adapter
--
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0
      iInterface             14 Dell Wireless 5550 HSPA+ Mobile Broadband 
Mini-Card Network Adapter
--
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      1
      iInterface             15 Dell Wireless 5550 HSPA+ Mobile Broadband 
Mini-Card Network Adapter
--
      bInterfaceClass         2 Communications
      bInterfaceSubClass      9 Device Management
      bInterfaceProtocol      1
      iInterface             16 Dell Wireless 5550 HSPA+ Mobile Broadband 
Mini-Card USIM Port
--
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol      1 AT-commands (v.25ter)
      iInterface             17 Dell Wireless 5550 HSPA+ Mobile Broadband 
Mini-Card GPS Port
--
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0
      iInterface             18 Dell Wireless 5550 HSPA+ Mobile Broadband 
Mini-Card GPS Port
--
      bInterfaceClass         2 Communications
      bInterfaceSubClass      8 Wireless Handset Control
      bInterfaceProtocol      0
      iInterface              5 Dell Wireless 5550 HSPA+ Mobile Broadband 
Mini-Card Device
--
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol      1 AT-commands (v.25ter)
      iInterface              6 Dell Wireless 5550 HSPA+ Mobile Broadband 
Mini-Card Modem
--
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0
      iInterface              7 Dell Wireless 5550 HSPA+ Mobile Broadband 
Mini-Card Modem
--
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol      1 AT-commands (v.25ter)
      iInterface              8 Dell Wireless 5550 HSPA+ Mobile Broadband 
Mini-Card Data Modem
--
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0
      iInterface              9 Dell Wireless 5550 HSPA+ Mobile Broadband 
Mini-Card Data Modem
--
      bInterfaceClass         2 Communications
      bInterfaceSubClass      9 Device Management
      bInterfaceProtocol      1
      iInterface             10 Dell Wireless 5550 HSPA+ Mobile Broadband 
Mini-Card Device Management
--
      bInterfaceClass         2 Communications
      bInterfaceSubClass     13
      bInterfaceProtocol      0
      iInterface             11 Dell Wireless 5550 HSPA+ Mobile Broadband 
Mini-Card Network Adapter
--
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0
      iInterface             14 Dell Wireless 5550 HSPA+ Mobile Broadband 
Mini-Card Network Adapter
--
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      1
      iInterface             15 Dell Wireless 5550 HSPA+ Mobile Broadband 
Mini-Card Network Adapter
--
      bInterfaceClass         2 Communications
      bInterfaceSubClass      9 Device Management
      bInterfaceProtocol      1
      iInterface             16 Dell Wireless 5550 HSPA+ Mobile Broadband 
Mini-Card USIM Port
--
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface             21 ST-Ericsson CD-ROM




reply via email to

[Prev in Thread] Current Thread [Next in Thread]