indipydriver


Nameindipydriver JSON
Version 2.2.0 PyPI version JSON
download
home_pageNone
SummaryProvides classes enabling remote instrument control.
upload_time2025-03-21 17:13:20
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords indi driver astronomy instrument remote control
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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


![Terminal screenshot](https://github.com/bernie-skipole/indipydriver/raw/main/docs/source/usage/images/image3.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.

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.

![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

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

            

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/08/5a/15754fb8cab3226c34bc517302c04888d4015430af04b042e0679dad464c/indipydriver-2.2.0.tar.gz",
    "platform": null,
    "description": "# indipydriver\n\nIf 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.\n\nThe package creates and serves the INDI protocol which is defined so that drivers should operate with any INDI client.\n\nINDI - Instrument Neutral Distributed Interface.\n\nSee https://en.wikipedia.org/wiki/Instrument_Neutral_Distributed_Interface\n\nThis is one of three associated packages.\n\n**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.\n\n**Indipyterm** is a terminal client, which can be run to view the instrument controls.\n\nOptionally - if you wanted to create dedicated client programs:\n\n**Indipyclient** provides classes which you can use to connect to the port, to create your own client, or to script control of your instrument.\n\nIndipyterm 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\nThese packages are available on Pypi, and should interwork with other services that follow the INDI specification.\n\nThe 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:\n\nhttps://indipydriver.readthedocs.io/en/latest/usage/concept.html#first-example\n\n\n![Terminal screenshot](https://github.com/bernie-skipole/indipydriver/raw/main/docs/source/usage/images/image3.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\nIndipydriver 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.\n\nThe '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.\n\nYou would create a subclass of IPyDriver and override the following methods.\n\n**async def rxevent(self, event)**\n\nThis 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.\n\n**async def hardware(self)**\n\nThis 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.\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\nindipyterm available from https://pypi.org/project/indipyterm\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Provides classes enabling remote instrument control.",
    "version": "2.2.0",
    "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": "8b8d68bfb1b11c8cee03ef11d4efe6af949890ee7e677501152155b1c1619381",
                "md5": "fa5d34ed990bc7227ae93407bdd9f04b",
                "sha256": "60493c9bf87b356bf295db0181ae645c2bee6ccae238ba0a805f9c92121eaeae"
            },
            "downloads": -1,
            "filename": "indipydriver-2.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fa5d34ed990bc7227ae93407bdd9f04b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 44837,
            "upload_time": "2025-03-21T17:13:18",
            "upload_time_iso_8601": "2025-03-21T17:13:18.765031Z",
            "url": "https://files.pythonhosted.org/packages/8b/8d/68bfb1b11c8cee03ef11d4efe6af949890ee7e677501152155b1c1619381/indipydriver-2.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "085a15754fb8cab3226c34bc517302c04888d4015430af04b042e0679dad464c",
                "md5": "468fb8c452d97ca5028a9c3cd916aad2",
                "sha256": "2b22fcc617b79db501370650707703b73b84396eb7a813cdadf393e1a7f0bcb1"
            },
            "downloads": -1,
            "filename": "indipydriver-2.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "468fb8c452d97ca5028a9c3cd916aad2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 40658,
            "upload_time": "2025-03-21T17:13:20",
            "upload_time_iso_8601": "2025-03-21T17:13:20.719467Z",
            "url": "https://files.pythonhosted.org/packages/08/5a/15754fb8cab3226c34bc517302c04888d4015430af04b042e0679dad464c/indipydriver-2.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-03-21 17:13:20",
    "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"
}
        
Elapsed time: 0.41882s