Client → Server Messages

Message format

Every message is a JSON object with one top-level key identifying the command. The value is an object whose structure depends on the command.

All client command keys are UPPERCASE (e.g. DU, SV, SA, GC).


Command index

KeyDescription
DURequest full dump
XXHeartbeat / keepalive
LOLogin
ILSet language
SVSet single element value
SASet all element values
I1Click property preicon1
I2Click property preicon2
I3Click property posticon1
I4Click property posticon2
J1Click element preicon
J2Click element posticon
PLLoad profile
PSSave profile
GCCreate grid line
GUUpdate grid line
GDDelete grid line
GFFetch/select grid line
GHMove grid line up
GBMove grid line down
MLLoad module
MKKill (unload) module
YAStart embedded INDI server
YZStop embedded INDI server
YLLoad INDI driver
YRReload INDI driver
YSStop INDI driver

All messages that target a module or property use the wrapper:

{
  "COMMAND": {
    "m": {
      "ModuleName": {
        "p": {
          "propertyName": { ... }
        }
      }
    }
  }
}

where m stands for modules and p stands for properties.


Session management

DU — Request full dump

Must be sent immediately after connecting. The server replies with a d message containing all modules.

{ "DU": { "language": "en" } }
FieldDescription
languagePreferred language for translated labels ("en", "fr", etc.)

XX — Heartbeat

Send every 30 seconds to keep the connection alive. The server replies with xx.

{ "XX": {} }

LO — Login

Required when the server has access control enabled (grant-client is "-1" in the dump response).

{
  "LO": {
    "user": "username",
    "pw": "password",
    "language": "en"
  }
}

IL — Set language

Changes the language for translated labels without re-connecting.

{ "IL": { "language": "fr" } }

Property value updates

SV — Set single element value

Use when directedit is true on the element — sends only one element’s value immediately.

{
  "SV": {
    "m": {
      "Focus": {
        "p": {
          "parameters": {
            "e": {
              "iterations": 7
            }
          }
        }
      }
    }
  }
}

e contains a single elementName: value pair.


SA — Set all element values

Use to submit all editable elements of a property at once (e.g. from a form). Also used when directedit is false.

{
  "SA": {
    "m": {
      "Focus": {
        "p": {
          "parameters": {
            "e": {
              "iterations": 7,
              "exposure": 3.5,
              "active": true
            }
          }
        }
      }
    }
  }
}

Icon actions

Property icons (preicon / posticon) trigger backend actions such as saving a profile, loading a profile, or starting a process. Click events are sent using the following commands.

I1 — Click property preicon1

{
  "I1": {
    "m": {
      "Focus": {
        "p": {
          "saveprofile": {}
        }
      }
    }
  }
}

I2 — Click property preicon2

{
  "I2": {
    "m": {
      "Focus": {
        "p": {
          "loadprofile": {}
        }
      }
    }
  }
}

I3 — Click property posticon1

Same structure as I1 / I2.

I4 — Click property posticon2

Same structure as I1 / I2.


J1 — Click element preicon

{
  "J1": {
    "m": {
      "Focus": {
        "p": {
          "devices": {
            "e": {
              "myDevice": {}
            }
          }
        }
      }
    }
  }
}

J2 — Click element posticon

Same structure as J1.


Profile management

PL — Load profile

{
  "PL": {
    "m": {
      "Focus": {
        "profile": "myProfile"
      }
    }
  }
}

The server replies with an fl (profile loaded) message and then sends updated property values.


PS — Save profile

{
  "PS": {
    "m": {
      "Focus": {
        "profile": "myProfile"
      }
    }
  }
}

The server replies with an fs (profile saved) message.


Grid operations

Grid commands target a specific property within a module. All use the m / p wrapper.

GC — Create grid line

Adds a new row to the grid with the provided element values.

{
  "GC": {
    "m": {
      "Sequencer": {
        "p": {
          "sequence": {
            "e": {
              "target": "M31",
              "exposure": 120,
              "count": 10
            }
          }
        }
      }
    }
  }
}

The server replies with a gc message confirming the new row index.


GU — Update grid line

Updates a specific row (zero-based index i) with new element values.

{
  "GU": {
    "m": {
      "Sequencer": {
        "p": {
          "sequence": {
            "i": 1,
            "e": {
              "target": "M42",
              "exposure": 60
            }
          }
        }
      }
    }
  }
}

GD — Delete grid line

Removes the row at index i (zero-based).

{
  "GD": {
    "m": {
      "Sequencer": {
        "p": {
          "sequence": {
            "i": 0
          }
        }
      }
    }
  }
}

GF — Fetch/select grid line

Requests the server to load a grid row into the property’s editable elements (used when clicking a row to edit it).

{
  "GF": {
    "m": {
      "Sequencer": {
        "p": {
          "sequence": {
            "i": 2
          }
        }
      }
    }
  }
}

GH — Move grid line up

Moves the row at index i up by one position.

{
  "GH": {
    "m": {
      "Sequencer": {
        "p": {
          "sequence": {
            "i": 3
          }
        }
      }
    }
  }
}

GB — Move grid line down

Moves the row at index i down by one position.

{
  "GB": {
    "m": {
      "Sequencer": {
        "p": {
          "sequence": {
            "i": 2
          }
        }
      }
    }
  }
}

Module lifecycle

ML — Load module

Requests the server to dynamically load a module.

{
  "ML": {
    "m": {
      "ModuleName": {}
    }
  }
}

MK — Kill (unload) module

Requests the server to unload a running module.

{
  "MK": {
    "m": {
      "ModuleName": {}
    }
  }
}

Embedded INDI server control

These commands are only available when the server has an embedded INDI instance.

CommandDescription
YAStart the embedded INDI server
YZStop the embedded INDI server
YLLoad an INDI driver
YRReload an INDI driver
YSStop an INDI driver

Access control summary

Server grantAllowed commands
grant-client: "1"All commands
grant-client: "0"DU, LO, IL only
grant-client: "-1"LO only (login required)

Commands sent without sufficient grant are silently rejected by the server.