Hello,
This basic code is not working after the upgrade of Rasberry Pi OS yesterday.
INDIserver is working ok and I confirmed with KStar.
On KStar, I can move the AVX mount.
import PyIndi
import time
import sys
import threading
class IndiClient(PyIndi.BaseClient):
def __init__(self):
super(IndiClient, self).__init__()
# get the telescope device
device_telescope = indiclient.getDevice(telescope)
while not (device_telescope):
time.sleep(0.5)
device_telescope = indiclient.getDevice(telescope)
# wait CONNECTION property be defined for telescope
telescope_connect = device_telescope.getSwitch("CONNECTION")
while not (telescope_connect):
time.sleep(0.5)
telescope_connect = device_telescope.getSwitch("CONNECTION")
# if the telescope device is not connected, we do connect it
if not (device_telescope.isConnected()):
# Property vectors are mapped to iterable Python objects
# Hence we can access each element of the vector using Python indexing
# each element of the "CONNECTION" vector is a ISwitch
telescope_connect[0].s = PyIndi.ISS_ON # the "CONNECT" switch --> I got error here. TypeError: 'ISwitchPropertyview' object is not subscriptable
telescope_connect[1].s = PyIndi.ISS_OFF # the "DISCONNECT" switch
indiclient.sendNewSwitch(telescope_connect) # send this new value to the device
I have no idea about this error. It worked before I upgraded Rasberry Pi 4 OS.
telescope_connect variable is just empty.
I started "indiserver indi_celestron_gps" before run python code. I don't see any error while running.
Does anyone have any idea?
Thank you.
I had same issue recently when using the default PyINDI package,
i ran this command to install the latest and then everything work fine, you might want to give it a try:pip install git+https://github.com/indilib/pyindi-client.git@68803a1#egg=pyindi-client