Example7_CheckPDPContext

# Example7_CheckPDPContext

ESP-IDF version of the Arduino example [Example7_CheckPDPContext.ino](../../examples/Example7_CheckPDPContext/Example7_CheckPDPContext.ino).

This example checks the PDP (Packet Data Protocol) context - the cellular data connection - used by the module's internal TCP/IP stack and prints its IP address.
The Iridium 9604 does not support the SARA-R5's AT+UPSD / AT+UPSDA / AT+UPSND data profiles. The internal TCP/IP stack uses the PDP context set by AT+UDCONF=19 (factory value: cid 1 - the default EPS bearer, activated during the LTE attach). The example lists the defined contexts, reads AT+UDCONF=19, checks the context is active (AT+CGACT?) - activating it if not - and prints its IP address (AT+CGPADDR).
This example uses LTE Cat M1. It selects the LTE Cat M1 RAT (setRAT) if required.

## Hardware

* An ESP32 (or other ESP-IDF target) connected to the Iridium 9604 via a UART
* Connect: ESP32 TX to 9604 RXD; ESP32 RX to 9604 TXD; GND to GND
* Optionally connect RTS / CTS (hardware flow control) and PWR_ON

## Building

```
idf.py set-target esp32
idf.py menuconfig      # "Example Configuration": UART port, baud rate and GPIO pins
idf.py -p PORT flash monitor
```

`main/idf_component.yml` points at the library in this repository (`override_path: "../../../"`).

To create a project from this example, run:

idf.py create-project-from-example "sparkfun/sparkfun_iridium_9604_library=1.0.0:Example7_CheckPDPContext"

or download archive (~5.87 KB)