possible fixes
This commit is contained in:
parent
523c4ac958
commit
83259e6c33
@ -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:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user