I am using a NexStar Celestron telescope mount with Hamlib and gpredict to make a satellite tracking system. I’m using gpredict to track the coordinates, and then hamlib is sending the coordinates to the telescope mount. However, when my celestron telescope mount receives the alt-az coordinates it interprets them as RA-DEC coordinates. In other words, when gpredict tells the mount to go to 0 degrees altitude, my mount looks at 0 degree right ascension (so it looks up at the celestial equator). Does anyone know how to make the telescope mount lusten for alt-as coordinates or how I could go about converting the coordinates being sent by gpredict into RA-DEC coordinates? Thanks to everyone in advance!
Hi,
The data messages sent by GPredict (it opens a TCP socket) are very simple:
“p” for inquiring the current position
“P XXX YY” for setting the position (XXX: Azimuth YY: elevation)
“S” for stopping the movement (disengage)
Guessing that your telescope is comunicating via a serial port.
Based on that you can write a small program (in Python?) which listen a TCP socket, converts the data then send to your telescope via serial or insert an Arduino in the communication line to do the same job.
I’m actually working on something like that right now, but I can’t figure out the format that gpredict expects to hear. For example, when gpredict says “p”, I know I need to respond with the mount positions, but in what format??? Any help with that part would be hugely appreciated!
After a “set” command, GPredict waits for “RPRT 0\n” which means no error.
After a “p” inquiry, it waits for:
“XXX\n”
“YY\n”
(Azimuth then Elevation in degrees with \n new lines)
So i have my code sending coordinates to predict now, but I send it once after predict says ‘p’. And I send something like ‘090\n30\n’ and then I see it come up in my antenna controller window and then after about half a second it says error. Do I need to continuously send the coordinates, is there something I’m missing? This is my Gpredict log file if it helps, thanks!:
2023/06/01 12:29:32|3|sat_log_init: Session started
2023/06/01 12:29:32|4|sat_cfg_load: Everything OK.
2023/06/01 12:29:32|3|qth_data_read: QTH has no description.
2023/06/01 12:29:32|3|qth_data_read: QTH data: TXST-GS, 29.9000, -97.8669, 182
2023/06/01 12:29:32|3|gtk_sat_module_load_sats: Read 43 out of 43 satellites
2023/06/01 12:29:32|3|mod_mgr_add_module: Added FULLTRACK to module manager (page 0).
2023/06/01 12:29:32|3|qth_data_read: QTH has no description.
2023/06/01 12:29:32|3|qth_data_read: QTH data: TXST-GS, 29.9000, -97.8669, 182
2023/06/01 12:29:32|3|gtk_sat_module_load_sats: Read 10 out of 10 satellites
2023/06/01 12:29:32|3|mod_mgr_add_module: Added Amateur to module manager (page 1).
2023/06/01 12:29:39|3|Loaded new rotator configuration Celestron
2023/06/01 12:29:44|3|Loaded new rotator configuration TEST
2023/06/01 12:30:44|1|rotctld_socket_rw: rotctld Socket Down
2023/06/01 12:30:45|1|rotctld_socket_rw: SIZE ERROR -1 / 2
2023/06/01 12:30:45|1|rotctld_socket_rw: rotctld Socket Down
2023/06/01 12:30:45|1|rotctld_socket_rw: SIZE ERROR -1 / 15
2023/06/01 12:30:45|1|rotctld_socket_rw: rotctld Socket Down
2023/06/01 12:30:45|1|rotctld_socket_rw: SIZE ERROR -1 / 2
2023/06/01 12:30:45|1|rotctld_socket_rw: rotctld Socket Down
2023/06/01 12:30:46|1|rotctld_socket_rw: SIZE ERROR -1 / 15
2023/06/01 12:30:46|1|rotctld_socket_rw: rotctld Socket Down
2023/06/01 12:30:46|1|rotctld_socket_rw: SIZE ERROR -1 / 2
2023/06/01 12:30:46|1|rotctld_socket_rw: rotctld Socket Down
2023/06/01 12:30:47|1|rotctld_socket_rw: SIZE ERROR -1 / 15
2023/06/01 12:30:47|1|rotctld_socket_rw: rotctld Socket Down
2023/06/01 12:30:47|1|rotctld_socket_rw: SIZE ERROR -1 / 2
2023/06/01 12:30:47|1|rotctld_socket_rw: rotctld Socket Down
2023/06/01 12:30:48|1|rotctld_socket_rw: SIZE ERROR -1 / 15
2023/06/01 12:30:48|1|rotctld_socket_rw: rotctld Socket Down
2023/06/01 12:30:48|1|rotctld_socket_rw: SIZE ERROR -1 / 2
2023/06/01 12:30:48|1|rotctld_socket_rw: rotctld Socket Down
2023/06/01 12:30:49|1|rotctld_socket_rw: SIZE ERROR -1 / 15
2023/06/01 12:30:49|1|rotctld_socket_rw: rotctld Socket Down
2023/06/01 12:30:49|1|rotctld_socket_rw: SIZE ERROR -1 / 2
2023/06/01 12:30:49|1|rotctld_socket_rw: rotctld Socket Down
2023/06/01 12:30:49|1|rotctld_socket_rw: SIZE ERROR -1 / 15
2023/06/01 12:30:49|1|rotctld_socket_rw: rotctld Socket Down
2023/06/01 12:30:49|1|rotctld_socket_rw: SIZE ERROR -1 / 2
2023/06/01 12:30:49|1|rotctld_socket_rw: rotctld Socket Down
2023/06/01 12:30:50|1|rotctld_socket_rw: SIZE ERROR -1 / 2
2023/06/01 12:30:50|1|rotctld_socket_rw: rotctld Socket Down
2023/06/01 12:30:50|1|…/src/gtk-rot-ctrl.c:rotctld_socket_close: Sent 2 bytes but sent -1.
2023/06/01 12:30:50|1|rot_ctrl_timeout_cb: MAX_ERROR_COUNT (5) reached. Disengaging device!
I can’t replace hamlib, I don’t know the format that my celestron expects to hear. Hamlib takes care of that for me. I’d be down to replace hamlib if I could find out what my telescope mount expects to hear though.
It’s weird because if I set the hamlib port to 4533, and then set the rotator interface port in gpredict to 4530, they still communicate. AND my script doesn’t communicate with hamlib for some reason. I send something through port 4533 and nothin happens
Regarding the protocol, I think it’s best to implement both p and +p (extended) to be safe, one never can be certain which version is used by the programs. The extended is also pretty good so you can see that it actually did what was asked.
with telnet localhost 4533
try running rotctld in foreground, it will tell you what it receives if it doesn’t recognize the commands.
there’s no newlines between the numbers when sent in the regular format, just space separated like P 0 45\n, and in ascii.
you can also run rigctld with a dummy rotor with rotctld -m 1 -t 4533 -vvvv and skip all the hardware, just for developing.
Hi mattthestrat02,
In order to convert AZ:EL coords to Ra/dec you may use Python libraries.
I have written an application in Python to operate a radiotelescope our association restored in Paris drived by Gpredict… http://f6bvp.free.fr/tcp396.py
It needs some Python astronomy libraries called by the application and this module : http://f6bvp.free.fr/coords.py
You may contacte me for additional infos.