Trying to understand ModemManager



Hello,
I have a platform that has no GUI so I am trying to initialize a couple of 3G modems (Huawei EM820W and 
Sierra Wireless MC8705) to use as data connections when away from the local network.

I have downloaded and compiled ModemManager and it seems to be working well with the daemon, the cards can be 
detected and various parameters can be extracted using the mmcli app.

I am having some trouble in actually getting a useable connection.
Previously with one of the cards  (Sierra Wireless MC8705) I could manually setup with the AT commands, 
connect and get a valid IP address with all the dns and routing being setup with dhclient.

I would like to have the same result but using ModemManager, if it is possible.  Here is some debug about 
what I am attempting to do:

# mmcli -m 0 --list-bearers

No bearers were found
# mmcli -m 0

/org/freedesktop/ModemManager1/Modem/0 (device id '61d98ebe0deeb14a83d951229303f0e8a245cd35')
 -------------------------
 Hardware |   manufacturer: 'huawei'
          |          model: 'EM820W'
          |       revision: '11.809.05.80.00'
          |   capabilities: 'gsm-umts'
          |        current: 'gsm-umts'
          |   equipment id: '3542830400XXXXX'
 -------------------------
 System   |         device: '/sys/devices/platform/usbhs_omap/ehci-omap.0/usb1/1-1/1-1.1'
          |        drivers: 'option1'
          |         plugin: 'Huawei'
          |   primary port: 'ttyUSB3'
 -------------------------
 Numbers  |           own : '+4475398XXXXX'
 -------------------------
 Status   |           lock: 'none'
          | unlock retries: 'sim-pin (3), sim-pin2 (3), sim-puk (10), sim-puk2 (10)'
          |          state: 'disabled'
          |    access tech: 'unknown'
          | signal quality: '0' (cached)
 -------------------------
 Modes    |      supported: '2g, 3g'
          |        allowed: '2g, 3g'
          |      preferred: 'none'
 -------------------------
 Bands    |      supported: 'unknown'
          |        current: 'unknown'
 -------------------------
 3GPP     |           imei: '3542830400XXXXX'
          |  enabled locks: 'none'
          |    operator id: 'unknown'
          |  operator name: 'unknown'
          |   registration: 'unknown'
 -------------------------
 SIM      |           path: '/org/freedesktop/ModemManager1/SIM/0'

So it looks like the modem is detected.  I then tried to connect by creating the bearer info (I'm using 
tmobile in the UK);
# mmcli -m 0 --create-bearer="apn=general.t-mobile.uk,user=t-mobile,password=tm,
number=*99#"
Successfully created new bearer in modem:
       /org/freedesktop/ModemManager1/Bearer/2

# mmcli -m 0 -c -b /org/freedesktop/ModemManager1/Bearer/2
ModemManager[805]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (registered -> 
connecting)
ModemManager[805]: <info>  (ttyUSB0) opening serial port...
ModemManager[805]: <warn>  (ttyUSB0): port attributes not fully set
ModemManager[805]: <warn>  Couldn't initialize PDP context with our APN: 'Serial command timed out'
ModemManager[805]: <info>  (ttyUSB0) closing serial port...
ModemManager[805]: <info>  (ttyUSB0) serial port closed
ModemManager[805]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (connecting -> 
registered)
error: couldn't connect the bearer: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Serial.ResponseTimeout: 
Serial command timed out'

Which looked like it failed but the status shows

# mmcli -m 0 --simple-status

/org/freedesktop/ModemManager1/Modem/0
 -------------------------
 Status |          state: 'registered'
        | signal quality: '6' (cached)
        |          bands: 'unknown'
        |    access tech: 'umts'
 -------------------------
3GPP    |   registration: 'home'
        |  operator code: '23433'
        |  operator name: 'Orange'

So then decided to try the example with simple-connect

# mmcli -m 0 --simple-connect="pin=1234,apn=internet"
ModemManager[805]: <info>  Simple connect started...
ModemManager[805]: <info>  Simple connect state (4/10): Wait to get fully enabled
ModemManager[805]: <info>  Simple connect state (5/10): Allowed mode
ModemManager[805]: <info>  Simple connect state (6/10): Bands
ModemManager[805]: <info>  Simple connect state (7/10): Register
ModemManager[805]: <info>  Simple connect state (8/10): Bearer
ModemManager[805]: <info>  Simple connect state (9/10): Connect
ModemManager[805]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (registered -> 
connecting)
ModemManager[805]: <info>  (ttyUSB0) opening serial port...
ModemManager[805]: <warn>  (ttyUSB0): port attributes not fully set
ModemManager[805]: <info>  Modem /org/freedesktop/ModemManager1/Modem/0: state changed (connecting -> 
connected)
ModemManager[805]: <info>  Simple connect state (10/10): All done
successfully connected the modem

That seemed to work ???
# mmcli -m 0 --simple-status

/org/freedesktop/ModemManager1/Modem/0
 -------------------------
 Status |          state: 'registered'
        | signal quality: '6' (cached)
        |          bands: 'unknown'
        |    access tech: 'umts'
 -------------------------
3GPP    |   registration: 'home'
        |  operator code: '23433'
        |  operator name: 'Orange'

So how do I reliably get to connect and then generate a wwan0 network interface ?  Do I need to use 
NetworkManager to obtain an IP interface to allow for routing ?

As you can guess I am in the early learning stages with this.  Once I get the IP connection sorted I would 
like to look at the gps.  This also isn't working when I try....

# mmcli -m 0 --location-status

/org/freedesktop/ModemManager1/Modem/0
 ----------------------------
 Location | capabilities: '3gpp-lac-ci'
          |      enabled: '3gpp-lac-ci'
          |      signals: 'no'

# mmcli -m 0 --location-get-3gpp
error: couldn't get 3GPP-based location from the modem: 'not available'

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

But the specs for the modem state that it can do NMEA gps?? Confusing.

Hopefully someone can help with this one.

Thanks in advance

Marc




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