From 1752fa0d8544bb7b07aed6afeb359db3333d3f79 Mon Sep 17 00:00:00 2001 From: Antonis Gotsis Date: Fri, 12 May 2023 16:21:59 +0300 Subject: [PATCH] updated lora modem to disable channels during join --- insighioNode/lib/networking/modem/modem_rak4270.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/insighioNode/lib/networking/modem/modem_rak4270.py b/insighioNode/lib/networking/modem/modem_rak4270.py index 72ee396..d15ea7d 100644 --- a/insighioNode/lib/networking/modem/modem_rak4270.py +++ b/insighioNode/lib/networking/modem/modem_rak4270.py @@ -27,6 +27,7 @@ def power_off(self): logging.debug("modem powered off") def is_connected(self): + status = self.send_at_cmd('at+get_config=lora:channel') (status, lines) = self.send_at_cmd('at+get_config=lora:status') line_regex = r'Joined Network\s*:\s*(\w+)' for line in lines: @@ -58,6 +59,12 @@ def set_dr(self, dr): return status def join(self): + self.send_at_cmd('at+set_config=lora:ch_mask:8:0') + self.send_at_cmd('at+set_config=lora:ch_mask:9:0') + self.send_at_cmd('at+set_config=lora:ch_mask:10:0') + self.send_at_cmd('at+set_config=lora:ch_mask:11:0') + self.send_at_cmd('at+set_config=lora:ch_mask:12:0') + (status, lines) = self.send_at_cmd('at+join') return status