Got a SMS that ModemManager's PDU decoding can't handle
If we manage to fix this one I think a lot of people will benefit from it. While debugging other issues, I found I had a stuck message in my modem's memory. Thankfully, when ModemManager has an issue decoding a message it leaves it there instead of deleting it (and making a problem in my firmware show up too).
The stuck message I have is nothing special, just a GSM-7 encoded message from my carrier, with the only special thing I can see, is that it doesn't provide a source number (though that is correctly read in ModemManager):
ModemManager[9332]: <debug> [1671254668.456916] [/dev/cdc-wdm0] sent generic request (translated)...
<<<<<< QMUX:
<<<<<< length = 24
<<<<<< flags = 0x00
<<<<<< service = "wms"
<<<<<< client = 1
<<<<<< QMI:
<<<<<< flags = "none"
<<<<<< transaction = 11
<<<<<< tlv_length = 12
<<<<<< message = "Raw Read" (0x0022)
<<<<<< TLV:
<<<<<< type = "Message Mode" (0x10)
<<<<<< length = 1
<<<<<< value = 01
<<<<<< translated = gsm-wcdma
<<<<<< TLV:
<<<<<< type = "Message Memory Storage ID" (0x01)
<<<<<< length = 5
<<<<<< value = 01:02:00:00:00
<<<<<< translated = [ storage_type = 'nv' memory_index = '2' ]
ModemManager[9332]: <debug> [1671254668.483215] [/dev/cdc-wdm0] received message...
<<<<<< RAW:
<<<<<< length = 193
<<<<<< data = 01:C0:00:80:05:01:02:0B:00:22:00:B4:00:02:04:00:00:00:00:00:01:AA:00:00:06:A6:00:07:91:43:26:92:69:11:F1:64:10:D0:D0:32:BC:0C:47:BF:DD:65:00:00:22:01:01:41:21:35:80:9C:03:24:01:02:A0:D6:41:F0:32:39:4D:7E:83:F2:61:D0:BC:0C:2A:BB:C7:F5:B2:9B:2E:0F:83:CA:6E:90:BC:0C:0F:CB:E9:6F:50:1E:14:76:D3:CB:73:10:B9:0C:62:87:E7:A0:58:0E:0D:2A:B3:41:74:79:D8:3D:87:BF:E5:F4:F4:9C:1E:06:D1:CB:20:74:58:BE:09:83:CA:6E:BA:BC:7C:0E:83:C8:65:36:A8:9D:9E:B7:DF:2E:90:B4:3C:AE:97:E5:E4:30:88:5E:76:97:E5:A0:30:A8:1D:76:BF:41:65:36:88:E8:4C:82:E0:61:79:18:04:7F:93:CB:72:90:BC:3C:4E:8B:D3:72:F6:DB:05
ModemManager[9332]: <debug> [1671254668.485543] [/dev/cdc-wdm0] received generic response (translated)...
<<<<<< QMUX:
<<<<<< length = 192
<<<<<< flags = 0x80
<<<<<< service = "wms"
<<<<<< client = 1
<<<<<< QMI:
<<<<<< flags = "response"
<<<<<< transaction = 11
<<<<<< tlv_length = 180
<<<<<< message = "Raw Read" (0x0022)
<<<<<< TLV:
<<<<<< type = "Result" (0x02)
<<<<<< length = 4
<<<<<< value = 00:00:00:00
<<<<<< translated = SUCCESS
<<<<<< TLV:
<<<<<< type = "Raw Message Data" (0x01)
<<<<<< length = 170
<<<<<< value = 00:06:A6:00:07:91:43:26:92:69:11:F1:64:10:D0:D0:32:BC:0C:47:BF:DD:65:00:00:22:01:01:41:21:35:80:9C:03:24:01:02:A0:D6:41:F0:32:39:4D:7E:83:F2:61:D0:BC:0C:2A:BB:C7:F5:B2:9B:2E:0F:83:CA:6E:90:BC:0C:0F:CB:E9:6F:50:1E:14:76:D3:CB:73:10:B9:0C:62:87:E7:A0:58:0E:0D:2A:B3:41:74:79:D8:3D:87:BF:E5:F4:F4:9C:1E:06:D1:CB:20:74:58:BE:09:83:CA:6E:BA:BC:7C:0E:83:C8:65:36:A8:9D:9E:B7:DF:2E:90:B4:3C:AE:97:E5:E4:30:88:5E:76:97:E5:A0:30:A8:1D:76:BF:41:65:36:88:E8:4C:82:E0:61:79:18:04:7F:93:CB:72:90:BC:3C:4E:8B:D3:72:F6:DB:05
<<<<<< translated = [ message_tag = 'mt-read' format = 'gsm-wcdma-point-to-point' raw_data = '{ [0] = '7 ' [1] = '145 ' [2] = '67 ' [3] = '38 ' [4] = '146 ' [5] = '105 ' [6] = '17 ' [7] = '241 ' [8] = '100 ' [9] = '16 ' [10] = '208 ' [11] = '208 ' [12] = '50 ' [13] = '188 ' [14] = '12 ' [15] = '71 ' [16] = '191 ' [17] = '221 ' [18] = '101 ' [19] = '0 ' [20] = '0 ' [21] = '34 ' [22] = '1 ' [23] = '1 ' [24] = '65 ' [25] = '33 ' [26] = '53 ' [27] = '128 ' [28] = '156 ' [29] = '3 ' [30] = '36 ' [31] = '1 ' [32] = '2 ' [33] = '160 ' [34] = '214 ' [35] = '65 ' [36] = '240 ' [37] = '50 ' [38] = '57 ' [39] = '77 ' [40] = '126 ' [41] = '131 ' [42] = '242 ' [43] = '97 ' [44] = '208 ' [45] = '188 ' [46] = '12 ' [47] = '42 ' [48] = '187 ' [49] = '199 ' [50] = '245 ' [51] = '178 ' [52] = '155 ' [53] = '46 ' [54] = '15 ' [55] = '131 ' [56] = '202 ' [57] = '110 ' [58] = '144 ' [59] = '188 ' [60] = '12 ' [61] = '15 ' [62] = '203 ' [63] = '233 ' [64] = '111 ' [65] = '80 ' [66] = '30 ' [67] = '20 ' [68] = '118 ' [69] = '211 ' [70] = '203 ' [71] = '115 ' [72] = '16 ' [73] = '185 ' [74] = '12 ' [75] = '98 ' [76] = '135 ' [77] = '231 ' [78] = '160 ' [79] = '88 ' [80] = '14 ' [81] = '13 ' [82] = '42 ' [83] = '179 ' [84] = '65 ' [85] = '116 ' [86] = '121 ' [87] = '216 ' [88] = '61 ' [89] = '135 ' [90] = '191 ' [91] = '229 ' [92] = '244 ' [93] = '244 ' [94] = '156 ' [95] = '30 ' [96] = '6 ' [97] = '209 ' [98] = '203 ' [99] = '32 ' [100] = '116 ' [101] = '88 ' [102] = '190 ' [103] = '9 ' [104] = '131 ' [105] = '202 ' [106] = '110 ' [107] = '186 ' [108] = '188 ' [109] = '124 ' [110] = '14 ' [111] = '131 ' [112] = '200 ' [113] = '101 ' [114] = '54 ' [115] = '168 ' [116] = '157 ' [117] = '158 ' [118] = '183 ' [119] = '223 ' [120] = '46 ' [121] = '144 ' [122] = '180 ' [123] = '60 ' [124] = '174 ' [125] = '151 ' [126] = '229 ' [127] = '228 ' [128] = '48 ' [129] = '136 ' [130] = '94 ' [131] = '118 ' [132] = '151 ' [133] = '229 ' [134] = '160 ' [135] = '48 ' [136] = '168 ' [137] = '29 ' [138] = '118 ' [139] = '191 ' [140] = '65 ' [141] = '101 ' [142] = '54 ' [143] = '136 ' [144] = '232 ' [145] = '76 ' [146] = '130 ' [147] = '224 ' [148] = '97 ' [149] = '121 ' [150] = '24 ' [151] = '4 ' [152] = '127 ' [153] = '147 ' [154] = '203 ' [155] = '114 ' [156] = '144 ' [157] = '188 ' [158] = '60 ' [159] = '78 ' [160] = '139 ' [161] = '211 ' [162] = '114 ' [163] = '246 ' [164] = '219 ' [165] = '5 '}' ]
ModemManager[9332]: <debug> [1671254668.486804] [modem0] parsing PDU (2)...
ModemManager[9332]: <debug> [1671254668.487031] [modem0] SMSC address parsed: '+34622996111'
ModemManager[9332]: <debug> [1671254668.487191] [modem0] deliver type PDU detected
ModemManager[9332]: <debug> [1671254668.487370] [modem0] number parsed: Pepephone
ModemManager[9332]: <debug> [1671254668.487683] [modem0] PID: 0
ModemManager[9332]: <debug> [1671254668.487843] [modem0] user data encoding is GSM7
ModemManager[9332]: <debug> [1671254668.487996] [modem0] user data length: 156 elements
ModemManager[9332]: <debug> [1671254668.488149] [modem0] user data length: 137 bytes
ModemManager[9332]: <debug> [1671254668.488295] [modem0] decoding SMS text with 151 elements
ModemManager[9332]: <debug> [1671254668.488610] [modem0] error parsing PDU (2): Invalid conversion from GSM to UTF-8: Invalid conversion from GSM7
ModemManager[9332]: <debug> [1671254668.488798] [modem0] loading 3GPP MO-sent messages from storage 'me'...
ModemManager[9332]: <debug> [1671254668.489154] [/dev/cdc-wdm0] sent message...
<<<<<< RAW:
<<<<<< length = 25
<<<<<< data = 01:18:00:00:05:01:00:0C:00:31:00:0C:00:12:01:00:01:11:01:00:02:01:01:00:01
For an easier read, this is the entire PDU:
07914326926911f16410d0d032bc0c47bfdd650000220101412135809c03240102a0d641f032394d7e83f261d0bc0c2abbc7f5b29b2e0f83ca6e90bc0c0fcbe96f501e1476d3cb7310b90c6287e7a0580e0d2ab3417479d83d87bfe5f4f49c1e06d1cb207458be0983ca6ebabc7c0e83c86536a89d9eb7df2e90b43cae97e5e430885e7697e5a030a81d76bf41653688e84c82e0617918047f93cb7290bc3c4e8bd372f6db05
And this is the text that should be decoded from GSM-7: Tu pedido ya se encuentra en reparto y antes de las 19h el transportista te har entrega del mismo. Recuerda tener a mano el DNI para poder recibirlo.
Currently my firmware can't handle this message either, so I'm trying to find what's different about this particular message, but I'm guessing some other reports I got from people where they could not get certain 2FA auth messages could have this very same issue