Skip to main content

Provides classes enabling remote instrument control.

Project description

indipydriver

If you are developing a Python project to operate some form of instrument, with switches, indicators or measurement data, this package can be used to send and receive data on a port to control your instrument.

Indipydriver is a pure python package and has no dependencies.

The package creates and serves the INDI protocol.

INDI - Instrument Neutral Distributed Interface.

See https://en.wikipedia.org/wiki/Instrument_Neutral_Distributed_Interface

The INDI protocol is defined so that drivers should operate with any INDI client.

An associated terminal client indipyclient is available, which connects to the port, so the instrument can be viewed and controlled from a terminal session.

Indipyclient can be remote, or could work on the same machine. As it is a terminal client, it could be run from an SSH connection, conveniently allowing headless operation.

Both indipydriver and indipyclient are available on Pypi, and should interwork with other services that follow the INDI specification.

The image below shows the indipyclient terminal connected to a server running an example driver (switching on or off an LED on a RaspberryyPi). The example is described at:

https://indipydriver.readthedocs.io/en/latest/usage/summary.html

Terminal screenshot

The protocol defines the format of the data sent, such as light, number, text, switch or BLOB (Binary Large Object) and the client can send commands to control the instrument. The client takes the display format of switches, numbers etc., from the protocol.

INDI is often used with astronomical instruments, but is a general purpose protocol which can be used for any instrument control.

Typically you would create a subclass of IPyDriver.

The driver has methods which should be overwritten.

async def rxevent(self, event)

This is called whenever data is received from the client, typically to set an instrument parameter. The event object describes the received data, and you provide the code which then controls your instrument.

async def hardware(self)

This could be a contuously running coroutine which you can use to operate your instruments, and if required send updates to the client.

async def snoopevent(self, event)

This is only used if the device is monitoring (snooping) on other devices.

The indipydriver package also includes an IPyServer class. Having created an instance of your IPyDriver subclass, you would serve this, and any other drivers with an IPyServer object:

server = IPyServer(driver, host="localhost", port=7624, maxconnections=5)
await server.asyncrun()

A connected client can then control all the drivers.

IPyServer can also run third party INDI drivers created with other languages or tools, using an add_exdriver method.

Networked instruments

IPyServer also has an add_remote method which can be used to add connections to remote servers, creating a tree network of servers.

INDI Network

With such a layout, the client can control all the instruments.

Documentation at https://indipydriver.readthedocs.io

Installation from https://pypi.org/project/indipydriver

indipyclient available from https://pypi.org/project/indipyclient

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

indipydriver-1.8.7.tar.gz (54.0 kB view details)

Uploaded Source

Built Distribution

indipydriver-1.8.7-py3-none-any.whl (61.5 kB view details)

Uploaded Python 3

File details

Details for the file indipydriver-1.8.7.tar.gz.

File metadata

  • Download URL: indipydriver-1.8.7.tar.gz
  • Upload date:
  • Size: 54.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.2

File hashes

Hashes for indipydriver-1.8.7.tar.gz
Algorithm Hash digest
SHA256 ff3153c4bd1940459667fcd3190c90b7732a29f6856ad84e3539ee5c641d31ae
MD5 93d2983b86f9abb1c634d5df7c50ba6f
BLAKE2b-256 3c8182dc1d4837a9d966d35d5b31ba80be37055ac75e0939eba7057dd92f2d8a

See more details on using hashes here.

File details

Details for the file indipydriver-1.8.7-py3-none-any.whl.

File metadata

File hashes

Hashes for indipydriver-1.8.7-py3-none-any.whl
Algorithm Hash digest
SHA256 ddf0fe221e439a5e0c72707e59e55ce0e444e99f2fb99eecabd643bb83e5b86c
MD5 d34ddfed2b4cb98ee1f3b23bd15447c9
BLAKE2b-256 17ff831fb4ca8aa8446c976c163d1ad6690be3559469520fca4127cb87ab96ee

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page