possible fixes

This commit is contained in:
John Burwell 2025-04-27 12:48:52 -05:00
parent 523c4ac958
commit 83259e6c33

View File

@ -14,6 +14,10 @@ import ax25.socket
CLIENT_CALLSIGN = "N0CALL-7" CLIENT_CALLSIGN = "N0CALL-7"
BEACON_CALLSIGN = "KI5QKX-10" # We expect the server to be beaconing from here 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 # Setup logging
os.makedirs("logs", exist_ok=True) os.makedirs("logs", exist_ok=True)
logger = logging.getLogger("craprniac_client") logger = logging.getLogger("craprniac_client")
@ -65,10 +69,12 @@ def reset_network_config():
# Main Client Logic # Main Client Logic
def main(): def main():
# Setup DGRAM socket to listen for beacons # Setup DGRAM socket to listen for beacons
beacon_sock = ax25.socket.Socket(socket.SOCK_DGRAM) try:
beacon_sock.bind(CLIENT_CALLSIGN) 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...") 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: while True:
try: try: