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
localStorageand persist across reloads. - The help link opens this documentation at the section matching the current view (e.g. the Profiler sub-tab opens §5.6).
2. C-APDU tab
Builds command APDUs (C-APDUs). Six sub-tabs cover different card generations and command sets: SIM RFM, USIM RFM, Expanded Script, RAM/GP, HTTP OTA, and C-APDU 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.
| Command | INS | Description |
|---|---|---|
| SELECT | A4 | Select EF/DF by FID, path, AID or chain |
| UPDATE RECORD | DC | Update a record in a record-oriented EF |
| UPDATE BINARY | D6 | Update binary content at an offset |
| READ RECORD | B2 | Read a record |
| READ BINARY | B0 | Read binary content |
| ERASE BINARY | 0E | Erase binary at an offset |
| ACTIVATE FILE | 44 | Activate a file |
| DEACTIVATE FILE | 04 | Deactivate a file |
| VERIFY PIN | 20 | Verify PIN1 or PIN2 |
| CHANGE PIN | 24 | Change PIN1 or PIN2 |
| DISABLE PIN | 26 | Disable a PIN |
| ENABLE PIN | 28 | Enable a PIN |
| UNBLOCK PIN | 2C | Unblock a PIN with PUK |
| GET RESPONSE | C0 | Fetch data indicated by a preceding 61XX/9FXX status word |
SELECT methods
| Method | P1 | P2 | Input |
|---|---|---|---|
| By FID | 00 | 00 | 2-byte FID (4 hex) |
| By full path from MF | 08 | 00 | Full path hex from MF |
| By DF name / AID | 04 | 00 | AID (application ID) |
| Chain | 00 | 00 | Comma-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
| Type | Tag | Description |
|---|---|---|
| C-APDU | 22 | Raw APDU hex |
| Immediate Action | 81 | Proactive command or action indicator |
| Error Action | 82 | Conditional error recovery with action indicator or proactive command |
| Script Chaining | 83 | Multi-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 number01–7F - Custom hex: arbitrary TLV value
Script Chaining TLV (Tag 83)
Multi-packet script execution with context preservation:
- Chaining Flags:
01first script (delete chaining info on reset),11first script (keep chaining info across reset, RFM only),02subsequent script (more to follow),03subsequent 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 tab.
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.
| Command | INS | P1 | Description |
|---|---|---|---|
| INSTALL [for load] | E6 | 02 | Register a load file for loading |
| INSTALL [for install] | E6 | 0C | Install an application or SD |
| INSTALL [make selectable] | E6 | 08 | Make an application selectable |
| INSTALL [registry update] | E6 | 40 | Update registry entries |
| INSTALL [extradition] | E6 | 10 | Extradition between SDs |
| LOAD | E8 | 80 | Load executable code block (P1=80 last block, block number in P2) |
| DELETE | E4 | 00 | Delete application or SD (P2=00 AID only / 80 AID + related objects) |
| GET STATUS | F2 | 80/40/20/10 | Get card status |
| GET DATA | CA | tag | Read card data objects |
| STORE DATA | E2 | 00/40/80/C0/E0 | Store data (key, certificate, …) |
| SET STATUS | F0 | 80/40/60 | Lifecycle state management |
| EXTERNAL AUTHENTICATE | 82 | 00 | SCP host authentication |
| INTERNAL AUTHENTICATE | 88 | 00 | Card challenge-response |
| GET RESPONSE | C0 | 00 | Fetch 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:
| Bit | Byte 1 | Byte 2 | Byte 3 |
|---|---|---|---|
| b8 | Security Domain | Trusted Path | Receipt Generation |
| b7 | DAP Verification | Authorized Management | |
| b6 | Delegated Management | Token Verification | |
| b5 | Card Lock | Global Delete | |
| b4 | Card Terminate | Global Lock | |
| b3 | Card Reset | Global Registry | |
| b2 | CVM Management | Final Application | |
| b1 | Mandated DAP Verification |
MSL (Minimum Security Level) — SPI1 byte per TS 102 225
| Value | Meaning |
|---|---|
| 00 | No check |
| 11 | RC/CC/DS |
| 12 | RC/DS/CC |
| 15 | RC/DS/CC + MAC |
| 16 | RC/DS/CC + MAC + Cipher |
| 19 | RC/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 withf, 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 tag85(orA5) per Table 4-4.
Sections mirror the spec tables:
| Section | Tag | Contents |
|---|---|---|
| Connection parameters | 84 | Any 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 parameters | 85 | Table 4-6: LV PSK Identity (text), LV Key version/KID. Identifies the PSK TLS key (RFC 4279). |
| Retry policy | 86 | Table 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 POST | 89 | Tables 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.
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
| Field | Size | Description |
|---|---|---|
| CPI | 1 | Command Packet Identifier (02) |
| CPL | 1 | Command Packet Length |
| CHI | 1 | Command Header Identifier (01) |
| CHL | 1 | Command Header Length |
| SPI | 2 | Security Parameter Indicator |
| KIc | 1 | Key Identifier for ciphering |
| KID | 1 | Key Identifier for MAC |
| TAR | 3 | Toolkit Application Reference |
| CNTR | 5 | Replay counter |
| PCNTR | 1 | Padding counter |
| RC/CC/DS | 8 | Cryptographic Checksum / MAC |
| Secured Data | var. | 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) or11(counter +1) per TS 102 225 §5.1.2/§5.1.3.1 - Padding byte configurable (
00default, orFF)
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.
| Field | Description |
|---|---|
| Name | Human-readable label |
| ICCID | Optional card identifier |
| KIc / KID | Key and algorithm indicators (e.g. 15 = index 1, 3DES-CBC2; x2 = AES) |
| SPI1 / SPI2 | Security Parameter Indicators |
| TAR | Toolkit Application Reference |
| Counter | Replay counter (5 bytes) |
| KIc key / KID key | 16/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
| Operation | Description |
|---|---|
| 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
DELETEby 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. Response parser tab
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).
5. 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, Profiler, pySim command line, Raw APDU, and Proactive UICC.
5.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
5.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.
5.3 pySim command line
Execute any pySim-shell command with usage hints (300 ms) and autocomplete.
5.4 Raw APDU
Send an arbitrary APDU and view the raw response.
5.5 Proactive UICC
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.
5.5.1 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.
5.5.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.
5.5.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.
5.5.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.
5.5.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) the server sends STATUS and handles any pending proactive command. Polling stops and card state resets if the card is removed.
5.6 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 ▶, 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.0891for 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.
“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.
5.7 Usage scenarios
Scenario A — Working with files not in pySim’s model (Custom files)
- Obtain the FID of the target file (vendor documentation or ATR/file-system analysis; such files are often not in public specs).
- Open the Card reader tab → Custom files sub-tab.
- Enter the full path (e.g.
3F00/7F20/6F46) and an alias (e.g.EF.SPN). - Click Add — the file appears in the tree in italics (unverified).
- Click the file to verify existence; on success (
9000) it behaves like a normal file. - Read, edit and save hex data; toggle Raw/Decoded views.
- 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)
- Open Proactive UICC → PROVIDE LOCAL INFORMATION response data.
- Use the decode/encode forms to set IMEI (
01), Location Info (00), Access Technology (06), etc. - Click Save — values persist server-side.
- Enable Polling (interval 30 s) so the card issues PLI periodically.
- The server injects the dictionary values into each TERMINAL RESPONSE.
- Verify in the proactive log: the PLI entry shows the decoded response.
B.2 Simulate network actions via ENVELOPE (event download)
- Check the subscribed events list (from SET UP EVENT LIST).
- Click Send on an event (e.g. Location Status) and fill the form; an
ENVELOPE(Event Download)is sent. - For Network Rejection, select registration type → location fields → access technology → rejection cause.
- 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).
6. Server installation
Live card operations (Card reader tab, Proactive UICC, 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).
6.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 buildspyscardfrom 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.
6.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)
6.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)
6.4 Helper scripts
| Script | Purpose |
|---|---|
| setup.sh / setup.bat | Creates .venv/, installs pySim and the server. Run once after cloning. |
| start.sh / start.bat | Starts the server from the venv (falls back to a global install). |
6.5 Reader auto-detection
- PC/SC (Linux) —
start.shpasses-p 0when thepcscddaemon is running - PC/SC (Windows) —
start.batalways 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.
6.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.
7. Version compatibility
| PWA (OTAMan) | Server | Status |
|---|---|---|
| 1.x.x | 1.x.x | ✅ Compatible |
| 1.x.x | 0.x.x | ❌ Outdated — update server |
| 1.x.x | 2.x.x+ | ⚠️ Server newer — update PWA |
The PWA checks the server version on connect via GET /api/version and warns if versions are incompatible.