diff --git a/docs/source/build_guide.rst b/docs/source/build_guide.rst index 263416f8..a9b3d65c 100644 --- a/docs/source/build_guide.rst +++ b/docs/source/build_guide.rst @@ -8,7 +8,6 @@ Introduction and Overview Welcome to the PiFinder build guide! This guide is split into three main parts, one for building the :ref:`UI Board` with Screen and Buttons, a section related to :ref:`3d printing` and preparing the case parts, and one for :ref:`final assembly`. Along with these sections, please consult the :doc:`Bill of Materials` for a full list of parts required and reach out with any questions via `email `_ or `discord `_ -If you've received a kit with an assembled UI Board + 3d Parts, you can jump right to the :ref:`final assembly`. Otherwise, fire up that 3d printer and get the :ref:`parts printing` while you work to assemble the UI Hat. PiFinder UI Hat ======================== diff --git a/python/PiFinder/pos_server.py b/python/PiFinder/pos_server.py index 8049be20..906785ae 100644 --- a/python/PiFinder/pos_server.py +++ b/python/PiFinder/pos_server.py @@ -90,6 +90,31 @@ def get_telescope_dec(shared_state, _): return dec_result +def get_distance_bars(_shared_state, _input_str): + return "\x7f" + + +def get_firmware_date(_shared_state, _input_str): + return "Jan 28 2026" + + +def get_firmware_version(_shared_state, _input_str): + return "01.0" + + +def get_product(_shared_state, _input_str): + return "PiFinder" + + +def get_firmware_time(_shared_state, _input_str): + return "17:25:00" + + +def get_status(_shared_state, _input_str): + # Indicates alt-az mode, tracking, and 1-star aligned + return "AT1" + + def respond_none(shared_state, input_str): return None @@ -182,13 +207,20 @@ def extract_command(s): lx_command_dict = { + "D": get_distance_bars, "GD": get_telescope_dec, "GR": get_telescope_ra, - "RS": respond_none, - "MS": respond_zero, - "Sd": parse_sd_command, - "Sr": parse_sr_command, - "Q": respond_none, + "GVD": get_firmware_date, + "GVN": get_firmware_version, + "GVP": get_product, + "GVT": get_firmware_time, + "GW": get_status, + "RS": respond_none, # Set slew rate to max + "MS": respond_zero, # Slew to object + "Q": respond_none, # Abort + "U": respond_none, # Precision toggle + "Sd": parse_sd_command, # Set declination + "Sr": parse_sr_command, # Set RA } @@ -216,8 +248,13 @@ def handle_client(client_socket, shared_state): command_handler = lx_command_dict.get(command, not_implemented) out_data = command_handler(shared_state, in_data) if out_data: - response = out_data if out_data in ("0", "1") else out_data + "#" + response = out_data if out_data in ("0", "1", "AT1") else out_data + "#" client_socket.send(response.encode()) + # Special case for the ACK command in the LX200 protocol sent by Stellarium + # No leading : for the ACK command but Stellarium leads all commands with # + elif in_data[0] == 0x06 or (in_data[0] == b'#' and in_data[1] == 0x06): + # A indicates alt-az mode + client_socket.send("A".encode()) except socket.timeout: logging.warning("Connection timed out.") break