> For the complete documentation index, see [llms.txt](https://docs.eseye.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eseye.com/anynet-sim/device-integration/at+crsm-reading-files-from-the-sim.md).

# AT+CRSM – reading files from the SIM

## AT+CRSM – reading files from the SIM

Read files from the AnyNet Secure SIM. For precise formats and response details, refer to the modem provider documentation.

We recommend that you use AT+CRSM over the generic SIM access AT+CSIM. AT+CRSM provides easier access to the SIM file system, as the modem facilitates the SIM interface locking and file selection routines.

{% hint style="info" %}
This command describes fields required for Eseye file extraction. Refer to 3GPP TS 27.007 for the complete definition.
{% endhint %}

### Command syntax

Use the following command:

```
AT+CRSM=<command>[,<fileid>[,<P1offset>,<P2offset>,<P3readlength>[,<data>[,"<pathid>"]]]]
```

The command includes these parameters:

* `command` is passed to the SIM. Use `176` (`READ BINARY`) to extract security and identity information.
* `fileid` is the integer file identifier on the SIM. See [Available files and sizes](/anynet-sim/device-integration/about-anynet-secure-sim-files.md#available-files-and-sizes).
* `P1offset`, `P2offset`, and `P3readlength` define the read offset and length. `AT+CRSM` returns up to 255 bytes per read.
  * `P1offset` contains the upper 8 bits of the 16-bit file offset.
  * `P2offset` contains the lower 8 bits of the 16-bit file offset. It can include the modulus (`MOD`) operator.
  * `P3readlength` is the integer read length. Limit it to 255 bytes.
* `data` is unused for `READ BINARY`. Leave it empty.
* `pathid` is the elementary file path in hexadecimal. Use `"3F007FEE"` for AnyNet Secure SIM files.

You can use `+`, `-`, `/`, and `*` arithmetic operators in the offset parameters.

### Returned result

A successful command returns:

```
+CRSM: <sw1>,<sw2>[,"<RETURNEDDATA>"]
```

A failed command returns:

```
+CME ERROR: <err>
```

The response fields are:

* `sw1` and `sw2` describe command execution. They can indicate success or file-read errors.
* `RETURNEDDATA` contains successful response data as an ASCII hexadecimal string.
* `err` is the error result when the command cannot pass to the SIM.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.eseye.com/anynet-sim/device-integration/at+crsm-reading-files-from-the-sim.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
