Example13_AssistNowLiveOrbits

# Example13_AssistNowLiveOrbits

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

This example uses Thingstream Zero Touch Provisioning (ZTP) and AssistNow Live Orbits with the Iridium 9604's internal
u-blox M10 GNSS. It polls UBX-SEC-UNIQID and UBX-MON-VER (AT+UGUBX), sends them with your ZTP token to Thingstream
(HTTPS POST) to obtain the chipcode, downloads the Live Orbits data (HTTPS GET), sends it to the GNSS (AT+UGUBX) and
prints the Time To First Fix (UBX-NAV-STATUS). Set `useAssistNow` to `false` to compare.

The legacy token-based AssistNow Online and Offline services reached End of Maintenance and End of Support on May 31st 2026.
You need a Thingstream AssistNow Device Profile: its token is your ZTP token. Keep it private.
For privacy and security, the example does not print the position, the GNSS unique ID, the token or the chipcode.
The example runs ZTP every time. The chipcode is unique to the GNSS and does not change, so it is beneficial to save it
and repeat ZTP only if the AssistNow data request fails: this saves ~6 seconds and a request. The chipcode is a credential:
save it securely, e.g. in encrypted NVS (nvs_flash with NVS encryption), not in plain text.
It does not validate the servers' certificates: for production, import the root CA certificate and enable validation.

## 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, GPIO pins and your ZTP token
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:Example13_AssistNowLiveOrbits"

or download archive (~13.50 KB)