You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is amazing work - I found this by doing my own and though I wonder if someone else has done this before
Where im going is to do this via the network interface instead using the following
Reason is I have the mount in an observatory connected to a network
Could your lib support the same ?
def _send_command(self, command, expected_length=None):
try:
ip = socket.gethostbyname(self.mount_address)
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((ip, self.port))
while True:
s.sendall(command.encode())
response = s.recv(1024).decode().strip()
# Check if expected_length is provided and response length matches
if expected_length is not None and len(response) != expected_length:
continue
else:
return response # Return response if length matches or if expected_length is not provided
except socket.error as e:
return f"Cannot connect to {self.mount_address}:{self.port}: {e}"
The text was updated successfully, but these errors were encountered:
This is amazing work - I found this by doing my own and though I wonder if someone else has done this before
Where im going is to do this via the network interface instead using the following
Reason is I have the mount in an observatory connected to a network
Could your lib support the same ?
The text was updated successfully, but these errors were encountered: