fgsect / scat

SCAT: Signaling Collection and Analysis Tool
GNU General Public License v2.0
346 stars 93 forks source link

Conversion from qmdl to pcap aborted due error while parsing #66

Closed Mk-arc closed 1 year ago

Mk-arc commented 1 year ago
2023-04-05 21:58:47,270 scat.qualcommparser (read_dump) INFO: Reading from /home/kisle/20230405_212312_0000.qmdl
2023-04-05 21:58:47,297 scat.qualcommparser (parse_lte_mib) WARNING: Unknown LTE MIB packet version 0x03
2023-04-05 21:58:47,304 scat.qualcommparser (parse_lte_mib) WARNING: Unknown LTE MIB packet version 0x03
2023-04-05 21:58:47,307 scat.qualcommparser (parse_lte_ml1_scell_meas_response) WARNING: Unknown LTE ML1 Serving Cell Meas Serving Cell Measurement Result subpacket version 18
Radio 0: LTE RRC SCell Info: EARFCN 6400/24400, Band 20, Bandwidth 10/10 MHz, PCI 100, xTAC/xCID 63a1/1b6430d, MCC 262, MNC 01
2023-04-05 21:58:47,317 scat.qualcommparser (parse_lte_mac_rach_response) WARNING: Unexpected MAC RACH Response Subpacket version 4
2023-04-05 21:58:47,319 scat.qualcommparser (parse_lte_ml1_scell_meas_response) WARNING: Unknown LTE ML1 Serving Cell Meas Serving Cell Measurement Result subpacket version 18
2023-04-05 21:58:47,319 scat.qualcommparser (parse_lte_ml1_scell_meas_response) WARNING: Unknown LTE ML1 Serving Cell Meas Serving Cell Measurement Result subpacket version 18
2023-04-05 21:58:47,320 scat.qualcommparser (parse_lte_ml1_scell_meas_response) WARNING: Unknown LTE ML1 Serving Cell Meas Serving Cell Measurement Result subpacket version 18
2023-04-05 21:58:47,320 scat.qualcommparser (parse_lte_ml1_scell_meas_response) WARNING: Unknown LTE ML1 Serving Cell Meas Serving Cell Measurement Result subpacket version 18
2023-04-05 21:58:47,321 scat.qualcommparser (parse_lte_ml1_scell_meas_response) WARNING: Unknown LTE ML1 Serving Cell Meas Serving Cell Measurement Result subpacket version 18
2023-04-05 21:58:47,321 scat.qualcommparser (parse_lte_pdcp_ul_cip) WARNING: Unexpected PDCP DL Cipher Data Subpacket version 3
2023-04-05 21:58:47,323 scat.qualcommparser (parse_lte_ml1_scell_meas_response) WARNING: Unknown LTE ML1 Serving Cell Meas Serving Cell Measurement Result subpacket version 18
2023-04-05 21:58:47,323 scat.qualcommparser (parse_lte_ml1_scell_meas_response) WARNING: Unknown LTE ML1 Serving Cell Meas Serving Cell Measurement Result subpacket version 18
2023-04-05 21:58:47,324 scat.qualcommparser (parse_lte_ml1_scell_meas_response) WARNING: Unknown LTE ML1 Serving Cell Meas Serving Cell Measurement Result subpacket version 18
2023-04-05 21:58:47,324 scat.qualcommparser (parse_lte_ml1_scell_meas_response) WARNING: Unknown LTE ML1 Serving Cell Meas Serving Cell Measurement Result subpacket version 18
Traceback (most recent call last):
  File "/home/kisle/git/scat/scat.py", line 177, in <module>
    current_parser.read_dump()
  File "/home/kisle/git/scat/parsers/qualcomm/qualcommparser.py", line 277, in read_dump
    self.run_diag()
  File "/home/kisle/git/scat/parsers/qualcomm/qualcommparser.py", line 226, in run_diag
    parse_result = self.parse_diag(pkt)
  File "/home/kisle/git/scat/parsers/qualcomm/qualcommparser.py", line 188, in parse_diag
    return self.parse_diag_log(pkt, args)
  File "/home/kisle/git/scat/parsers/qualcomm/qualcommparser.py", line 329, in parse_diag_log
    return self.process[pkt_header.log_id](pkt_header, pkt_body, args)
  File "/home/kisle/git/scat/parsers/qualcomm/diagltelogparser.py", line 39, in <lambda>
    0xB064: lambda x, y, z: self.parse_lte_mac_ul_block(x, y, z), # LTE MAC UL Transport Block
  File "/home/kisle/git/scat/parsers/qualcomm/diagltelogparser.py", line 647, in parse_lte_mac_ul_block
    subpkt_mac_ul_tb = subpkt_mac_ul_tb_struct._make(struct.unpack('<BBHHBHBBB', subpkt_body[subpkt_pos:subpkt_pos+12]))
  File "/usr/lib/python3.10/collections/__init__.py", line 424, in _make
    raise TypeError(f'Expected {num_fields} arguments, got {len(result)}')
TypeError: Expected 8 arguments, got 9

Any idea what causes this? This is a qmdl log recorded from a BG95 with the QLog utility from Quectel.

peremen commented 1 year ago

I think that will be a quick fix (I also have the exact same modem), and meanwhile you can bypass that function (return None) if you don't need LTE-MAC PDU.

Mk-arc commented 1 year ago

Hi Shinjo,

yeah thats a workaround. also had to fix the timestamp in pcapparser then, since some timestamp was None. But now its at least generating the full log.

Do you know What scat actually parsers? The raw qxdm log has much more data than the resulting pcap.

PS: I think I remember having contact with you through Quectel support :D

best regards Mark Geiger

peremen commented 1 year ago

https://github.com/fgsect/scat/commit/6ca95397a8b3c8e0a3f429ee2d9da7af40bed426 should close the issue.

SCAT's primary goal is RRC and NAS layer (see parsers/qualcomm/diagcmd.py Line 292), so the LTE MAC parsing is not as thoroughly tested as RRC and NAS. The Qualcomm parser is split into the functional blocks, and what LTE parser looks into is defined in parsers/qualcomm/diagltelogparser.py line 18.