ISS position live

The project Qenex_IssLiveTracking.qproj is in the Examples folder next to QInsight.exe. It uses the pair of example plugins whose source code is explained in Example ISS: the ISS Position (example) driver and the ISS JSON Protocol (example) protocol. The "device" is a public REST API with the current position of the International Space Station, so all it needs is an internet connection.

What the example shows

  • A custom driver and protocol in action: the smallest real driver (one HTTP GET per second) and a protocol that fills four variables from one JSON document by the path key.
  • Connection recovery of a custom driver through ReconnectPolicy: an internet outage puts the driver into Faulted and it returns to Running by itself once the connection is back.
  • The station's latitude, longitude, altitude and velocity on a graph, a gauge, signal controls and a watch table.

What you need

Just QInsight and the internet. The plugins are part of the installation (the Drivers and Protocols folders next to QInsight.exe). The api.wheretheiss.at API is free and needs no key; the driver respects its limit of one request per second.

The project

Driver and protocol

ISS Position (example) driverMeaning
periodMs=1000polling period; the driver does not allow less than 1000 ms

The project does not set reconnectDelayMs and reconnectAttempts, so the driver template defaults apply: retry after 5 s, forever. The protocol has no settings.

Variables

Four double variables, each with its own presentation and a path key that names the JSON field the value comes from:

VariablepathPresentation
Latitudelatitude−90 to 90 °
Longitudelongitude−180 to 180 °
Altitudealtitude380 to 460 km
Velocityvelocity27,400 to 27,700 km/h

No event is needed: the driver period sets the rate and the protocol decodes every received response.

Scripts

script.py in Periodic mode only prints a line into Script-Logs; it is a placeholder for your own processing of the values.

Workspace

A graph of all four quantities, a gauge, four signal controls and a watch table.

What you will see and what to try

  • After Start the first values appear within a second: the latitude swings like a sine with a period of about 92 minutes (one orbit), the longitude drifts west every orbit, the altitude stays around 420 km and the velocity around 27,600 km/h.
  • Disconnect the internet: the driver reports the failed request, goes Faulted and retries every 5 s. Once the connection is back it returns to Running without any action.
  • Set reconnectAttempts=2 in the driver settings: after two failed attempts the driver stops with the reason in its state; the Start button in its Properties brings it back once the network is up.
  • Type an unknown key such as x=1 into the driver settings: the log shows a warning listing the known keys.