Provides classes enabling remote instrument control.
Project description
indipydriver
If you are developing a Python project to control some form of instrument, with switches, indicators or measurement data, this package provides classes which can be used to send and receive data on a port. A terminal client can then view the instrument, enabling easy headless control.
The package creates and serves the INDI protocol which is defined so that drivers should operate with any INDI client.
INDI - Instrument Neutral Distributed Interface.
See https://en.wikipedia.org/wiki/Instrument_Neutral_Distributed_Interface
This is one of three associated packages.
Indipydriver provides an 'IPyDriver' class to work with your own code to produce the INDI protocol, and an 'IPyServer' class to serve it on a port.
Indipyterm is a terminal client, which can be run to view the instrument controls.
Optionally - if you wanted to create dedicated client programs:
Indipyclient provides classes which you can use to connect to the port, to create your own client, or to script control of your instrument.
Indipyterm 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.
These packages are available on Pypi, and should interwork with other services that follow the INDI specification.
The image below shows the indipyterm 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/concept.html#first-example
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.
Indipydriver provides classes of 'members', 'vectors' and 'devices', where members hold instrument values, such as switch and number values. Vectors group members together, with labels and group strings, which inform the client how to display the values. 'Devices' hold a number of vectors, so a single device can display several groups of controls.
The 'IPyDriver' class holds one or more devices, and provides methods you can use to send and receive data, which you would use to interface with your own code.
You would create a subclass of IPyDriver and override the following methods.
async def rxevent(self, event)
This is automatically called whenever data is received from the client 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 is called when the driver starts, and as default does nothing, typically it 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(*drivers, 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.
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
indipyterm available from https://pypi.org/project/indipyterm
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file indipydriver-2.3.4.tar.gz
.
File metadata
- Download URL: indipydriver-2.3.4.tar.gz
- Upload date:
- Size: 38.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
b037918312e23b6150ba7076f6cee5b6ecaa8703e82635a6ce73f0a6e0f7e63d
|
|
MD5 |
79d0044463903b3b8c90069847d81386
|
|
BLAKE2b-256 |
c9f05c8779277a288890cfd402ad8e5d0fd8c40688912a1a9aaceb16bc5de662
|
File details
Details for the file indipydriver-2.3.4-py3-none-any.whl
.
File metadata
- Download URL: indipydriver-2.3.4-py3-none-any.whl
- Upload date:
- Size: 41.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
7c33f3e42a6411b52eca562f2fe41de777c895645c28800efaa5d27d325b2c94
|
|
MD5 |
1e5ed2ea1121130d9a49475d0e8c7bb2
|
|
BLAKE2b-256 |
fdb8b83cbbaf3b41a557b9b80f37af7b02d7dc4c0017150b9d5d4761aa221ad0
|