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.