# 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](https://github.com/bernie-skipole/indipydriver/raw/main/docs/source/usage/images/led.png)
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(*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.
![INDI Network](https://github.com/bernie-skipole/indipydriver/raw/main/docs/source/usage/images/rem2.png)
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
Raw data
{
"_id": null,
"home_page": null,
"name": "indipydriver",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "indi, driver, astronomy, instrument, remote, control",
"author": null,
"author_email": "Bernard Czenkusz <bernie@skipole.co.uk>",
"download_url": "https://files.pythonhosted.org/packages/fe/2c/3b8931c1288fe8c146e481bca91bfe87d18fdfd6e6eb912f27010b3603c8/indipydriver-2.0.2.tar.gz",
"platform": null,
"description": "# indipydriver\n\nIf 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.\n\nIndipydriver is a pure python package and has no dependencies.\n\nThe package creates and serves the INDI protocol.\n\nINDI - Instrument Neutral Distributed Interface.\n\nSee https://en.wikipedia.org/wiki/Instrument_Neutral_Distributed_Interface\n\nThe INDI protocol is defined so that drivers should operate with any INDI client.\n\nAn associated terminal client indipyclient is available, which connects to the port, so the instrument can be viewed and controlled from a terminal session.\n\nIndipyclient 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.\n\nBoth indipydriver and indipyclient are available on Pypi, and should interwork with other services that follow the INDI specification.\n\nThe 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:\n\nhttps://indipydriver.readthedocs.io/en/latest/usage/summary.html\n\n\n![Terminal screenshot](https://github.com/bernie-skipole/indipydriver/raw/main/docs/source/usage/images/led.png)\n\n\nThe 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.\n\nINDI is often used with astronomical instruments, but is a general purpose protocol which can be used for any instrument control.\n\nTypically you would create a subclass of IPyDriver.\n\nThe driver has methods which should be overwritten.\n\n**async def rxevent(self, event)**\n\nThis 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.\n\n**async def hardware(self)**\n\nThis could be a contuously running coroutine which you can use to operate your instruments, and if required send updates to the client.\n\n**async def snoopevent(self, event)**\n\nThis is only used if the device is monitoring (snooping) on other devices.\n\nThe 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:\n\n server = IPyServer(*drivers, host=\"localhost\", port=7624, maxconnections=5)\n await server.asyncrun()\n\nA connected client can then control all the drivers.\n\nIPyServer can also run third party INDI drivers created with other languages or tools, using an add\\_exdriver method.\n\n## Networked instruments\n\nIPyServer also has an add\\_remote method which can be used to add connections to remote servers, creating a tree network of servers.\n\n![INDI Network](https://github.com/bernie-skipole/indipydriver/raw/main/docs/source/usage/images/rem2.png)\n\nWith such a layout, the client can control all the instruments.\n\nDocumentation at https://indipydriver.readthedocs.io\n\nInstallation from https://pypi.org/project/indipydriver\n\nindipyclient available from https://pypi.org/project/indipyclient\n",
"bugtrack_url": null,
"license": null,
"summary": "Provides classes enabling remote instrument control.",
"version": "2.0.2",
"project_urls": {
"Documentation": "https://indipydriver.readthedocs.io",
"Source": "https://github.com/bernie-skipole/indipydriver"
},
"split_keywords": [
"indi",
" driver",
" astronomy",
" instrument",
" remote",
" control"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "4857bead0b671058344a7dd471089a0f500b15224b005481cf2f52fa408c2bf0",
"md5": "4a8726b073e53df1fc4543eb7901d42d",
"sha256": "6d51ff1799daf93b138bae47d8f7879f178addec5dc26102230541327e93a896"
},
"downloads": -1,
"filename": "indipydriver-2.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4a8726b073e53df1fc4543eb7901d42d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 64383,
"upload_time": "2025-01-15T17:30:00",
"upload_time_iso_8601": "2025-01-15T17:30:00.522145Z",
"url": "https://files.pythonhosted.org/packages/48/57/bead0b671058344a7dd471089a0f500b15224b005481cf2f52fa408c2bf0/indipydriver-2.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "fe2c3b8931c1288fe8c146e481bca91bfe87d18fdfd6e6eb912f27010b3603c8",
"md5": "a68c5fff206070dfad5d373e7ee544fd",
"sha256": "f1b28c4bebf3260746dd05ec964cf88542c5dae4a42a422972af3b70c7ed196c"
},
"downloads": -1,
"filename": "indipydriver-2.0.2.tar.gz",
"has_sig": false,
"md5_digest": "a68c5fff206070dfad5d373e7ee544fd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 56898,
"upload_time": "2025-01-15T17:30:03",
"upload_time_iso_8601": "2025-01-15T17:30:03.307945Z",
"url": "https://files.pythonhosted.org/packages/fe/2c/3b8931c1288fe8c146e481bca91bfe87d18fdfd6e6eb912f27010b3603c8/indipydriver-2.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-15 17:30:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "bernie-skipole",
"github_project": "indipydriver",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "indipydriver"
}