OTAMan Documentation

1. Overview

OTAMan is a Progressive Web App (PWA) for building APDU commands, assembling SCP80 secured packets, browsing the SIM Toolkit (STK) menu, and simulating a real network environment against a SIM/USIM/UICC card via a PC/SC reader.

The application is a single static index.html file. All computation runs in the browser; the card is accessed through a local HTTP server (pysim-otaman-server) that wraps the pySim library.

Browser (OTAMan PWA) → HTTP :8080 → pysim-otaman-server → pySim → PC/SC → card reader → UICC/SIM

Standards referenced across the application:

  • ETSI TS 102 221 — UICC-Terminal interface (CLA 00, USIM files)
  • ETSI TS 102 222 — Administrative commands
  • ETSI TS 102 223 — Card Application Toolkit (CAT, proactive commands)
  • ETSI TS 102 225 — Secured packet structure for (U)SIM toolkit
  • ETSI TS 102 226 — Remote APDU structure for UICC based applications
  • ETSI TS 151 011 — SIM-ME interface (CLA A0)
  • 3GPP TS 131 111 — USIM Application Toolkit (USAT)
  • 3GPP TS 31.102 — USIM application characteristics
  • 3GPP TS 23.038 — GSM 7-bit alphabet and DCS
  • 3GPP TS 24.008 / 24.301 / 24.501 — NAS cause codes
  • GlobalPlatform Card Specification v2.3.1
  • GlobalPlatform GPC v2.2 Amendment B v1.1 — Remote Application Management over HTTP
  • ISO/IEC 7816-4 — commands for interchange
  • ISO/IEC 9797-1 — MAC algorithms

1.1 Interface

  • Header — the app version, an INSTALL PWA button (shown when the browser offers installation, enabling offline use), links to the project on GitHub and to this help, an EN/RU language toggle, and a dark/light theme toggle.
  • Language and theme choices are stored in localStorage and persist across reloads.
  • Top-level tabs: Remote APDU (SIM RFM, USIM RFM, Expanded Script, RAM/GP, HTTP OTA, C-APDU Parser, Response parser), SCP80 (Secured Packet, Cards, RAM), Card reader (File manager, Custom files, pySim command line, Raw APDU), Profiler, and Phone simulator.
  • The help link opens this documentation at the section matching the current view (e.g. the Profiler tab opens §5).

2. Remote APDU tab

Builds command APDUs (C-APDUs). Seven sub-tabs cover different card generations, command sets and decoding tools: SIM RFM, USIM RFM, Expanded Script, RAM/GP, HTTP OTA, C-APDU Parser, and Response parser.

2.1 SIM RFM

CLA = A0 (GSM 11.11 / TS 151 011, ISO 7816-4). Remote File Management for classic SIM cards.

Commands are assembled as a chain: press a command button (e.g. + SELECT) to append a row, fill that row’s fields, and the chain preview (above the pack button) updates automatically. Add a GET RESPONSE row to fetch data following a SELECT. Press Pack into Secured packet to wrap the whole chain into an SCP80 packet.

CommandINSDescription
SELECTA4Select EF/DF by FID, path, AID or chain
UPDATE RECORDDCUpdate a record in a record-oriented EF
UPDATE BINARYD6Update binary content at an offset
READ RECORDB2Read a record
READ BINARYB0Read binary content
ERASE BINARY0EErase binary at an offset
ACTIVATE FILE44Activate a file
DEACTIVATE FILE04Deactivate a file
VERIFY PIN20Verify PIN1 or PIN2
CHANGE PIN24Change PIN1 or PIN2
DISABLE PIN26Disable a PIN
ENABLE PIN28Enable a PIN
UNBLOCK PIN2CUnblock a PIN with PUK
GET RESPONSEC0Fetch data indicated by a preceding 61XX/9FXX status word

SELECT methods

MethodP1P2Input
By FID00002-byte FID (4 hex)
By full path from MF0800Full path hex from MF
By DF name / AID0400AID (application ID)
Chain0000Comma-separated FIDs; a C0 (or C0:NN) token inserts a GET RESPONSE hop

For record commands, the P2 mode is Absolute (04), Next (02), or Previous (03). When a Case 4 command is immediately followed by a GET RESPONSE row, the chain builder strips its trailing Le byte automatically (ETSI TS 102 226 §5.1.1). A conversion panel is embedded in the right column (IMSI, MSISDN, ICCID, SPN, PLMN, nibble swap). See §2.5.

