I would like to have a simple script that reads a note and if it says "1", for example, it parks the telescope. If it says "0", waits some time and reads it again.
It would do it while a normal session with INDI and Kstars is going on. The note would be received from another computer in the same network.
I am almost new to scripts in Linux so any help would be appreciated.
The computer is a Raspberry Pi 3b+ and the telescope is a Meade LX200 GPs.
Thanks.
David Cejudo
Observatorio El gallinero
El Berrueco, Madrid, Spain
And if its is "1", the session goes on and if it is "0", triggers an alert, correct?
But i did not find an option to park the telescope in the weather tab in Eckos. There are options for roof closure only.
#!/usr/bin/python3
import json
import subprocess
from datetime import datetime
encoding = 'utf-8'
now=datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S%z")
res = subprocess.check_output(["/home/pi/isItClear.sh"])
clear=int(float(res.decode(encoding))>0.75)
if clear==0:
msg="Cloudy"
elif clear==1:
msg="Sky is clear"
else:
msg="Something odd is going on..."
clear=0
print(json.dumps({"timestamp_utc": now,"roof_status": {"open_ok": clear,"reasons": msg}}))
The 'isItClear.sh' script just read a file on another RPI, which has an all sky camera attached to it and determines if it is clear by counting the number of stars it catches.
Nothing have been thoroughly tested, so use at your own risk
Thanks for your answer. I tried the script adapted to my set up but could not make it work.
I wrote a pretty simple script to check if it works, it seems to work when run the module with IDLE, i get this:
But when i try with INDI the log at the INDI control panel shows:
"[ERROR] Got no output from script..."
"[WARNING]Soft error occurred during UNSAFE conditions , IGNORE