# Example14_AssistNowPredictiveOrbits ESP-IDF version of the Arduino example [Example14_AssistNowPredictiveOrbits.ino](../../examples/Example14_AssistNowPredictiveOrbits/Example14_AssistNowPredictiveOrbits.ino). This example uses Thingstream Zero Touch Provisioning (ZTP) and AssistNow Predictive Orbits - the replacement for AssistNow Offline - with the Iridium 9604's internal u-blox M10 GNSS. It sets the clock using NTP, obtains the chipcode (ZTP), downloads 3 days of Predictive Orbits and the almanac (HTTPS GET) into the module's file system, then sends the time (UBX-MGA-INI-TIME_UTC), the almanac and today's UBX-MGA-ANO messages to the GNSS (AT+UGUBX) and prints the Time To First Fix (UBX-NAV-STATUS). The file is kept: set `downloadFile` to `false` to use it again on a later day. 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 it downloads the data. 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. 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:Example14_AssistNowPredictiveOrbits"