2.2 USIM RFM

CLA = 00 (ETSI TS 102 221). Same chain builder and command set as SIM. Differences:

  • SELECT requests FCP by default (P2=04) and appends Le=00; a Silent (P2=0C) checkbox selects without requesting FCP (no Le, no response data).
  • By path offers from MF (P1=08) or from current DF (P1=09).
  • Each SELECT hop in a chain requests FCP unless marked silent.

2.3 Expanded Script

Builds the Expanded Remote Application data format per ETSI TS 102 226 §5.2.1.

Format

  • Definite (AA): AA + length + Command TLVs
  • Indefinite (AE): AE + 80 + Command TLVs + 00 00

Command TLVs

TypeTagDescription
C-APDU22Raw APDU hex
Immediate Action81Proactive command or action indicator
Error Action82Conditional error recovery with action indicator or proactive command
Script Chaining83Multi-packet script execution with First/Intermediary/Last flags

The Immediate Action builder offers an action indicator (81/82), a structured proactive command builder (REFRESH, DISPLAY TEXT, PLAY TONE with auto-generated COMPREHENSION-TLV objects), or a freeform hex input.

Error Action TLV (Tag 82)

Error recovery per TS 102 226 §5.2.1.3 — one of four forms:

  • Proactive command: COMPREHENSION-TLV set with DISPLAY TEXT or PLAY TONE (only these two are allowed in an Error Action, TS 102 226 Table 5.9)
  • No action: 82 00
  • Reference to EFRMA record: 82 01 <ref> with record number 017F
  • Custom hex: arbitrary TLV value

Script Chaining TLV (Tag 83)

Multi-packet script execution with context preservation:

  • Chaining Flags: 01 first script (delete chaining info on reset), 11 first script (keep chaining info across reset, RFM only), 02 subsequent script (more to follow), 03 subsequent script (last)
  • Script ID: Correlation identifier across packets (1-4 bytes hex, auto-increment hints provided)
  • Additional Data: Extended chaining information (optional hex)
  • Context Preservation: UICC keeps security/transaction state open across chained scripts

Response decoding (TS 102 226 §5.2.2)

Incoming Proof-of-Receipt responses are decoded by the server — expanded Remote Application response data (TS 102 226 §5.2.2) or the compact format. The Secured Packet view shows the outcome after Send to Card (see §3.1): the PoR status (TAR, counter, raw PoR), with the last command’s status word and response data filled into the Response parser pill under Remote APDU.

2.4 RAM/GP

CLA = 80 (GlobalPlatform Card Specification v2.3.1). Remote Application Management commands for card content management. Built with the same chain builder as SIM/USIM: add rows, fill fields, and the chain preview updates automatically.

CommandINSP1Description
INSTALL [for load]E602Register a load file for loading
INSTALL [for install]E60CInstall an application or SD
INSTALL [make selectable]E608Make an application selectable
INSTALL [registry update]E640Update registry entries
INSTALL [extradition]E610Extradition between SDs
LOADE880Load executable code block (P1=80 last block, block number in P2)
DELETEE400Delete application or SD (P2=00 AID only / 80 AID + related objects)
GET STATUSF280/40/20/10Get card status
GET DATACAtagRead card data objects
STORE DATAE200/40/80/C0/E0Store data (key, certificate, …)
SET STATUSF080/40/60Lifecycle state management
EXTERNAL AUTHENTICATE8200SCP host authentication
INTERNAL AUTHENTICATE8800Card challenge-response
GET RESPONSEC000Fetch data after a 61XX status (Le configurable)

Privileges (INSTALL [for install])

Three privilege bytes (GP spec Tables 11-7/8/9), encoded as a length-value field inside the INSTALL data:

BitByte 1Byte 2Byte 3
b8Security DomainTrusted PathReceipt Generation
b7DAP VerificationAuthorized Management
b6Delegated ManagementToken Verification
b5Card LockGlobal Delete
b4Card TerminateGlobal Lock
b3Card ResetGlobal Registry
b2CVM ManagementFinal Application
b1Mandated DAP Verification

MSL (Minimum Security Level) — SPI1 byte per TS 102 225

ValueMeaning
00No check
11RC/CC/DS
12RC/DS/CC
15RC/DS/CC + MAC
16RC/DS/CC + MAC + Cipher
19RC/DS/CC + MAC + Cipher + DS

