×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

DBUS python script Telescope parked?

  • Posts: 48
  • Thank you received: 6
I am trying to get a python script to work following the "DBUS Scripting with Kstars & Python" tutorial. I want to create a shutdown script to invoke
from the scheduler to shut off power to my scope after the scheduled jobs complete.

So far ...
standard connect to telescope stuff
# Wait until parked
telescopeState = "Busy"
park_wait = 0
while True:
  telescopeState = iface.getSwitch("LX200 OnStep", "TELESCOPE_PARK", "PARK")
  if (telescopeState != "On"):
    time.sleep(1)
    park_wait += 1
  else:
    break
 
print(f'Turn OFF Observatory Mains power. Waited {park_wait} secs.')
sys.stdout.flush()
GPIO.output(ACcntrlPin, GPIO.LOW)
exit(0)
 

So what happens is the scheduler sends the park command, my while/sleep loop sees the PARK go to On and promptly shuts off the telescope's power.
Apparently when I see PARK="On" that is just the Ekos going into a park STATE. I need to somehow know when the scope is actually parked. I see no
Standard Properties to inquire with to see if the scope is slewing, tracking, idle or parked.

Any help appretiated.

-Jack
3 years 1 month ago #68310

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

Time to create page: 0.344 seconds