The INDI specification and protocol is widely used in the astronomical world for controlling telescopes, however it is a general purpose protocol and can be used for any form of instrumentation. It defines the data to be divided into ‘switches’, ‘lights’, ‘numbers’, ‘text’ and ‘BLOBs’ (binary large objects), which covers a wide swathe of typical uses.
The basic idea is that a driver has to be written, interfacing to your own instrument code and organising any data you present into a standard format which includes things such as labels and numeric format strings. This is then served on a port to which a client can connect. The client could be remote, or could run locally.
The client uses the labels and names to present the data, and to send controlling information, such as switch On or Off. The client can be anything from an automating script, terminal client, distributed displays or anything which can be written which understands the protocol. In my case I was aiming at a terminal display.
As the client learns everything from the presented protocol, it can be general purpose, the same client being able to connect to any INDI service. It could also be written to control a specific instrument if required.
So the project turned into Python programs:
indipydriver
This provides classes you use to create a driver which sets, updates and reads data.
indipyserver
This provides a class to serve your driver (or multiple drivers), on a port. It also can serve drivers created by other packages that are compatible with the INDI protocol, and can connect to remote INDI services to create a tree network of devices.
indipyterm
This is the general purpose terminal client, it is simply run, connects to a port, and displays and controls the instrument parameters it learns. There is no user programming involved
indipyweb
Acts as a client but presents a web service, any web browser connecting to this web server can control connected instruments.
indipyclient
This is a Python package that most users will not run directly, it is used by indipyterm and indipyweb to decode the INDI protocol and present the received data as Python classes. This code is separated it into its own package as it could be useful if a user wants to create his own clients or scripts for automated remote control.
Installing
All packages are available on Pypi, indipydriver and indipyserver are typically installed into a project virtual environment, and your own code will import and use the provided classes.
Installing indipyterm will automatically install and use indipyclient, together with the ‘textual’ package – and its dependencies, which is a library for creating terminals.
Similarly installing indipyweb will pull in several libraries to create and serve web pages.
If you use the uv tool, indipyterm can be very simply loaded from Pypi and run with the single command:
uvx indipyterm
For full details of the indipydriver package and its classes, together with examples, follow the readthedocs link.
bernie
Jaspreet Singh
Ryan Michaud
Peter
Gibberfish