Refer to GlobalPlatform v2.3.1 and ETSI TS 102 226 §8.2.1.3.2 for the full GET STATUS P1/P2, GET DATA tag, DELETE P1, STORE DATA P1, and SET STATUS tables.

2.5 Conversion (SIM/USIM sidebars)

  • IMSI → EF.IMSI — 15-digit IMSI to 9-byte format (TS 31.102 §4.2.3).
  • MSISDN → BCD — strip +, pad odd length with f, swap nibbles.
  • ICCID → hex — nibble-swap the ICCID string.
  • Provider Name → SPN — GSM 7-bit packed, UCS2 non-BMP, or UCS2 BMP (TS 31.102 §4.2.5, TS 23.038).
  • PLMN → EF_PLMNsel / PLMNwAcT — 3-byte BCD + optional access technology selector.
  • Nibble swap — swap nibble pairs of an even-length hex string.

2.6 C-APDU Parser

Pastes raw APDU hex and renders a collapsible tree. It auto-detects the container: an Expanded Script (leading AA or AE80, decoded per ETSI TS 102 226 §5.2.1) or a Compact C-APDU chain (a sequence of ISO 7816 C-APDUs). Each node shows its label, hex and a short description; parent nodes expand to reveal their sub-elements.

2.7 HTTP OTA

Builds the Remote Application Management over HTTP payloads defined in GlobalPlatform GPC v2.2 Amendment B v1.1 (§4.7). Two modes:

  • Trigger (Push SMS) — administration session triggering parameters (81 > 83 > 84/[85]/[86]/89, Table 4-3). This is the message that asks the card's Security Domain to dial out and start an HTTP session.
  • Store (SD admin params) — writes the same parameters as card (Security Domain) data via STORE DATA in TLV mode (80 E2 90 00, P1=90 = last block + BER-TLV per GP v2.2 Amendment B v1.1.3), wrapped in tag 85 (or A5) per Table 4-4.

Sections mirror the spec tables:

SectionTagContents
Connection parameters84Any COMPREHENSION-TLV needed to open the TCP connection (OPEN CHANNEL per TS 102 223): Device Identities 02, Alpha 80, Bearer 01, vendor TLVs. Row editor + presets, editable hex.
Security parameters85Table 4-6: LV PSK Identity (text), LV Key version/KID. Identifies the PSK TLS key (RFC 4279).
Retry policy86Table 4-7: retry counter (2 bytes, e.g. B000), retry waiting delay as the TS 102 223 timer TLV (25 03 HH MM SS), optional vendor-specific report-failure TLV.
HTTP POST89Tables 4-8/9/10: Host header (8A), X-Admin-From agent ID (8B), URI (8C) — text converted to octets.

Command Scripting template (checkbox) wraps the whole 81 triggering command in the definite-length Expanded Remote Application data format (AA, ETSI TS 102 226 §5.2.1) for TARs that process the expanded format (RAM-over-HTTP §4.7).

Pack into Secured packet sends the built payload to the SCP80 tab for SPI/counter filling — insert the TAR the SD listens on (typically the OTASD TAR) there.

2.8 Response parser

Decodes a raw command response: pick the command that was sent, enter the SW (e.g. 9000) and the response data hex, then press Decode. The fields are also auto-filled with the last command’s status word and response data after a successful “Send to Card” (see §3.1).

  • Command — SIM/USIM group (SELECT, STATUS, READ/UPDATE, PIN ops, CAT commands like TERMINAL PROFILE/ENVELOPE/FETCH/TERMINAL RESPONSE, MANAGE CHANNEL, …) or RAM/GP group (INSTALL, LOAD, DELETE, GET/STORE DATA, auth, SCP commands).
  • SW decode — status words resolved against generic, UICC (TS 102 221), and GlobalPlatform maps, with context auto-detected.
  • Privilege decode — GET DATA / INSTALL response payloads decode the privilege bytes into human-readable flags.
  • Response data — raw hex rendered and interpreted per command (e.g. SELECT FCP templates).

3. SCP80 tab

The SCP80 top-level tab groups the SCP80-related views. It is switched by three pills: Secured Packet, Cards, and RAM. Assembles SCP80 secured packets per ETSI TS 102 225.

3.1 Secured Packet

Builds SCP80 secured packets per ETSI TS 102 225.

Packet structure

