diff --git a/CRAPRNIAC Protocol.md b/CRAPRNIAC Protocol.md index 212395c..5af20d5 100644 --- a/CRAPRNIAC Protocol.md +++ b/CRAPRNIAC Protocol.md @@ -102,7 +102,7 @@ That's what the 'S' in CRAPRNIAC stands for. ## 8. Other Considerations -- CRAPRNIAC does not prescribe a particular lower-layer protocol, though it is designed with a working AX.25 stack in mind, whether that's a classic serial TNC, a more modern bluetooth doodad, or Direwolf with kissattach creating an ax0 interface. The example implementation uses UDP packets over IP over AX.25. +- CRAPRNIAC does not prescribe a particular lower-layer protocol, though it is designed with a working AX.25 stack in mind, whether that's a classic serial TNC, a more modern bluetooth doodad, or Direwolf with kissattach creating an ax0 interface. The example implementation used UDP packets over IP over AX.25 until the author realized it needed IP to be up already before it could work. Now it does everything in AX.25 directly. - CRAPRNIAC will squat on an amateur frequency of the operator's choice. ## 9. Conclusion diff --git a/base_station/server.py b/base_station/server.py index f73a1d2..15b519e 100644 --- a/base_station/server.py +++ b/base_station/server.py @@ -1,11 +1,14 @@ import socket import time import threading +import ax25 +import ax25.socket BASE_CALLSIGN = "KI5QKX-10" NETWORK_NAME = "HAMNET-HOUSTON" BEACON_INTERVAL = 10 # seconds +BEACON_CALLSIGN = "CRAPR-0" # Fake IP pool IP_POOL = [ @@ -69,13 +72,13 @@ def handle_request(data, addr, sock): def beacon_loop(sock): while True: beacon = build_beacon().encode('utf-8') - # Beacon to *broadcast* — here we'll just send to our own callsign for now - sock.sendto(beacon, ('CRAPR-0',)) + sock.sendto(beacon, (BEACON_CALLSIGN,)) print(f"Sent beacon: {beacon.decode('utf-8')}") time.sleep(BEACON_INTERVAL) def main(): - sock = socket.socket(socket.AF_AX25, socket.SOCK_DGRAM) + # sock = socket.socket(socket.AF_AX25, socket.SOCK_DGRAM) # Old python networking way + sock = ax25.socket.Socket() sock.bind((BASE_CALLSIGN,)) # Bind to our station callsign print(f"Base Station {BASE_CALLSIGN} starting up on {NETWORK_NAME}...") diff --git a/client_node/client.py b/client_node/client.py index 6295528..e11692b 100644 --- a/client_node/client.py +++ b/client_node/client.py @@ -1,5 +1,6 @@ import socket import time +import ax25 CLIENT_CALLSIGN = "N0CALL-7" diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..543d5ba --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +pyham_ax25==1.0.2