Skip to content
1 change: 0 additions & 1 deletion docs/source/build_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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<build_guide:pifinder ui hat>` with Screen and Buttons, a section related to :ref:`3d printing<build_guide:printed parts>` and preparing the case parts, and one for :ref:`final assembly<build_guide:assembly>`. Along with these sections, please consult the :doc:`Bill of Materials<BOM>` for a full list of parts required and reach out with any questions via `email <mailto:info@pifinder.io>`_ or `discord <https://discord.gg/Nk5fHcAtWD>`_

If you've received a kit with an assembled UI Board + 3d Parts, you can jump right to the :ref:`final assembly<build_guide:assembly>`. Otherwise, fire up that 3d printer and get the :ref:`parts printing<build_guide:printing>` while you work to assemble the UI Hat.

PiFinder UI Hat
========================
Expand Down
49 changes: 43 additions & 6 deletions python/PiFinder/pos_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
}


Expand Down Expand Up @@ -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
Expand Down