FieldSizeDescription
CPI1Command Packet Identifier (02)
CPL1Command Packet Length
CHI1Command Header Identifier (01)
CHL1Command Header Length
SPI2Security Parameter Indicator
KIc1Key Identifier for ciphering
KID1Key Identifier for MAC
TAR3Toolkit Application Reference
CNTR5Replay counter
PCNTR1Padding counter
RC/CC/DS8Cryptographic Checksum / MAC
Secured Datavar.Padded APDU (encrypted if required)

Crypto

  • 3DES-CBC encryption (zero ICV), 8/16/24-byte keys — deprecated since Rel-18, still supported for backwards compatibility
  • AES-CBC encryption (zero ICV, zero-padded to 16), 16/24/32-byte keys (TS 102 225 §5.1.2, KIc x2)
  • Retail MAC (ISO 9797-1 MAC algorithm 3) for the DES/3DES cryptographic checksum
  • AES-CMAC (NIST SP 800-38B, truncated to 8 octets) for the AES cryptographic checksum (TS 102 225 §5.1.3.1, KID x2)
  • AES requires a replay-protected counter: SPI1 bits b5 b4 must be 10 (counter higher) or 11 (counter +1) per TS 102 225 §5.1.2/§5.1.3.1
  • Padding byte configurable (00 default, or FF)

A “Verify vs pySim” button cross-checks the assembled packet against pySim’s reference OtaDialectSms.encode_cmd. A “Send to Card” button delivers it via SMS-PP-DOWNLOAD ENVELOPE (when connected to the server). The returned Proof of Receipt is decoded and shown as a PoR status line (status, TAR, counter, raw PoR); the last command’s status word and response data are filled into the Response parser tab, and a successful PoR advances the replay counter and clears the packet.

3.2 Cards

Stores card presets locally in the browser (localStorage) so the Secured Packet view can auto-fill keys and parameters.

FieldDescription
NameHuman-readable label
ICCIDOptional card identifier
KIc / KIDKey and algorithm indicators (e.g. 15 = index 1, 3DES-CBC2; x2 = AES)
SPI1 / SPI2Security Parameter Indicators
TARToolkit Application Reference
CounterReplay counter (5 bytes)
KIc key / KID key16/24/32 hex chars (8/16/24-byte 3DES) or 32/48/64 hex chars (16/24/32-byte AES) keys

Presets can be shared with Export as JSON and Export to file, and restored with Import from file, Paste & import, or Import JSON from clipboard. The selected card preset auto-fills the Secured Packet form.

3.3 RAM

Delivers Remote Application Management operations as SCP80 secured packets via SMS-PP-DOWNLOAD ENVELOPE. The card must support SCP03 (AES or 3DES). A saved card preset from the Cards sub-tab provides the SPI, keys, TAR, and counter.

Operations

OperationDescription
Explore Card (all GP data)Queries GET STATUS for ISD, Applications, ELFs, and ELF Modules, plus GET DATA FF21 for memory info. Results appear in an explorer view with per-item Delete buttons.
Install Package (.cap file)Sends a .cap file to the card via the server: INSTALL[for load] → LOAD ×N → INSTALL[for install (+make selectable)].

Explorer View

After “Explore Card” runs, the explorer displays:

  • ISD — AID, lifecycle, privileges (no delete; the ISD cannot be removed)
  • Applications — AID, lifecycle, privileges, associated ELF/SD. Each has a Delete button (GP DELETE by AID).
  • Executable Load Files — AID, lifecycle, version, module AIDs. Each has Delete (ELF only) and Delete All (cascade: ELF + modules + installed Applications, P2=0x80) buttons.

Delete confirms via a browser prompt before sending the GP DELETE command via SCP80. The explorer auto-refreshes after a successful deletion.

4. Card reader (pySim) tab

