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: