I recently did a fresh installation of Ubuntu 18.04 and installed the latest versions of all INDI/PyINDI. I noticed some of the scripts I've written using PyINDI are no longer working.
For context I'm using a Davis Vantage Pro2 and am trying to access the weather parameters.
Here is a
to my script. At line 71 it throws the following error.
TypeError: 'INumberPropertyview' object does not support indexing
It seems this is not an issue localized to the Vantage drivers nor my code.
Copy and pasting the code from the
into a Python script and running it results in the following output.
INDI::BaseClient::connectServer: creating new connection...
Traceback (most recent call last):
File "PI_Test.py", line 82, in <module>
telescope_on_coord_set.s=PyIndi.ISS_ON # TRACK
TypeError: 'ISwitchPropertyview' object does not support indexing
After dissecting the attributes of various I*type*Propertyview objects I have yet to find one that allows me to access the output of the sensors associated with any equipment.
The readings are displayed within the INDI control panel in Ekos which leads me to believe the issue lays in PyINDI. Was there a change in methodology in PyINDI or is this a bug?
I am using version 0.2.7 of the pyindi-client.
If this isn't the correct forum to be using for this issue, a nudge in the right direction would be appreciated.
For the sake of completeness and in case anyone else is experiencing this issue I will present the two workarounds I found.
Firstly, INDI comes packaged with a couple
command line options
that will allow one to see and set various parameters. The output of indi_getprop is easily parsed for automated data collection.
Additionally, INDI also supports the use of
. The linked tutorial is a tad out of date but is still applicable to Python 3. Though, I did find I did not need to initialize gobject or use dbus.glib, which is now a depreciated module.
Personally, I will be sticking to D-BUS for now as it also allows for interactions with Ekos, such as triggering auto-focus.
I opened a PR which should fix this: github.com/geehalel/pyindi-client/pull/14Support INDI::PropertyView as a replacement of concrete structs. I
think that we need to move to using the accessor methods insted of
directly touching the underlying fields. This would be a bigger
change, so it might call for a bump to version 0.3.0.I've also added an updated vega.py, from the tutorial, as a good way
to better exercise the API.