Connects to a local pysim-otaman-server for live card operations: enter the server URL (default http://127.0.0.1:8080) and press Connect. The status area shows the reader/card state, and Equip card (re)initializes the card after insertion. Sub-tabs: File manager, Custom files, pySim command line, and Raw APDU. The Profiler and Phone simulator are separate top-level tabs.

4.1 File manager

The file system tree is displayed on the left; selecting a file opens its detail pane on the right.

  • Read — reads the selected file (auto-detects transparent vs record files)
  • Edit — modify hex data, Save to write back (or Cancel)
  • Raw / Decoded — toggle between hex dump and pySim-decoded JSON

4.2 Custom files

Add files that pySim’s model does not cover: enter the full path (e.g. 3F00/7F20/6F46) and an alias (e.g. EF.SPN), then press Add; added files appear in the File manager tree. The list persists in localStorage and can be shared with Export as JSON / Export to file and restored with Import from file / Paste & import / Import JSON from clipboard.

4.3 pySim command line

Execute any pySim-shell command with usage hints (300 ms) and autocomplete.

4.4 Raw APDU

Send an arbitrary APDU and view the raw response.

4.5 Usage scenarios

Scenario A — Working with files not in pySim’s model (Custom files)

  1. Obtain the FID of the target file (vendor documentation or ATR/file-system analysis; such files are often not in public specs).
  2. Open the Card reader tab → Custom files sub-tab.
  3. Enter the full path (e.g. 3F00/7F20/6F46) and an alias (e.g. EF.SPN).
  4. Click Add — the file appears in the tree in italics (unverified).
  5. Click the file to verify existence; on success (9000) it behaves like a normal file.
  6. Read, edit and save hex data; toggle Raw/Decoded views.
  7. Export the custom-file list as JSON to share with other machines.

Scenario B — Simulating a real network environment for SIM testing

B.1 Answer PROVIDE LOCAL INFORMATION (PLI)

  1. Open Phone simulatorPROVIDE LOCAL INFORMATION response data.
  2. Use the decode/encode forms to set IMEI (01), Location Info (00), Access Technology (06), etc.
  3. Click Save — values persist server-side.
  4. Enable Polling (interval 30 s) so the card issues PLI periodically.
  5. The server injects the dictionary values into each TERMINAL RESPONSE.
  6. Verify in the proactive log: the PLI entry shows the decoded response.

B.2 Simulate network actions via ENVELOPE (event download)

  1. Check the subscribed events list (from SET UP EVENT LIST).
  2. Click Send on an event (e.g. Location Status) and fill the form; an ENVELOPE(Event Download) is sent.
  3. For Network Rejection, select registration type → location fields → access technology → rejection cause.
  4. The card may respond with a proactive command, which the chain handler logs and answers automatically.

B.3 Verify the simulated environment

  • The proactive command log shows the full round-trip (command + TERMINAL RESPONSE bytes).
  • The STATUS button / auto-polling keep the CAT session alive (drain loop).

5. Profiler

Verifies that a card matches a named profile — an ordered set of rules describing the expected file system and (optionally) file contents. Profiles are stored in localStorage.

Profile list

  • New profile — creates an empty ruleset after prompting for a name.
  • Profile from card — scans the equipped card and generates one rule per existing file (see below), then opens the editor.
  • Import profile — loads a ruleset from a JSON file (the name is stored inside the JSON).
  • Each profile row shows its name and creation time, with Check card ▶, Check card snapshot, Edit, Export (download JSON), and Delete actions.

Filesystem rules

Rules run sequentially. The editor shows the symbolic pySim name (when known) next to each rule’s path; use Add rule to append one and Save to keep the changes. A filesystem rule is defined by:

  • Path — starts with MF (e.g. MF/7F10/6F3A) or an ADF AID (e.g. A0000000871002/6F07).
  • FCP/FCI check — how much of the file control information to verify: Filetype only (FCP) (existence + file type), Filetype + size (FCP) (adds file size, or record length/count for record files), or Exact FCI (adds a byte-for-byte comparison of the raw SELECT response — the FCP template '62' — catching FID/AID, life-cycle status, security-attribute and proprietary-parameter changes).
  • File attributes — file type, size, record length and record count, taken from the FCP template (any may be left unset).
  • Check contents (optional) — Exact hex equality, or Mask where ? is a per-nibble wildcard (a mask with no ? is a prefix match, e.g. 0891 for the IMSI MCC/MNC). Record files store a per-record list.

Check card runs every rule against the equipped card and shows a live progress line plus a pass/fail report. Each row states exactly what was verified next to the file path (e.g. filetype and size, contents or exact FCI); when some checks pass and others fail, each aspect is marked (filetype ✓, size ✗, contents ✓) with the mismatches detailed below. Mismatched raw data (FCI, contents, record data) is shown as read-only monospace fields — expected above actual, aligned in the same column — for easy comparison; FCI mismatches additionally show a decoded per-parameter comparison (file size, file descriptor/structure, life cycle, FID, SFI, proprietary parameters…). A decoded FCI preview is also shown beside the FCI hex field while editing a rule. If the FCI data is corrupt, whatever was decoded before the faulty part is shown together with an explicit decode-failure note. For record files with a contents mismatch, a matching records: 1-5, 7-10 note lists the records that did match. An Only mismatches option in the results header hides all passing files and keeps only failures and errors.

“Profile from card” scan options

The scan dialog asks for a profile name and offers a “FCP/FCI check” selector (the same three modes above, default Filetype + size) applied to every generated rule, plus an “Ignore contents of files” checklist (all checked by default except EF.ARR; the header checkbox checks or unchecks the whole list) of frequently-overwritten files whose contents are skipped: EF.LOCI, EF.PSLOCI, EF.EPSLOCI, EF.5GS3GPPLOCI, EF.Keys, EF.KeysPS, EF.SMS, EF.Kc, EF.KcGPRS, EF.LOCIGPRS, EF.CBMID, EF.SMSS, EF.ACC, EF.EPSNSC, EF.START-HFN, EF.ARR. Two further checked-by-default options “Match first 4 bytes for” EF.IMSI and EF.ICCID capture those files’ contents as a mask of only the first 4 bytes (uncheck for exact matching). A progress line shows N / total files with the current file path while scanning; during the scan the options are hidden and the buttons are locked. Rules are created only for files that actually exist on the card (a FCP template is returned); missing files are skipped. Custom files from the Custom files sub-tab are included under the same existence check.

Card snapshots

The list view has two tabs — Profiles and Card snapshots. A card snapshot is an immutable capture of the card filesystem: for every existing file it stores the path, symbolic name, file type, size (or record length/count), the raw FCI from the SELECT response, and the contents whenever the file is readable (no ignore list, no masking). The ICCID is decoded from EF.ICCID and shown next to the snapshot name.

  • New snapshot — asks for a name and scans the card, then returns to the list.
  • Import snapshot — loads a snapshot from a JSON file.
  • Each snapshot row has Open, Export, and Delete. Open shows all captured data read-only (raw FCI with the decoded FCI, contents); only the snapshot name is editable.
  • Check card snapshot on a profile row runs the profile rules against a snapshot you pick from the list, without a card reader. The report is the same as a live check; files whose contents were not captured during the scan are reported as unverifiable errors.
  • Compare snapshots compares two snapshots offline, exactly like a profile check: pick the master snapshot and the snapshot to check, optionally masking the first 4 bytes of EF.IMSI/EF.ICCID (on by default), and get the same pass/fail report. Files present only in the checked snapshot are reported as extra files. Back to list returns to the Card snapshots tab.

6. Phone simulator

Interacts with the Card Application Toolkit session: the STK menu, subscribed events, the proactive command log, the PROVIDE LOCAL INFORMATION data dictionary, and STATUS polling.

STK menu

When the card has issued a SET UP MENU command, a “STK menu” block appears at the top of this view with an emerald STK: <title> button that opens the menu overlay (same as the card’s STK menu browser). If the card has not set up a menu, the block shows “No menu set by the card” instead. The menu state is refreshed each time the view is opened. User-interactive proactive commands always get a TERMINAL RESPONSE: the overlay pauses for your choice, and if you neither answer nor press Timeout, the server answers with a timeout result after the --menu-timeout seconds (default 60, 0 disables).

6.2 Subscribed events (SET UP EVENT LIST)

The events the card monitors. Each event has a Send button that opens a form specific to the event type:

  • No-data events (User Activity, Idle Screen, Data Available, …) — one-click notification
  • Location Status — dropdown: Normal / Limited / No service (tag 9B)
  • Access Technology Change — 13 RAT types (tag BF)
  • Network Rejection — full adaptive form: registration type (LU / GPRS / EPS / 5GS), location fields (MCC, MNC, LAC, RAC, TAC), access technology, and a 53-cause unified rejection cause dropdown covering EMM, GMM, 5GMM and LU causes

Sending an event uses ENVELOPE(Event Download) per TS 102 223 / TS 131 111.

6.3 Proactive command log

Chronological list of fetched proactive commands. Each row shows the elapsed time, type code, name, and a decoded qualifier (for commands that have one). Commands with response data show a Response: line with the TERMINAL RESPONSE bytes (boilerplate TLVs stripped); PROVIDE LOCAL INFORMATION responses are decoded using the PLI data dictionary decoders.

6.4 PROVIDE LOCAL INFORMATION data dictionary

Editable hex values for all 22 PLI qualifiers (TS 102 223 §8.6 + TS 131 111). Ten qualifiers have inline decode/encode forms:

  • 00 Location Info (MCC, MNC, LAC/TAC, Cell ID)
  • 01 IMEI · 03 Date/Time/TZ · 04 Language · 05 Timing Advance
  • 06 Access Technology · 08 IMEISV · 09 Search Mode
  • 0A Battery · 0E Multiple Access Technologies

Values persist server-side until restart. When the card issues PLI, the server injects the dictionary values into the TERMINAL RESPONSE.

6.5 STATUS polling

A Send STATUS button issues a manual STATUS (F2). A Polling toggle enables background polling: after a configurable idle interval (server CLI --poll-interval, 1–255 s, default 30 s, 0 disables polling) the server sends STATUS and handles any pending proactive command. Polling stops and card state resets if the card is removed.

7. Server installation

Live card operations (Card reader tab, Phone simulator, OTA delivery) require the local pysim-otaman-server — a small HTTP server bundled with OTAMan that wraps pySim, talks to the reader over PC/SC or serial, and also serves the PWA itself (open http://127.0.0.1:8080).

7.1 Prerequisites

  • Python 3.8+ with pip
  • Git
  • Smart card reader (PC/SC or serial/FTDI). PC/SC is preferable; on Linux it requires pcsc-lite + ccid
  • Windows only — use Python 3.10–3.13 (3.13 recommended): pyscard (the PC/SC driver wrapper) ships precompiled wheels for these versions. On Python 3.9 / 3.14 pip builds pyscard from source, which requires Microsoft C++ Build Tools (“Desktop development with C++”). The SMPP bridge (smpp.twisted3) is intentionally not installed on Windows, so no C++ Build Tools are needed for Python 3.10–3.13.

7.2 Quick start — Linux / macOS

git clone https://github.com/anttro/otaman.git
cd otaman
chmod +x setup.sh start.sh
./setup.sh          # creates .venv, installs pysim + server (run once)
./start.sh          # starts the server (serves PWA + API, auto-detects reader)

7.3 Quick start — Windows

git clone https://github.com/anttro/otaman.git
cd otaman
setup.bat           # creates .venv, installs pysim + server (run once)
start.bat           # starts the server (serves PWA + API)

7.4 Helper scripts

ScriptPurpose
setup.sh / setup.batCreates .venv/, installs pySim and the server. Run once after cloning.
start.sh / start.batStarts the server from the venv (falls back to a global install).

7.5 Reader auto-detection

  • PC/SC (Linux)start.sh passes -p 0 when the pcscd daemon is running
  • PC/SC (Windows)start.bat always uses -p 0 (PC/SC is built into Windows)
  • Server fallback — started without reader arguments, the server itself probes for a PC/SC reader at startup (3 attempts, 2 s apart)
  • Serial readers — start the server manually with -d /dev/ttyUSB0 (Linux)

If no card is present, the Card reader tab shows “No card detected”. Insert the card and click Equip card to initialize it.

7.6 Manual installation

# Create and activate a venv
python3 -m venv .venv
source .venv/bin/activate   # Linux/macOS
# .venv\Scripts\activate    # Windows

# Install pysim
pip install git+https://github.com/osmocom/pysim.git

# Install pysim-otaman-server (editable, so it serves the bundled PWA)
pip install -e .

# Start the server (serves PWA + API)
pysim-otaman-server --http-port 8080

Connect a PC/SC reader with a SIM card, then open http://127.0.0.1:8080 — the PWA and API share one origin, so no CORS is involved.

If the PWA is served from a public HTTPS host (e.g. https://otaman.example.com), two things are required to reach a local card server: (1) the server must answer the preflight with Access-Control-Allow-Private-Network: true (pysim-otaman-server ≥ 1.6.1 does this automatically), and (2) the browser must be allowed to access the local network — in Chrome/Edge/Vivaldi: Site settings → Local network access → allow the site (or accept the permission prompt). Without the browser permission, the request to 127.0.0.1 is blocked before any preflight is sent.

8. Version compatibility

PWA (OTAMan)ServerStatus
1.x.x1.x.x✅ Compatible
1.x.x0.x.x❌ Outdated — update server
1.x.x2.x.x+⚠️ Server newer — update PWA

The PWA checks the server version on connect via GET /api/version and warns if versions are incompatible.