I am using ModemManager to set-up the modem using MBIM and when it sends Attach command the modem reports “detached”. I have tested this outside ModemManager and found out that even though the modem is attached (replied to my query) by just sending the attach command it reports detached !
When the modem is attached and it receives the attach command it should report attached even though it does not do any further action.
The QUERY shows the modem is attached:
$ sudo ./umbim -d /dev/cdc-wdm1 attached nwerror : 0x0000 - unknown packetservicestate : 0x0002 - attached uplinkspeed : 50000000 downlinkspeed : 100000000
However sending SET (immediately after QUERY) reports as detached:
$ sudo ./umbim -d /dev/cdc-wdm1 attach nwerror : 0x0000 - unknown packetservicestate : 0x0004 - detached uplinkspeed : 0 downlinkspeed : 0
ModemManager (from freedesktop.org project and widely used in Ubuntu/Debian etc. distros):
<info> [1570205988.969600] Simple connect started... <debug> [1570205988.975909] PIN: unspecified <debug> [1570205988.977402] Operator ID: unspecified <debug> [1570205988.977983] Allowed roaming: yes <debug> [1570205988.978551] APN: internet <debug> [1570205988.979141] IP family: ipv4 <debug> [1570205988.979739] Allowed authentication: unspecified <debug> [1570205988.981007] User: unspecified <debug> [1570205988.981584] Password: unspecified <info> [1570205988.982157] Simple connect state (4/8): Wait to get fully enabled <info> [1570205988.982787] Simple connect state (5/8): Register <debug> [1570205988.983394] Already registered in network '302300', automatic registration not launched... <info> [1570205988.984744] Simple connect state (6/8): Bearer <debug> [1570205988.985308] Using already existing bearer at '/org/freedesktop/ModemManager1/Bearer/0'... <info> [1570205988.985899] Simple connect state (7/8): Connect <debug> [1570205988.986550] Connecting bearer '/org/freedesktop/ModemManager1/Bearer/0' <info> [1570205988.988012] Modem /org/freedesktop/ModemManager1/Modem/0: state changed (registered -> connecting) <debug> [1570205988.989390] Launching connection with data port (net/wwp0s20f0u9) <debug> [1570205988.990006] Activating packet service... [/dev/cdc-wdm0] Sent message... <<<<<< RAW: <<<<<< length = 52 <<<<<< data = 03:00:00:00:34:00:00:00:21:00:00:00:01:00:00:00:00:00:00:00:A2:89:CC:33:BC:BB:8B:4F:B6:B0:13:3E:C2:AA:E6:DF:0A:00:00:00:01:00:00:00:04:00:00:00:00:00:00:00 [/dev/cdc-wdm0] Sent message (translated)... <<<<<< Header: <<<<<< length = 52 <<<<<< type = command (0x00000003) <<<<<< transaction = 33 <<<<<< Fragment header: <<<<<< total = 1 <<<<<< current = 0 <<<<<< Contents: <<<<<< service = 'basic-connect' (a289cc33-bcbb-8b4f-b6b0-133ec2aae6df) <<<<<< cid = 'packet-service' (0x0000000a) <<<<<< type = 'set' (0x00000001) <<<<<< Fields: <<<<<< PacketServiceAction = 'attach' [/dev/cdc-wdm0] Received message... >>>>>> RAW: >>>>>> length = 76 >>>>>> data = 03:00:00:80:4C:00:00:00:21:00:00:00:01:00:00:00:00:00:00:00:A2:89:CC:33:BC:BB:8B:4F:B6:B0:13:3E:C2:AA:E6:DF:0A:00:00:00:02:00:00:00:1C:00:00:00:00:00:00:00:04:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 [/dev/cdc-wdm0] Received message (translated)... >>>>>> Header: >>>>>> length = 76 >>>>>> type = command-done (0x80000003) >>>>>> transaction = 33 >>>>>> Fragment header: >>>>>> total = 1 >>>>>> current = 0 >>>>>> Contents: >>>>>> status error = 'Failure' (0x00000002) >>>>>> service = 'basic-connect' (a289cc33-bcbb-8b4f-b6b0-133ec2aae6df) >>>>>> cid = 'packet-service' (0x0000000a) <debug> [1570205988.998257] Packet service update: <debug> [1570205988.998850] state: 'detached' <debug> [1570205988.999485] data class: '(null)' <debug> [1570205989.000785] uplink: '0' bps <debug> [1570205989.001394] downlink: '0' bps <debug> [1570205989.001980] Couldn't connect bearer '/org/freedesktop/ModemManager1/Bearer/0': 'Failure' <info> [1570205989.002596] Modem /org/freedesktop/ModemManager1/Modem/0: state changed (connecting -> registered) <debug> [1570205989.003413] Couldn't connect bearer: 'Failure'