From 83259e6c33e63eb08177a2aee2ac65ae3e411250 Mon Sep 17 00:00:00 2001 From: John Burwell Date: Sun, 27 Apr 2025 12:48:52 -0500 Subject: [PATCH] possible fixes --- client_node/client.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/client_node/client.py b/client_node/client.py index 97fcf49..282a507 100644 --- a/client_node/client.py +++ b/client_node/client.py @@ -14,6 +14,10 @@ import ax25.socket CLIENT_CALLSIGN = "N0CALL-7" BEACON_CALLSIGN = "KI5QKX-10" # We expect the server to be beaconing from here +# Missing from 'socket' +ETH_P_AX25 = 2 +ETH_P_ALL = 3 + # Setup logging os.makedirs("logs", exist_ok=True) logger = logging.getLogger("craprniac_client") @@ -65,10 +69,12 @@ def reset_network_config(): # Main Client Logic def main(): # Setup DGRAM socket to listen for beacons - beacon_sock = ax25.socket.Socket(socket.SOCK_DGRAM) - beacon_sock.bind(CLIENT_CALLSIGN) - - logger.info(f"Client {CLIENT_CALLSIGN} started and waiting for beacons...") + try: + beacon_sock = socket.socket(socket.PF_PACKET, socket.SOCK_RAW, socket.htons(ETH_P_AX25)) + logger.info(f"Client {CLIENT_CALLSIGN} started and waiting for beacons...") + except: + print("Unable to open listener socket. Are you root?") + sys.exit(1) while True: try: