[srslte-users] Can't use srsUE with SIM card reader

Romain romain.mendez.rm at gmail.com
Tue Dec 3 11:07:01 UTC 2019


Good afternoon,
recently I've been trying to use srsUE with a sim card reader, a OMNIKEY AG
CardMan 3121.
But I haven't been able to make it work at all.

So I've tried running the pscs test, it failed but here is the output :

> 11:21:29.432569 [USIM] [I] Available Card Reader: OMNIKEY AG CardMan 3121
> 00 00
> 11:21:29.432658 [USIM] [I] Trying Card Reader: OMNIKEY AG CardMan 3121 00
> 00
> 11:21:29.441373 [USIM] [I] Card=0xd6be83d active_protocol=1 (T0)
> 11:21:29.441559 [USIM] [D] SCARD: select file 3f00
> 11:21:29.441593 [USIM] [D] SCARD: scard_transmit: send
>              0000: 00 a4 00 04 02 3f 00
> 11:21:29.507011 [USIM] [D] SCARD: SCardTransmit: recv
>              0000: 61 32
> 11:21:29.507043 [USIM] [D] SCARD: trying to get response (50 bytes)
> 11:21:29.507051 [USIM] [D] SCARD: scard_transmit: send
>              0000: 00 c0 00 00 32
> 11:21:29.511078 [USIM] [D] SCARD: SCardTransmit: recv
>              0000: 62 30 82 02 78 21 83 02 3f 00 a5 0c 80 01 61 87
>              0010: 01 01 83 04 00 01 0c 40 8a 01 05 8b 06 2f 06 01
>              0020: 07 00 00 c6 09 90 01 c0 83 01 01 83 01 0a 81 02
>              0030: ff ff 90 00
> 11:21:29.511115 [USIM] [I] USIM is supported
> 11:21:29.511125 [USIM] [D] SCARD: select file 2f00
> 11:21:29.511132 [USIM] [D] SCARD: scard_transmit: send
>              0000: 00 a4 00 04 02 2f 00
> 11:21:29.518681 [USIM] [D] SCARD: SCardTransmit: recv
>              0000: 61 28
> 11:21:29.518727 [USIM] [D] SCARD: trying to get response (40 bytes)
> 11:21:29.518743 [USIM] [D] SCARD: scard_transmit: send
>              0000: 00 c0 00 00 28
> 11:21:29.522293 [USIM] [D] SCARD: SCardTransmit: recv
>              0000: 62 26 82 05 42 21 00 23 05 83 02 2f 00 a5 03 c0
>              0010: 01 00 8a 01 05 8b 06 2f 06 01 04 00 00 80 02 00
>              0020: af 81 02 00 c3 88 01 f0 90 00
> 11:21:29.522350 [USIM] [D] SCARD: EF_DIR select
>              0000: 62 26 82 05 42 21 00 23 05 83 02 2f 00 a5 03 c0
>              0010: 01 00 8a 01 05 8b 06 2f 06 01 04 00 00 80 02 00
>              0020: af 81 02 00 c3 88 01 f0
> 11:21:29.522376 [USIM] [D] SCARD: scard_transmit: send
>              0000: 00 b2 01 04 ff
> 11:21:29.529705 [USIM] [D] SCARD: SCardTransmit: recv
>              0000: 6c 23
> 11:21:29.529751 [USIM] [D] SCARD: file length determination response
>              0000: 6c 23
> 11:21:29.529770 [USIM] [D] SCARD: scard_transmit: send
>              0000: 00 b2 01 04 23
> 11:21:29.533007 [USIM] [D] SCARD: SCardTransmit: recv
>              0000: 61 20 4f 10 a0 00 00 00 87 10 02 ff 33 ff ff 89
>              0010: 01 01 01 00 50 0c 47 45 4d 41 4c 54 4f 20 55 53
>              0020: 49 4d ff 90 00
> 11:21:29.533062 [USIM] [D] SCARD: EF_DIR record
>              0000: 61 20 4f 10 a0 00 00 00 87 10 02 ff 33 ff ff 89
>              0010: 01 01 01 00 50 0c 47 45 4d 41 4c 54 4f 20 55 53
>              0020: 49 4d ff
> 11:21:29.533087 [USIM] [D] SCARD: AID from EF_DIR record
>              0000: a0 00 00 00 87 10 02 ff 33 ff ff 89 01 01 01 00
> 11:21:29.533107 [USIM] [D] SCARD: 3G USIM app found from EF_DIR record 1
> 11:21:29.533119 [USIM] [D] SCARD: 3G USIM AID
>              0000: a0 00 00 00 87 10 02 ff 33 ff ff 89 01 01 01 00
> 11:21:29.533138 [USIM] [D] SCARD: select file 0000
> 11:21:29.533150 [USIM] [D] SCARD: select file by AID
>              0000: a0 00 00 00 87 10 02 ff 33 ff ff 89 01 01 01 00
> 11:21:29.533167 [USIM] [D] SCARD: scard_transmit: send
>              0000: 00 a4 04 04 10 a0 00 00 00 87 10 02 ff 33 ff ff
>              0010: 89 01 01 01 00
> 11:21:29.548551 [USIM] [D] SCARD: SCardTransmit: recv
>              0000: 61 42
> 11:21:29.548598 [USIM] [D] SCARD: trying to get response (66 bytes)
> 11:21:29.548612 [USIM] [D] SCARD: scard_transmit: send
>              0000: 00 c0 00 00 42
> 11:21:29.553465 [USIM] [D] SCARD: SCardTransmit: recv
>              0000: 62 40 82 02 78 21 84 10 a0 00 00 00 87 10 02 ff
>              0010: 33 ff ff 89 01 01 01 00 a5 0e 81 03 02 0a 32 82
>              0020: 01 1e 83 04 00 01 0c 40 8a 01 05 8b 06 2f 06 01
>              0030: 09 00 00 c6 09 90 01 c0 83 01 81 83 01 01 81 02
>              0040: ff ff 90 00
> 11:21:29.562340 [USIM] [D] SCARD: reading IMSI from (GSM) EF-IMSI
> 11:21:29.562377 [USIM] [D] SCARD: select file 6f07
> 11:21:29.562390 [USIM] [D] SCARD: scard_transmit: send
>              0000: 00 a4 00 04 02 6f 07
> 11:21:29.571352 [USIM] [D] SCARD: SCardTransmit: recv
>              0000: 61 28
> 11:21:29.571399 [USIM] [D] SCARD: trying to get response (40 bytes)
> 11:21:29.571413 [USIM] [D] SCARD: scard_transmit: send
>              0000: 00 c0 00 00 28
> 11:21:29.574959 [USIM] [D] SCARD: SCardTransmit: recv
>              0000: 62 26 82 02 41 21 83 02 6f 07 a5 09 c0 01 00 91
>              0010: 04 7f 20 6f 07 8a 01 05 8b 06 6f 06 01 05 00 00
>              0020: 80 02 00 09 81 02 00 1b 90 00
> 11:21:29.575015 [USIM] [D] SCARD: file header FSP template
>              0000: 82 02 41 21 83 02 6f 07 a5 09 c0 01 00 91 04 7f
>              0010: 20 6f 07 8a 01 05 8b 06 6f 06 01 05 00 00 80 02
>              0020: 00 09 81 02 00 1b
> 11:21:29.575041 [USIM] [D] SCARD: file header TLV 0x82 len=2
> 11:21:29.575053 [USIM] [D] SCARD: File Descriptor TLV
>              0000: 41 21
> 11:21:29.575072 [USIM] [D] SCARD: file header TLV 0x83 len=2
> 11:21:29.575084 [USIM] [D] SCARD: File Identifier TLV
>              0000: 6f 07
> 11:21:29.575099 [USIM] [D] SCARD: file header TLV 0xa5 len=9
> 11:21:29.575109 [USIM] [D] SCARD: Proprietary information TLV
>              0000: c0 01 00 91 04 7f 20 6f 07
> 11:21:29.575126 [USIM] [D] SCARD: file header TLV 0x8a len=1
> 11:21:29.575137 [USIM] [D] SCARD: Life Cycle Status Integer TLV
>              0000: 05
> 11:21:29.575153 [USIM] [D] SCARD: file header TLV 0x8b len=6
> 11:21:29.575163 [USIM] [D] SCARD: Security attribute TLV
>              0000: 6f 06 01 05 00 00
> 11:21:29.575179 [USIM] [D] SCARD: file header TLV 0x80 len=2
> 11:21:29.575188 [USIM] [D] SCARD: File size TLV
>              0000: 00 09
> 11:21:29.575201 [USIM] [D] SCARD: file_size=9
> 11:21:29.575211 [USIM] [D] SCARD: file header TLV 0x81 len=2
> 11:21:29.575220 [USIM] [D] SCARD: Total file size TLV
>              0000: 00 1b
> 11:21:29.575236 [USIM] [D] SCARD: IMSI file length=9 imsilen=15
> 11:21:29.575248 [USIM] [D] SCARD: scard_transmit: send
>              0000: 00 b0 00 00 09
> 11:21:29.587212 [USIM] [D] SCARD: SCardTransmit: recv
>              0000: 69 82
> 11:21:29.587265 [USIM] [E] SCARD: file read returned unexpected length 2
> (expected 11)
> 11:21:29.587279 [USIM] [E] Error reading IMSI from SIM.
> Error initializing PC/SC USIM.
>

When I launch srsUE I get this output :

Reading configuration file /home/romain/.config/srslte/ue.conf...
>
> Built in Release mode using commit c2de0c67 on branch master.
>
> Opening 1 RF devices with 1 RF channels...
> [INFO] [UHD] linux; GNU C++ version 7.4.0; Boost_106501;
> UHD_3.14.1.1-release
> [INFO] [LOGGING] Fastpath logging disabled at runtime.
> [INFO] [B200] Loading firmware image:
> /usr/share/uhd/images/usrp_b200_fw.hex...
> Opening USRP with args: type=b200,master_clock_rate=23.04e6
> [INFO] [B200] Detected Device: B200mini
> [INFO] [B200] Loading FPGA image:
> /usr/share/uhd/images/usrp_b200mini_fpga.bin...
> [INFO] [B200] Operating over USB 3.
> [INFO] [B200] Initialize CODEC control...
> [INFO] [B200] Initialize Radio control...
> [INFO] [B200] Performing register loopback test...
> [INFO] [B200] Register loopback test passed
> [INFO] [B200] Asking for clock rate 23.040000 MHz...
> [INFO] [B200] Actually got clock rate 23.040000 MHz.
> Failed to initialize USIM.
> Error initializing stack.
> Saving MAC PCAP file
>

And finally, my config file :

#####################################################################
> # srsUE configuration file
> #####################################################################
>
> #####################################################################
> # RF configuration
> #
> # dl_earfcn: Downlink EARFCN code.
> # freq_offset: Uplink and Downlink optional frequency offset (in Hz)
> # tx_gain: Transmit gain (dB).
> # rx_gain: Optional receive gain (dB). If disabled, AGC if enabled
> #
> # Optional parameters:
> # dl_freq: Override DL frequency corresponding to dl_earfcn
> # ul_freq: Override UL frequency corresponding to dl_earfcn
> # nof_radios: Number of available RF devices
> # nof_rf_channels: Number of RF channels per radio
> # nof_rx_ant: Number of RX antennas per channel
> # device_name: Device driver family. Supported options: "auto" (uses first
> found), "UHD" or "bladeRF"
> # device_args: Arguments for the device driver. Options are "auto" or any
> string.
> # Default for UHD: "recv_frame_size=9232,send_frame_size=9232"
> # Default for bladeRF: ""
> # device_args_2: Arguments for the RF device driver 2.
> # device_args_3: Arguments for the RF device driver 3.
> # time_adv_nsamples: Transmission time advance (in number of samples) to
> compensate for RF delay
> # from antenna to timestamp insertion.
> # Default "auto". B210 USRP: 100 samples, bladeRF: 27.
> # burst_preamble_us: Preamble length to transmit before start of burst.
> # Default "auto". B210 USRP: 400 us, bladeRF: 0 us.
> # continuous_tx: Transmit samples continuously to the radio or on bursts
> (auto/yes/no).
> # Default is auto (yes for UHD, no for rest)
> #####################################################################
> [rf]
> dl_earfcn = 1301
> freq_offset = 0
> tx_gain = 50
> rx_gain = 40
>
> #nof_radios = 1
> #nof_rx_ant = 1
>
> # For best performance in 2x2 MIMO and >= 15 MHz use the following
> device_args settings:
> # USRP B210: pass num_recv_frames=64,num_send_frames=64
>
> #device_args = auto
> #time_adv_nsamples = auto
> #burst_preamble_us = auto
> #continuous_tx = auto
>
>
> #####################################################################
> # Packet capture configuration
> #
> # Packet capture is supported at both MAC and NAS layers.
> # MAC-layer packets are captured to file in the compact format
> # decoded by the Wireshark mac-lte-framed dissector.
> # To use this dissector, edit the preferences for DLT_USER to
> # add an entry with DLT=147, Payload Protocol=mac-lte-framed.
> # For more information see: https://wiki.wireshark.org/MAC-LTE
> # NAS-layer packets are dissected with DLT=148, and
> # Payload Protocol = nas-eps.
> #
> # enable: Enable MAC layer packet captures (true/false)
> # filename: File path to use for MAC packet captures
> # nas_enable: Enable NAS layer packet captures (true/false)
> # nas_filename: File path to use for NAS packet captures
> #####################################################################
> [pcap]
> enable = true
> filename = /tmp/ue.pcap
> nas_enable = true
> nas_filename = /tmp/nas.pcap
>
> #####################################################################
> # Log configuration
> #
> # Log levels can be set for individual layers. "all_level" sets log
> # level for all layers unless otherwise configured.
> # Format: e.g. phy_level = info
> #
> # In the same way, packet hex dumps can be limited for each level.
> # "all_hex_limit" sets the hex limit for all layers unless otherwise
> # configured.
> # Format: e.g. phy_hex_limit = 32
> #
> # Logging layers: rf, phy, mac, rlc, pdcp, rrc, nas, gw, usim, all
> # Logging levels: debug, info, warning, error, none
> #
> # filename: File path to use for log output. Can be set to stdout
> # to print logs to standard output
> # file_max_size: Maximum file size (in kilobytes). When passed, multiple
> files are created.
> # If set to negative, a single log file will be created.
> #####################################################################
> [log]
> all_level = info
> phy_lib_level = none
> all_hex_limit = 32
> filename = /tmp/ue.log
> file_max_size = -1
>
> #####################################################################
> # USIM configuration
> #
> # mode: USIM mode (soft/pcsc)
> # algo: Authentication algorithm (xor/milenage)
> # op/opc: 128-bit Operator Variant Algorithm Configuration Field (hex)
> # - Specify either op or opc (only used in milenage)
> # k: 128-bit subscriber key (hex)
> # imsi: 15 digit International Mobile Subscriber Identity
> # imei: 15 digit International Mobile Station Equipment Identity
> # pin: PIN in case real SIM card is used
> # reader: Specify card reader by it's name as listed by 'pcsc_scan'. If
> empty, try all available readers.
> #####################################################################
> [usim]
> mode = pcsc
> algo = milenage
> #opc = 63BFA50EE6523365FF14C1F45F88737D
>
> #k = 00112233445566778899aabbccddeeff
> #k = F20F84F21191C68B00
>
> #imsi = 228017229298322
> imei = 353490069873319
> reader =
> pin = 7555
>
> #####################################################################
> # RRC configuration
> #
> # ue_category: Sets UE category (range 1-5). Default: 4
> # release: UE Release (8 to 10)
> # feature_group: Hex value of the featureGroupIndicators field in the
> # UECapabilityInformation message. Default 0xe6041000
> # mbms_service_id: MBMS service id for autostarting MBMS reception
> # (default -1 means disabled)
> # mbms_service_port: Port of the MBMS service
> #####################################################################
> [rrc]
> #ue_category = 4
> #release = 8
> #feature_group = 0xe6041000
> #mbms_service_id = -1
> #mbms_service_port = 4321
>
> #####################################################################
> # NAS configuration
> #
> # apn: Set Access Point Name (APN)
> # apn_protocol: Set APN protocol (IPv4, IPv6 or IPv4v6.)
> # user: Username for CHAP authentication
> # pass: Password for CHAP authentication
> # force_imsi_attach: Whether to always perform an IMSI attach
> # eia: List of integrity algorithms included in UE capabilities
> # Supported: 1 - Snow3G, 2 - AES
> # eea: List of ciphering algorithms included in UE capabilities
> # Supported: 0 - NULL, 1 - Snow3G, 2 - AES
> #####################################################################
> [nas]
> #apn = internetinternet
> #apn_protocol = ipv4
> #user = srsuser
> #pass = srspass
> #force_imsi_attach = false
> eia = 2
> eea = 2
>
> #####################################################################
> # GW configuration
> #
> # ip_devname: Name of the tun_srsue device. Default: tun_srsue
> # ip_netmask: Netmask of the tun_srsue device. Default: 255.255.255.0
> #####################################################################
> [gw]
> #ip_devname = tun_srsue
> #ip_netmask = 255.255.255.0
>
> #####################################################################
> # GUI configuration
> #
> # Simple GUI displaying PDSCH constellation and channel freq response.
> # (Requires building with srsGUI)
> # enable: Enable the graphical interface (true/false)
> #####################################################################
> [gui]
> enable = false
>
> #####################################################################
> # Channel emulator options:
> # dl.enable: Enable/Disable internal Downlink channel emulator
> #
> # -- Fading emulator
> # dl.fading.enable: Enable/disable fading simulator
> # dl.fading.model: Fading model + maximum doppler (E.g. none, epa5, eva70,
> etu300, etc)
> #
> # -- Delay Emulator delay(t) = delay_min + (delay_max - delay_min) * (1 +
> sin(2pi*t/period)) / 2
> # Maximum speed [m/s]: (delay_max - delay_min) * pi * 300 / period
> # dl.delay.enable: Enable/disable delay simulator
> # dl.delay.period: Delay period in seconds (integer).
> # dl.delay.maximum_us: Maximum delay in microseconds
> # dl.delay.minumum_us: Minimum delay in microseconds
> #
> # -- Radio-Link Failure (RLF) Emulator
> # dl.rlf.enable: Enable/disable RLF simulator
> # dl.rlf.t_on_ms: Time for On state of the channel (ms)
> # dl.rlf.t_off_ms: Time for Off state of the channel (ms)
> #####################################################################
> [channel]
> #dl.enable = false
> #dl.fading.enable = false
> #dl.fading.model = none
> #dl.delay.enable = false
> #dl.delay.period = 3600
> #dl.delay.maximum_us = 100
> #dl.delay.minimum_us = 10
> #dl.rlf.enable = false
> #dl.rlf.t_on_ms = 10000
> #dl.rlf.t_off_ms = 2000
> #ul.enable = false
> #ul.fading.enable = false
> #ul.fading.model = none
> #ul.delay.enable = false
> #ul.delay.period = 3600
> #ul.delay.maximum_us = 100
> #ul.delay.minimum_us = 10
> #ul.rlf.enable = false
> #ul.rlf.t_on_ms = 10000
> #ul.rlf.t_off_ms = 2000
>
> #####################################################################
> # PHY configuration options
> #
> # rx_gain_offset: RX Gain offset to add to rx_gain to calibrate RSRP
> readings
> # prach_gain: PRACH gain (dB). If defined, forces a gain for the
> tranmsission of PRACH only.,
> # Default is to use tx_gain in [rf] section.
> # cqi_max: Upper bound on the maximum CQI to be reported. Default 15.
> # cqi_fixed: Fixes the reported CQI to a constant value. Default disabled.
> # snr_ema_coeff: Sets the SNR exponential moving average coefficient
> (Default 0.1)
> # snr_estim_alg: Sets the noise estimation algorithm. (Default refs)
> # Options: pss: use difference between received and known pss signal,
> # refs: use difference between noise references and noiseless (after
> filtering)
> # empty: use empty subcarriers in the boarder of pss/sss signal
> # pdsch_max_its: Maximum number of turbo decoder iterations (Default 4)
> # nof_phy_threads: Selects the number of PHY threads (maximum 4, minimum
> 1, default 2)
> # equalizer_mode: Selects equalizer mode. Valid modes are: "mmse", "zf" or
> any
> # non-negative real number to indicate a regularized zf coefficient.
> # Default is MMSE.
> # sfo_ema: EMA coefficient to average sample offsets used to compute SFO
> # sfo_correct_period: Period in ms to correct sample time to adjust for SFO
> # sss_algorithm: Selects the SSS estimation algorithm. Can choose between
> # {full, partial, diff}.
> # estimator_fil_auto: The channel estimator smooths the channel estimate
> with an adaptative filter.
> # estimator_fil_stddev: Sets the channel estimator smooth gaussian filter
> standard deviation.
> # estimator_fil_order: Sets the channel estimator smooth gaussian filter
> order (even values perform better).
> # The taps are [w, 1-2w, w]
> #
> # snr_to_cqi_offset: Sets an offset in the SNR to CQI table. This is used
> to adjust the reported CQI.
> #
> # pregenerate_signals: Pregenerate uplink signals after attach. Improves
> CPU performance.
> #
> # interpolate_subframe_enabled: Interpolates in the time domain the
> channel estimates within 1 subframe. Default is to average.
> #
> # sic_pss_enabled: Applies Successive Interference Cancellation to PSS
> signals when searching for neighbour cells.
> # Must be disabled if cells have identical channel and timing, for
> instance if generated from
> # the same source.
> #
> # pdsch_csi_enabled: Stores the Channel State Information and uses it for
> weightening the softbits. It is only
> # used in TM1. It is True by default.
> #
> # pdsch_8bit_decoder: Use 8-bit for LLR representation and turbo decoder
> trellis computation (Experimental)
> # force_ul_amplitude: Forces the peak amplitude in the PUCCH, PUSCH and
> SRS (set 0.0 to 1.0, set to 0 or negative for disabling)
> #
> #####################################################################
> [phy]
> #rx_gain_offset = 62
> #prach_gain = 30
> #cqi_max = 15
> #cqi_fixed = 10
> #snr_ema_coeff = 0.1
> #snr_estim_alg = refs
> #pdsch_max_its = 8 # These are half iterations
> #nof_phy_threads = 3
> #equalizer_mode = mmse
> #sfo_ema = 0.1
> #sfo_correct_period = 10
> #sss_algorithm = full
> #estimator_fil_auto = false
> #estimator_fil_stddev = 1.0
> #estimator_fil_order = 4
> #snr_to_cqi_offset = 0.0
> #interpolate_subframe_enabled = false
> #sic_pss_enabled = true
> #pregenerate_signals = false
> #pdsch_csi_enabled = true
> #pdsch_8bit_decoder = false
> #force_ul_amplitude = 0
>
> #####################################################################
> # General configuration options
> #
> # metrics_csv_enable: Write UE metrics to CSV file.
> #
> # metrics_period_secs: Sets the period at which metrics are requested from
> the UE.
> #
> # metrics_csv_filename: File path to use for CSV metrics.
> #
> #####################################################################
> [general]
> #metrics_csv_enable = false
> #metrics_period_secs = 1
> #metrics_csv_filename = /tmp/ue_metrics.csv
>
>
So if someone has an idea of why that wouldn't work, pscs_scan worked
normally, I would appreciate some help.

Thank you everyone,
Romain Mendez.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.srsran.com/pipermail/srsran-users/attachments/20191203/646eaf5c/attachment.htm>


More information about the srsran-users mailing list