×
INDI Library v1.8.6 Released (21 Aug 2020)

August 2020 release of INDI Library v1.8.6 introduces new drivers while providing fixes and improvements to existing devices and core framework.

Script to park the telescope

9 months 1 week ago
Kaban
Fresh Boarder
Fresh Boarder
Posts: 9
More
Topic Author
Script to park the telescope #47064
Hello.

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

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

9 months 1 week ago
universalmaster
Gold Boarder
Gold Boarder
Posts: 200
More
Script to park the telescope #47067
I don't know why you want to do this, but I do something similar for weather safety using this

indilib.org/devices/weather/weather-safety-proxy.html

and a simple script that reads a flag from another RPI using ssh.

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

9 months 1 week ago
Kaban
Fresh Boarder
Fresh Boarder
Posts: 9
More
Topic Author
Script to park the telescope #47093
Hello.
So if i understand it correctly, the Weather Safety Proxy reads, through a script, a note like this:

{
"timestamp_utc": "2019-03-24T23:26:02",
"roof_status": {
"open_ok": 0,
}
}

Would you mind to share that script?

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.

David.

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

9 months 1 week ago
universalmaster
Gold Boarder
Gold Boarder
Posts: 200
More
Script to park the telescope #47096
My script looks like this
#!/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 ;-)

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

8 months 4 weeks ago
Kaban
Fresh Boarder
Fresh Boarder
Posts: 9
More
Topic Author
Script to park the telescope #47472
Hello.

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:

{"timestamp_utc": 2019-12-31T01:10:46 ,"roof_status": {"open_ok": 1}}

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

Any help would be appreciated.

This is my simple script:

#!/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")

print(json.dumps({
"timestamp_utc": now,
"roof_status": {
"open_ok": 1
}
}))

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

Time to create page: 0.999 seconds