jaiarobotics / jaiabot

Jaiabot source code
Other
20 stars 2 forks source link

Add multiple hub support to REST API and update metadata #955

Open tsaubergine opened 3 weeks ago

tsaubergine commented 3 weeks ago

Implements https://jaia-innovation.atlassian.net/browse/JAIA-1515 and https://jaia-innovation.atlassian.net/browse/JAIA-1600.

Multi-hub support in REST API (JAIA-1600)

Using new jaia_hub_endpoints field in /etc/jaiabot/cloud.env (or -e command line parameter), the REST API will parse multiple hub endpoints and try to receive data from all of them to merge in the status and metadata messages.

Commands will be sent via all known hubs, or the list of hubs specified in targets (if set).

# example for hub1 and hub2 on fleet0
jaia_hub_endpoints=1:[fd0f:77ac:4fdf::1]:40000,2:[fd0f:77ac:4fdf::2]:40000

The REST API will fallback to use jaia_jcc_hub_ip at port 40000 if jaia_hub_endpoints is not set, allowing it to work with the current Cloud setup with a single hub without manual changes to the Cloudhub config (to add jaia_hub_endpoints).

Additions to Metadata / HubStatus message (JAIA-1515)

Added to DeviceMetadata

Added to HubStatus

tsaubergine commented 3 weeks ago

Please let me know if you'd like to review this separately or if it should be merged into #925 for one review.