2026-03-04 16:31:57 +11:00
|
|
|
from sx1262 import SX1262
|
|
|
|
|
from _sx126x import *
|
|
|
|
|
import time
|
2026-05-15 10:24:49 +10:00
|
|
|
import crypt_random
|
2026-03-04 16:31:57 +11:00
|
|
|
|
2026-03-07 08:43:54 +11:00
|
|
|
from lora_handler import LoRaHandler
|
2026-03-07 08:40:56 +11:00
|
|
|
|
2026-05-15 10:24:49 +10:00
|
|
|
LORA_ENABLED = True
|
|
|
|
|
BLUETOOTH_ENABLED = False
|
2026-03-07 08:40:56 +11:00
|
|
|
|
2026-03-04 16:31:57 +11:00
|
|
|
|
2026-03-07 08:43:54 +11:00
|
|
|
def main():
|
2026-05-15 10:24:49 +10:00
|
|
|
bluetooth_handler = None
|
|
|
|
|
if BLUETOOTH_ENABLED:
|
|
|
|
|
from bluetooth_handler import BluetoothHandler
|
|
|
|
|
bluetooth_handler = BluetoothHandler()
|
2026-03-07 08:40:56 +11:00
|
|
|
|
2026-03-07 08:43:54 +11:00
|
|
|
lora_handler = None
|
2026-03-07 08:40:56 +11:00
|
|
|
if LORA_ENABLED:
|
2026-03-07 08:43:54 +11:00
|
|
|
lora_handler = LoRaHandler()
|
2026-03-07 08:40:56 +11:00
|
|
|
|
2026-05-15 10:24:49 +10:00
|
|
|
print("Ready!")
|
2026-03-07 09:15:45 +11:00
|
|
|
while True:
|
2026-05-15 10:24:49 +10:00
|
|
|
lora_handler.advertise()
|
|
|
|
|
time.sleep(5)
|
2026-03-04 16:31:57 +11:00
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
main()
|