# U-blox Modules with Super SIM

## Cellular modules covered on this page <a href="#cellular-modules-covered-on-this-page" id="cellular-modules-covered-on-this-page"></a>

* [SARA-R5](#sara-r5-cat-m1-nb-iot)
* [SARA-R4](#sara-r4-cat-m1-nb-iot)
* [LARA-R2](#lara-r2-cat-12g3g)

***

## General getting started information <a href="#general-getting-started-information" id="general-getting-started-information"></a>

Please refer to the main Knowledgebase page for [modem-independent configuration tips](https://docs.korewireless.com/en-us/supersim/cellular-module-knowledgebase).

***

## SARA-R5 `Cat-M1, NB-IoT` <a href="#sara-r5-cat-m1-nb-iot" id="sara-r5-cat-m1-nb-iot"></a>

{% hint style="danger" %}
Super SIM does not support NB-IoT.
{% endhint %}

### Firmware <a href="#firmware" id="firmware"></a>

Update your R5's firmware to version 3.15 or above for use with Super SIM. You can check the installed version with `AT+GMR`. Please see [the R5's AT commands manual](#additional-resources) to learn how to update the module.

### Initialization <a href="#initialization" id="initialization"></a>

The SARA-R5 supports LTE Cat-M1 and NB-IoT in bands 1, 2, 3, 4, 5, 8, 12, 13, 18, 19, 20, 25, 26, 28, 66, 71, and 85. Super SIM is compatible with Cat-M1 but not NB-IoT. It's therefore important to ensure that your SARA-R5 is set to operate only using Cat-M1.

SARA-R5 supports the use of only a single RAT at a time, so if Cat-M1 is selected and no suitable network is available, the module will not attempt to connect using NB-IoT. Consequently, if you have set the module to use NB-IoT, it will never connect until Cat-M1 is set as the favored RAT.

By default, all current SARA-R5 variants prioritize Cat-M1, but you can set this manually by issuing the command `AT+URAT` and specifying the value 7. You should apply the value using the following command sequence:

```bash
AT+CFUN=0
AT+URAT=7
AT+CFUN=16
```

The value `16` in the last command tells the modem to reboot and persist the specified RAT value.

### Establish a data connection <a href="#establish-a-data-connection" id="establish-a-data-connection"></a>

The following commands can be used to establish a PDP context once the APN has been set as shown on the [Knowledgebase overview page](https://docs.korewireless.com/en-us/supersim/cellular-module-knowledgebase/overview):

```bash
AT+CGACT=1,1
AT+UPSD=0,0,0
AT+UPSD=0,100,1
AT+UPSDA=0,3
```

Line two must match the PDP type set in the `AT+CGDCONT` command. For example, the latter includes `"IP"` to select IPv4, so the final parameter of `AT+UPSD=0,0,0` must also indicate IPv4, i.e., `0`.

Line three maps the module's internal packet-switched data (PSD) profile, `0`, to the PDP context ID, `1`, set with the `AT+CGDCONT` command as shown on the [Knowledgebase overview page](https://docs.korewireless.com/en-us/supersim/cellular-module-knowledgebase/overview).

Line four activates PSD profile 0.

### Perform a ping <a href="#perform-a-ping" id="perform-a-ping"></a>

Issue `AT+UPING=<TARGET_IP_ADDRESS_OR_NAME>`. This will yield, for example:

```bash
AT+UPING="8.8.8.8"
OK

+UUPING: 1,32,"dns.google","8.8.8.8",109,1105
+UUPING: 2,32,"dns.google","8.8.8.8",109,271
+UUPING: 3,32,"dns.google","8.8.8.8",109,238
+UUPING: 4,32,"dns.google","8.8.8.8",109,216
```

### Perform an HTTP GET <a href="#perform-an-http-get" id="perform-an-http-get"></a>

To perform an HTTP `GET` using the built-in HTTP client:

1. Set up a data connection [as described above](#establish-a-data-connection).
2. Reset the parameters of HTTP profile 0 to the defaults: `AT+UHTTP=0`.
3. Configure the HTTP server name: `AT+UHTTP=0,1,"api.ipify.org"`.
4. Perform a `GET` request using profile 0 and store the result in the file `test.ffs`: `AT+UHTTPC=0,1,"/","test.ffs"`.
   * The modem will respond with `+UUHTTPCR: 0,1,1`.

Now you can read the file containing the response from the server by requesting the file `test.ffs` for profile 0. Do so by issuing `AT+URDFILE="test.ffs"`. This will yield:

```bash
+URDFILE: "test.ffs",178,"HTTP/1.1 200 OK
Server: Cowboy
Connection: close
Content-Type: text/plain
Vary: Origin
Date: Mon, 14 Mar 2022 11:54:03 GMT
Content-Length: 11
Via: 1.1 vegur

3.239.194.9"
OK
```

{% hint style="danger" %}
This example uses a service that returns the IP address of the requester.
{% endhint %}

### Low-power modes <a href="#low-power-modes" id="low-power-modes"></a>

The SARA-R5 supports eDRX and PSM for low-power operation. The commands to enable each of these are, respectively:

```bash
AT+CEDRXS=1
AT+CPSMS=1
```

Using these features, but especially PSM, can make the modem inaccessible to the terminal during its sleep time. It's best to experiment with these features locally. To disable all power saving, send:

```bash
AT+CEDRXS=0
AT+CPSMS=0
```

You can learn more about implementing these modes in our [low-power usage documentation](https://docs.korewireless.com/en-us/supersim/cellular-module-knowledgebase/low-power-optimization-for-cellular-modules).

### Known issues <a href="#known-issues" id="known-issues"></a>

None at this time.

### Additional resources <a href="#additional-resources" id="additional-resources"></a>

* [SARA-R5 AT Commands Manual](https://www.u-blox.com/en/docs/UBX-19047455)
* [SARA-R5 Application Development Guide](https://www.u-blox.com/en/docs/UBX-20009652)
* [SARA-R5 Internet Applications Development Guide](https://www.u-blox.com/en/docs/UBX-20032566)

***

## SARA-R4 `Cat-M1, NB-IoT` <a href="#sara-r4-cat-m1-nb-iot" id="sara-r4-cat-m1-nb-iot"></a>

{% hint style="danger" %}
Super SIM does not support NB-IoT.
{% endhint %}

### Initialization <a href="#initialization-2" id="initialization-2"></a>

You must only configure the modem's Radio Access Technology (RAT) preference for Cat-M1 when connecting via LTE. To apply this setting, issue `AT+URAT=7`.

### Disable NB-IoT <a href="#disable-nb-iot" id="disable-nb-iot"></a>

First de-register from the network, set `UMNOPROF` to `0`, and then restart the module:

```bash
AT+COPS=2
AT+UMNOPROF=0
AT+CFUN=15
```

When the module comes back, select the correct RAT:

```bash
AT+URAT=7
AT+CFUN=15
```

{% hint style="info" %}
If you are using the SARA-R410M-02B variant, you are in the US, and you are experiencing exceptionally long (50 minutes) attachment times, u-blox recommends setting `UMNOPROF` to `100` rather than `0`. MNO profile 100 is defined as "standard Europe", but u-blox says this the best generic configuration for this variant.
{% endhint %}

### Data-centric attach mode <a href="#data-centric-attach-mode" id="data-centric-attach-mode"></a>

To set the SARA-R4 to force data-centric attachment, issue `AT+CEMODE=2`.

The parameter's value is as follows:

0 = PS mode 2: EPS only, data centric 1 = CS/PS mode 1: voice centric 2 = CS/PS mode 2: data centric 3 = PS mode 1: EPS only, voice centric

This setting is non-volatile.

### Perform an HTTP GET <a href="#perform-an-http-get-2" id="perform-an-http-get-2"></a>

To perform an HTTP `GET` using the built-in HTTP client:

1. Configure the APN: `AT+CGDCONT=1,"IP","super"`.
2. Reset profile 0's parameters to the defaults: `AT+UHTTP=0`.
3. Configure the HTTP server name: `AT+UHTTP=0,1,"api.ipify.org"`.
4. Set the network port to 443: `AT+UHTTP=0,5,443`.
5. Apply TLS encryption: `AT+UHTTP=0,6,1`.
6. Perform a `GET` request and store the result in the file `test.ffs`: `AT+UHTTPC=0,1,"/","test.ffs"`.
   * The modem will respond with `+UUHTTPCR: 0,1,1`.

Now you can request the file containing the response from the server by issuing `AT+URDFILE="test.ffs"`. This will yield:

```
+URDFILE: "http_last_response_0",179,"HTTP/1.1 200 OK
Server: Cowboy
Connection: close
Content-Type: text/plain
Vary: Origin
Date: Tue, 05 Jan 2021 18:31:02 GMT
Content-Length: 12
Via: 1.1 vegur

3.86.104.174"
OK
```

{% hint style="danger" %}
This example uses a service that returns the IP address of the requester.
{% endhint %}

### Low-power modes <a href="#low-power-modes-2" id="low-power-modes-2"></a>

The SARA-R4 supports eDRX and PSM for low-power operation. The commands to enable each of these are, respectively:

```bash
AT+CEDRXS=1
AT+CPSMS=1
```

Using these features, but especially PSM, can make the modem inaccessible to the terminal during its sleep time. It's best to experiment with these features locally. To disable all power saving, send:

```bash
AT+CEDRXS=0
AT+CPSMS=0
```

You can learn more about implementing these modes in our [low-power usage documentation](https://docs.korewireless.com/en-us/supersim/cellular-module-knowledgebase/low-power-optimization-for-cellular-modules).

{% hint style="danger" %}
The use of a PIN-protected SIM card and PSM is not supported on the SARA-R410M. If the SIM has a PIN set, the module will not enter PSM.
{% endhint %}

### Known issues <a href="#known-issues-2" id="known-issues-2"></a>

None at this time.

### Additional resources <a href="#additional-resources-2" id="additional-resources-2"></a>

* [SARA-R4 Internet Applications Development Guide](https://www.u-blox.com/en/docs/UBX-20032566)

***

## LARA-R2 `Cat-1/2G/3G` <a href="#lara-r2-cat-12g3g" id="lara-r2-cat-12g3g"></a>

### Initialization <a href="#initialization-3" id="initialization-3"></a>

First, configure the APN with `AT+CGDCONT=1,"IP","super"`.

Next, bring up the initial PDP context — this is required for both the ping and HTTP `GET` examples, below:

1. Check the GPRS attachment status, which should be `1`: `AT+CGATT?`.
2. Configure the APN for GPRS profile 0: `AT+UPSD=0,1,"super"`.
3. Optionally, save the GPRS config to non-volatile memory (NVM): `AT+UPSDA=0,1`.
4. Activate the GPRS connection: `AT+UPSDA=0,3`.
   * The modem will respond with: `+UUPSDA: 0,"100.64.80.24"`.
5. Ensure the GPRS connection is up: `AT+UPSND=0,8`.
   * The modem will respond with: `+UPSND: 0,8,1`. The final parameter of the response will be `1` if the GPRS connection is up.
6. Optionally, request the currently assigned IP address: `AT+UPSND=0,0`.
   * This will generate a response like: `+UPSND: 0,0,"100.64.80.24"`.

### Perform a ping <a href="#perform-a-ping-2" id="perform-a-ping-2"></a>

Issue `AT+UPING="8.8.8.8"`. This will yield:

```bash
+UUPING: 1,32,"dns.google","8.8.8.8",111,95
+UUPING: 2,32,"dns.google","8.8.8.8",111,101
+UUPING: 3,32,"dns.google","8.8.8.8",111,88
+UUPING: 4,32,"dns.google","8.8.8.8",111,95
```

### Perform an HTTP GET <a href="#perform-an-http-get-3" id="perform-an-http-get-3"></a>

To perform an HTTP `GET` using the built-in HTTP client:

1. Reset profile 0's parameters to the defaults: `AT+UHTTP=0`.
2. Configure the HTTP server name: `AT+UHTTP=0,1,"api.ipify.org"`.
3. Set the network port to 443: `AT+UHTTP=0,5,443`.
4. Apply TLS encryption: `AT+UHTTP=0,6,1`.
5. Perform a `GET` request and store the result in the default filename for profile 0: `AT+UHTTPC=0,1,"/",""`.
   * The modem will respond with `+UUHTTPCR: 0,1,1`. The modem will respond with: `+UUHTTPCR: 0,1,1` — the final parameter of this response indicates success (`1`) or failure (`0`).

Now you can read the file containing the response from the server by requesting the file with the default name for profile 0, `"http_last_response_0"`. Do so by issuing `AT+URDFILE="http_last_response_0"`. This will yield:

```bash
+URDFILE: "http_last_response_0",180,"HTTP/1.1 200 OK
Server: Cowboy
Connection: close
Content-Type: text/plain
Vary: Origin
Date: Tue, 05 Jan 2021 20:54:44 GMT
Content-Length: 13
Via: 1.1 vegur

54.81.145.161"
OK
```

{% hint style="danger" %}
This step uses a service that returns the IP address of the requester.
{% endhint %}

### Known issues <a href="#known-issues-3" id="known-issues-3"></a>

None at this time.

### Additional resources <a href="#additional-resources-3" id="additional-resources-3"></a>

* [u-blox Cellular Modules AT Commands Manual (for Lara-R2xx)](https://www.u-blox.com/en/ubx-viewer/view/u-blox-CEL_ATCommands_UBX-13002752?url=https%3A%2F%2Fwww.u-blox.com%2Fsites%2Fdefault%2Ffiles%2Fu-blox-CEL_ATCommands_UBX-13002752.pdf)

<br>
