IPyServer

This server class is not a general purpose INDI server such as is available at indilib.org which can run third party drivers as executable programes. Rather it is used with IPyDriver instances only. It provides the snooping ability between drivers, implements enableBLOB instructions received from the client, and allows up to ten client connections.

class IPyServer(drivers, *, host='localhost', port=7624, maxconnections=5)

An instance should be created with:

drivers is a list of IPyDriver objects this driver handles.

host and port are “localhost” and 7624 as default

maxconnections is the number of simultaneous client connections accepted, with a default of 5. The number given should be between 1 and 10 inclusive.

The awaitable asyncrun method should be run in an async loop.

async asyncrun()

Runs the server together with its drivers.

Assuming you have two importable modules containing drivers, thermostat.py and windowcontrol.py:

import asyncio

from indipydriver import IPyServer

import thermostat, windowcontrol

driver1 = thermostat.make_driver()

driver2 = windowcontrol.make_driver()

server = IPyServer([driver1, driver2])

asyncio.run(server.asyncrun())

This example would run the drivers together with the server. Using the above example, up to five clients can connect to localhost, port 7624, these being the defaults.