×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

PyINDI INumberPropertyview Indexing Change

  • Posts: 15
  • Thank you received: 1
Hi all,

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 PasteBin Link to my script. At line 71 it throws the following error.

TypeError: 'INumberPropertyview' object does not support indexing

Any help would be greatly appreciated!

 
2 years 10 months ago #71048

Please Log in or Create an account to join the conversation.

  • Posts: 15
  • Thank you received: 1
It seems this is not an issue localized to the Vantage drivers nor my code.
Copy and pasting the code from the PyINDI Tutorial 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[0].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.
2 years 10 months ago #71307

Please Log in or Create an account to join the conversation.

  • Posts: 15
  • Thank you received: 1
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 D-BUS . 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.
2 years 9 months ago #71927

Please Log in or Create an account to join the conversation.

  • Posts: 18
  • Thank you received: 3
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.
The following user(s) said Thank You: Thomas
2 years 9 months ago #72448

Please Log in or Create an account to join the conversation.

Time to create page: 0.368 seconds