Prerequisites¶
OSHConnect-Python is a client. It talks to a running OpenSensorHub (OSH) node (or any OGC API – Connected Systems server) — it does not start or host one for you. Before using this library you need:
A running OSH node with the Connected Systems API service enabled. This is what exposes the HTTP endpoints (Parts 1, 2, and 3) that discovery and resource creation use.
For real-time streaming: the Connected Systems API – MQTT service module enabled on that node, with an MQTT broker reachable (OSH’s default broker port is
1883). Streaming over NATS instead requires the Connected Systems API – NATS service and a reachable NATS server (default port4222). Client-side, install the matching extra —oshconnect[mqtt]/oshconnect[nats](see the Optional features table in Installation).Credentials for the node, if it has security enabled (OSHConnect uses HTTP Basic Auth).
Installing, configuring, and enabling those services on an OSH node is outside the scope of this library. See the official OpenSensorHub documentation — in particular the node setup guides and the OSHConnect getting-started guide.
What you need from your OSH node¶
To point OSHConnect-Python at your node, gather the following from its
configuration and pass them to Node (see Connecting to a Node):
What to find on the node |
|
Notes |
|---|---|---|
Protocol |
|
|
Host / IP |
|
Hostname or IP serving the node, e.g. |
HTTP port |
|
The port the Connected Systems API is served on (e.g. |
Servlet root |
|
Context path; OSH default |
API root |
|
CS API path segment; default |
Username / password |
|
Only if the node enforces authentication. |
MQTT broker port |
|
The node’s MQTT broker port for real-time streaming; default |
NATS server port / token |
|
Only for NATS streaming; default port |
For example, a node whose Connected Systems API answers at
http://localhost:8585/sensorhub/api/ with an MQTT broker on 1883
maps to:
node = Node(protocol='http', address='localhost', port=8585,
server_root='sensorhub', api_root='api',
enable_mqtt=True, mqtt_port=1883)