mirror of
https://github.com/liberatedsystems/openCom-Companion.git
synced 2024-11-24 06:10:36 +01:00
Add support for 2 RNode interfaces and RNode BLE
This commit is contained in:
parent
418ba564b5
commit
f5c237d363
@ -16,7 +16,7 @@ android.numeric_version = 20240522
|
||||
# relevant PRs have now been merged in Kivy/P4A, the next release will hopefully allow
|
||||
# building a non-ancient PyCa/Cryptography distribution again. When this happens, add
|
||||
# the "cryptography" dependency back in here.
|
||||
requirements = kivy==2.3.0,libbz2,pillow==10.2.0,qrcode==7.3.1,usb4a,usbserial4a,libwebp
|
||||
requirements = kivy==2.3.0,libbz2,pillow==10.2.0,qrcode==7.3.1,usb4a,usbserial4a,libwebp,android,able_recipe
|
||||
|
||||
p4a.local_recipes = ../Others/python-for-android/pythonforandroid/recipes
|
||||
|
||||
@ -28,7 +28,7 @@ android.presplash_color = #00000000
|
||||
orientation = portrait
|
||||
fullscreen = 0
|
||||
|
||||
android.permissions = INTERNET,POST_NOTIFICATIONS,WAKE_LOCK,FOREGROUND_SERVICE,CHANGE_WIFI_MULTICAST_STATE,BLUETOOTH_CONNECT,ACCESS_NETWORK_STATE,ACCESS_FINE_LOCATION,ACCESS_COARSE_LOCATION,MANAGE_EXTERNAL_STORAGE,ACCESS_BACKGROUND_LOCATION
|
||||
android.permissions = INTERNET,POST_NOTIFICATIONS,WAKE_LOCK,FOREGROUND_SERVICE,CHANGE_WIFI_MULTICAST_STATE,BLUETOOTH, BLUETOOTH_ADMIN, BLUETOOTH_SCAN, BLUETOOTH_CONNECT, BLUETOOTH_ADVERTISE,ACCESS_NETWORK_STATE,ACCESS_FINE_LOCATION,ACCESS_COARSE_LOCATION,MANAGE_EXTERNAL_STORAGE,ACCESS_BACKGROUND_LOCATION
|
||||
|
||||
android.api = 30
|
||||
android.minapi = 24
|
||||
|
495
sbapp/main.py
495
sbapp/main.py
@ -2843,39 +2843,168 @@ class SidebandApp(MDApp):
|
||||
|
||||
def hardware_rnode_save(self):
|
||||
try:
|
||||
self.sideband.config["hw_rnode_frequency"] = int(float(self.hardware_rnode_screen.ids.hardware_rnode_frequency.text)*1000000)
|
||||
self.sideband.config["hw_rnode_preset"] = self.hardware_rnode_screen.ids.hardware_rnode_preset.text
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
self.sideband.config["hw_rnode_bandwidth"] = int(float(self.hardware_rnode_screen.ids.hardware_rnode_bandwidth.text)*1000)
|
||||
self.sideband.config["hw_rnode_channel"] = self.hardware_rnode_screen.ids.hardware_rnode_channel.text
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
self.sideband.config["hw_rnode_tx_power"] = int(self.hardware_rnode_screen.ids.hardware_rnode_txpower.text)
|
||||
self.sideband.config["hw_rnode_advanced_cfg"] = bool(self.hardware_rnode_screen.ids.hardware_rnode_sec_advanced_cfg.active)
|
||||
except:
|
||||
pass
|
||||
|
||||
if self.sideband.config["hw_rnode_advanced_cfg"]:
|
||||
try:
|
||||
self.sideband.config["hw_rnode_frequency"] = int(float(self.hardware_rnode_screen.ids.hardware_rnode_frequency.text)*1000000)
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
self.sideband.config["hw_rnode_bandwidth"] = int(float(self.hardware_rnode_screen.ids.hardware_rnode_bandwidth.text)*1000)
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
self.sideband.config["hw_rnode_tx_power"] = int(self.hardware_rnode_screen.ids.hardware_rnode_txpower.text)
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
self.sideband.config["hw_rnode_spreading_factor"] = int(self.hardware_rnode_screen.ids.hardware_rnode_spreadingfactor.text)
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
self.sideband.config["hw_rnode_coding_rate"] = int(self.hardware_rnode_screen.ids.hardware_rnode_codingrate.text)
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
self.sideband.config["hw_rnode_atl_short"] = float(self.hardware_rnode_screen.ids.hardware_rnode_atl_short.text)
|
||||
except:
|
||||
self.sideband.config["hw_rnode_atl_short"] = None
|
||||
|
||||
try:
|
||||
self.sideband.config["hw_rnode_atl_long"] = float(self.hardware_rnode_screen.ids.hardware_rnode_atl_long.text)
|
||||
except:
|
||||
self.sideband.config["hw_rnode_atl_long"] = None
|
||||
else:
|
||||
try:
|
||||
if self.sideband.config["hw_rnode_preset"] in self.sideband.config["hw_rnode_presets"]:
|
||||
index = self.sideband.config["hw_rnode_presets"].index(self.sideband.config["hw_rnode_preset"])
|
||||
|
||||
self.sideband.config["hw_rnode_bandwidth"] = self.sideband.config["hw_rnode_presets_cfg"][index][0]
|
||||
self.sideband.config["hw_rnode_spreading_factor"] = self.sideband.config["hw_rnode_presets_cfg"][index][1]
|
||||
self.sideband.config["hw_rnode_coding_rate"] = self.sideband.config["hw_rnode_presets_cfg"][index][2]
|
||||
|
||||
if self.sideband.config["hw_rnode_presets_cfg"][index][3] != 100:
|
||||
self.sideband.config["hw_rnode_atl_short"] = self.sideband.config["hw_rnode_presets_cfg"][index][3]
|
||||
else:
|
||||
self.sideband.config["hw_rnode_atl_short"] = None
|
||||
|
||||
if self.sideband.config["hw_rnode_presets_cfg"][index][4] != 100:
|
||||
self.sideband.config["hw_rnode_atl_long"] = self.sideband.config["hw_rnode_presets_cfg"][index][4]
|
||||
else:
|
||||
self.sideband.config["hw_rnode_atl_long"] = None
|
||||
|
||||
except Exception as e:
|
||||
RNS.log("Error while configuring preset parameters: "+str(e), RNS.LOG_ERROR)
|
||||
|
||||
# Temporary until dropdown for frequencies added
|
||||
try:
|
||||
self.sideband.config["hw_rnode_frequency"] = int(float(self.hardware_rnode_screen.ids.hardware_rnode_frequency.text)*1000000)
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
self.sideband.config["hw_rnode_tx_power"] = int(self.hardware_rnode_screen.ids.hardware_rnode_txpower.text)
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
self.sideband.config["hw_rnode_sec_preset"] = self.hardware_rnode_screen.ids.hardware_rnode_sec_preset.text
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
self.sideband.config["hw_rnode_spreading_factor"] = int(self.hardware_rnode_screen.ids.hardware_rnode_spreadingfactor.text)
|
||||
self.sideband.config["hw_rnode_sec_channel"] = self.hardware_rnode_screen.ids.hardware_rnode_sec_channel.text
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
self.sideband.config["hw_rnode_coding_rate"] = int(self.hardware_rnode_screen.ids.hardware_rnode_codingrate.text)
|
||||
self.sideband.config["hw_rnode_secondary_modem"] = bool(self.hardware_rnode_screen.ids.hardware_rnode_secondary_modem.active)
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
self.sideband.config["hw_rnode_atl_short"] = float(self.hardware_rnode_screen.ids.hardware_rnode_atl_short.text)
|
||||
except:
|
||||
self.sideband.config["hw_rnode_atl_short"] = None
|
||||
if self.sideband.config["hw_rnode_secondary_modem"]:
|
||||
if self.sideband.config["hw_rnode_sec_advanced_cfg"]:
|
||||
try:
|
||||
self.sideband.config["hw_rnode_sec_frequency"] = int(float(self.hardware_rnode_screen.ids.hardware_rnode_sec_frequency.text)*1000000)
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
self.sideband.config["hw_rnode_atl_long"] = float(self.hardware_rnode_screen.ids.hardware_rnode_atl_long.text)
|
||||
except:
|
||||
self.sideband.config["hw_rnode_atl_long"] = None
|
||||
try:
|
||||
self.sideband.config["hw_rnode_sec_bandwidth"] = int(float(self.hardware_rnode_screen.ids.hardware_rnode_sec_bandwidth.text)*1000)
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
self.sideband.config["hw_rnode_sec_tx_power"] = int(self.hardware_rnode_screen.ids.hardware_rnode_sec_txpower.text)
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
self.sideband.config["hw_rnode_sec_spreading_factor"] = int(self.hardware_rnode_screen.ids.hardware_rnode_sec_spreadingfactor.text)
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
self.sideband.config["hw_rnode_sec_coding_rate"] = int(self.hardware_rnode_screen.ids.hardware_rnode_sec_codingrate.text)
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
self.sideband.config["hw_rnode_sec_atl_short"] = float(self.hardware_rnode_screen.ids.hardware_rnode_sec_atl_short.text)
|
||||
except:
|
||||
self.sideband.config["hw_rnode_sec_atl_short"] = None
|
||||
try:
|
||||
self.sideband.config["hw_rnode_sec_atl_long"] = float(self.hardware_rnode_screen.ids.hardware_rnode_sec_atl_long.text)
|
||||
except:
|
||||
self.sideband.config["hw_rnode_sec_atl_long"] = None
|
||||
else:
|
||||
try:
|
||||
if self.sideband.config["hw_rnode_sec_preset"] in self.sideband.config["hw_rnode_presets"]:
|
||||
index = self.sideband.config["hw_rnode_sec_presets"].index(self.sideband.config["hw_rnode_preset"])
|
||||
|
||||
self.sideband.config["hw_rnode_sec_bandwidth"] = self.sideband.config["hw_rnode_presets_cfg"][index][0]
|
||||
self.sideband.config["hw_rnode_sec_spreading_factor"] = self.sideband.config["hw_rnode_presets_cfg"][index][1]
|
||||
self.sideband.config["hw_rnode_sec_coding_rate"] = self.sideband.config["hw_rnode_presets_cfg"][index][2]
|
||||
|
||||
if self.sideband.config["hw_rnode_sec_presets_cfg"][index][3] != 100:
|
||||
self.sideband.config["hw_rnode_sec_atl_short"] = self.sideband.config["hw_rnode_presets_cfg"][index][3]
|
||||
else:
|
||||
self.sideband.config["hw_rnode_sec_atl_short"] = None
|
||||
|
||||
if self.sideband.config["hw_rnode_sec_presets_cfg"][index][4] != 100:
|
||||
self.sideband.config["hw_rnode_sec_atl_long"] = self.sideband.config["hw_rnode_presets_cfg"][index][4]
|
||||
else:
|
||||
self.sideband.config["hw_rnode_sec_atl_long"] = None
|
||||
|
||||
except Exception as e:
|
||||
RNS.log("Error while configuring secondary modem preset parameters: "+str(e), RNS.LOG_ERROR)
|
||||
|
||||
# Temporary until dropdown for frequencies added
|
||||
try:
|
||||
self.sideband.config["hw_rnode_sec_frequency"] = int(float(self.hardware_rnode_screen.ids.hardware_rnode_sec_frequency.text)*1000000)
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
self.sideband.config["hw_rnode_sec_tx_power"] = int(self.hardware_rnode_screen.ids.hardware_rnode_sec_txpower.text)
|
||||
except:
|
||||
pass
|
||||
|
||||
if self.hardware_rnode_screen.ids.hardware_rnode_beaconinterval.text == "":
|
||||
self.sideband.config["hw_rnode_beaconinterval"] = None
|
||||
@ -2939,6 +3068,206 @@ class SidebandApp(MDApp):
|
||||
threading.Thread(target=re_enable, daemon=True).start()
|
||||
self.sideband.setstate("wants.bt_pair", True)
|
||||
|
||||
def hardware_rnode_channel_set(self, caller):
|
||||
if caller == self.hardware_rnode_screen.ids.hardware_rnode_channel_dec:
|
||||
self.sideband.config["hw_rnode_channel_index"] -= 1
|
||||
if self.sideband.config["hw_rnode_channel_index"] < 0:
|
||||
self.sideband.config["hw_rnode_channel_index"] = 0
|
||||
channel = list(self.sideband.config["hw_rnode_channels"].keys())[self.sideband.config["hw_rnode_channel_index"]]
|
||||
primary_modem = True
|
||||
elif caller == self.hardware_rnode_screen.ids.hardware_rnode_channel_inc:
|
||||
self.sideband.config["hw_rnode_channel_index"] += 1
|
||||
if self.sideband.config["hw_rnode_channel_index"] >= len(self.sideband.config["hw_rnode_channels"].keys()):
|
||||
self.sideband.config["hw_rnode_channel_index"] = len(self.sideband.config["hw_rnode_channels"].keys()) - 1
|
||||
channel = list(self.sideband.config["hw_rnode_channels"].keys())[self.sideband.config["hw_rnode_channel_index"]]
|
||||
primary_modem = True
|
||||
|
||||
elif caller == self.hardware_rnode_screen.ids.hardware_rnode_sec_channel_dec:
|
||||
self.sideband.config["hw_rnode_sec_channel_index"] -= 1
|
||||
if self.sideband.config["hw_rnode_sec_channel_index"] < 0:
|
||||
self.sideband.config["hw_rnode_sec_channel_index"] = 0
|
||||
channel = list(self.sideband.config["hw_rnode_channels"].keys())[self.sideband.config["hw_rnode_sec_channel_index"]]
|
||||
primary_modem = False
|
||||
|
||||
elif caller == self.hardware_rnode_screen.ids.hardware_rnode_sec_channel_inc:
|
||||
self.sideband.config["hw_rnode_sec_channel_index"] += 1
|
||||
if self.sideband.config["hw_rnode_sec_channel_index"] >= len(self.sideband.config["hw_rnode_sec_channels"].keys()):
|
||||
self.sideband.config["hw_rnode_sec_channel_index"] = len(self.sideband.config["hw_rnode_sec_channels"].keys()) - 1
|
||||
channel = list(self.sideband.config["hw_rnode_channels"].keys())[self.sideband.config["hw_rnode_sec_channel_index"]]
|
||||
primary_modem = False
|
||||
|
||||
RNS.log("Setting channel to: " + channel,RNS.LOG_DEBUG)
|
||||
|
||||
if primary_modem:
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_channel.text = channel
|
||||
if self.sideband.config["hw_rnode_channel_index"] == 4:
|
||||
# Change bandwidth on channel 5 to 250kHz due to le epic ofcom regulation
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_bandwidth.text = str(250000 / 1000)
|
||||
else:
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_channel.text = channel
|
||||
|
||||
|
||||
self.hardware_rnode_load_channel(channel, primary_modem)
|
||||
if self.hardware_rnode_validate():
|
||||
self.hardware_rnode_save()
|
||||
|
||||
def hardware_rnode_load_channel(self, channel, primary_modem):
|
||||
if primary_modem:
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_frequency.text = str(self.sideband.config["hw_rnode_channels"][channel])
|
||||
else:
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_frequency.text = str(self.sideband.config["hw_rnode_sec_channels"][channel])
|
||||
|
||||
|
||||
def hardware_rnode_preset_set(self, caller):
|
||||
if caller == self.hardware_rnode_screen.ids.hardware_rnode_preset_prev:
|
||||
self.sideband.config["hw_rnode_preset_index"] -= 1
|
||||
if self.sideband.config["hw_rnode_preset_index"] < 0:
|
||||
self.sideband.config["hw_rnode_preset_index"] = 0
|
||||
preset = self.sideband.config["hw_rnode_presets"][self.sideband.config["hw_rnode_preset_index"]]
|
||||
primary_modem = True
|
||||
|
||||
elif caller == self.hardware_rnode_screen.ids.hardware_rnode_preset_next:
|
||||
self.sideband.config.hw_rnode_preset_index += 1
|
||||
if self.sideband.config["hw_rnode_preset_index"] >= len(self.sideband.config["hw_rnode_channels"].keys()):
|
||||
self.sideband.config["hw_rnode_preset_index"] = len(self.sideband.config["hw_rnode_channels"].keys()) - 1
|
||||
preset = self.sideband.config["hw_rnode_presets"][self.sideband.config["hw_rnode_preset_index"]]
|
||||
primary_modem = True
|
||||
|
||||
elif caller == self.hardware_rnode_screen.ids.hardware_rnode_sec_preset_prev:
|
||||
self.sideband.config["hw_rnode_sec_preset_index"] -= 1
|
||||
if self.sideband.config["hw_rnode_sec_preset_index"] < 0:
|
||||
self.sideband.config["hw_rnode_sec_preset_index"] = 0
|
||||
preset = self.sideband.config["hw_rnode_presets"][self.sideband.config["hw_rnode_sec_preset_index"]]
|
||||
primary_modem = False
|
||||
|
||||
elif caller == self.hardware_rnode_screen.ids.hardware_rnode_sec_preset_next:
|
||||
self.sideband.config["hw_rnode_sec_preset_index"] += 1
|
||||
if self.sideband.config["hw_rnode_sec_preset_index"] >= len(self.sideband.config["hw_rnode_sec_channels"].keys()):
|
||||
self.sideband.config["hw_rnode_sec_preset_index"] = len(self.sideband.config["hw_rnode_sec_channels"].keys()) - 1
|
||||
preset = self.sideband.config["hw_rnode_presets"][self.sideband.config["hw_rnode_sec_preset_index"]]
|
||||
primary_modem = False
|
||||
|
||||
RNS.log("Setting preset to: " + preset,RNS.LOG_DEBUG)
|
||||
|
||||
if primary_modem:
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_preset.text = preset
|
||||
else:
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_preset.text = preset
|
||||
|
||||
self.hardware_rnode_load_preset(preset, primary_modem)
|
||||
if self.hardware_rnode_validate():
|
||||
self.hardware_rnode_save()
|
||||
|
||||
def hardware_rnode_load_preset(self, preset, primary_modem):
|
||||
if primary_modem:
|
||||
if preset in self.sideband.config["hw_rnode_presets"]:
|
||||
index = self.sideband.config["hw_rnode_presets"].index(preset)
|
||||
|
||||
# Only edit if channel 5 not selected
|
||||
if self.sideband.config["hw_rnode_channel_index"] != 4:
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_bandwidth.text = str(self.sideband.config["hw_rnode_presets_cfg"][index][0] / 1000)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_spreadingfactor.text = str(self.sideband.config["hw_rnode_presets_cfg"][index][1])
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_codingrate.text = str(self.sideband.config["hw_rnode_presets_cfg"][index][2])
|
||||
|
||||
if self.sideband.config["hw_rnode_presets_cfg"][index][3] != 100:
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_atl_short.text = str(self.sideband.config["hw_rnode_presets_cfg"][index][3])
|
||||
|
||||
if self.sideband.config["hw_rnode_presets_cfg"][index][4] != 100:
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_atl_long.text = str(self.sideband.config["hw_rnode_presets_cfg"][index][4])
|
||||
else:
|
||||
if preset in self.sideband.config["hw_rnode_presets"]:
|
||||
index = self.sideband.config["hw_rnode_presets"].index(preset)
|
||||
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_bandwidth.text = str(self.sideband.config["hw_rnode_sec_presets_cfg"][index][0] / 1000)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_spreadingfactor.text = str(self.sideband.config["hw_rnode_sec_presets_cfg"][index][1])
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_codingrate.text = str(self.sideband.config["hw_rnode_sec_presets_cfg"][index][2])
|
||||
|
||||
if self.sideband.config["hw_rnode_sec_presets_cfg"][index][3] != 100:
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_atl_short.text = str(self.sideband.config["hw_rnode_sec_presets_cfg"][index][3])
|
||||
|
||||
if self.sideband.config["hw_rnode_sec_presets_cfg"][index][4] != 100:
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_atl_long.text = str(self.sideband.config["hw_rnode_sec_presets_cfg"][index][4])
|
||||
|
||||
def hardware_rnode_advanced_cfg_toggle_action(self, sender=None, event=None):
|
||||
if sender.active:
|
||||
self.sideband.config["hw_rnode_advanced_cfg"] = True
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_frequency,False)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_bandwidth,False)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_txpower,False)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_spreadingfactor,False)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_codingrate,False)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_airtime_label,False)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_atl_short,False)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_atl_long,False)
|
||||
else:
|
||||
self.sideband.config["hw_rnode_advanced_cfg"] = False
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_frequency,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_bandwidth,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_txpower,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_spreadingfactor,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_codingrate,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_airtime_label,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_atl_short,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_atl_long,True)
|
||||
|
||||
self.sideband.save_configuration()
|
||||
|
||||
def hardware_rnode_sec_advanced_cfg_toggle_action(self, sender=None, event=None):
|
||||
if sender.active:
|
||||
self.sideband.config["hw_rnode_sec_advanced_cfg"] = True
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_frequency,False)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_bandwidth,False)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_txpower,False)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_spreadingfactor,False)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_codingrate,False)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_airtime_label,False)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_atl_short,False)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_atl_long,False)
|
||||
else:
|
||||
self.sideband.config["hw_rnode_sec_advanced_cfg"] = False
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_frequency,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_bandwidth,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_txpower,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_spreadingfactor,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_codingrate,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_airtime_label,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_atl_short,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_atl_long,True)
|
||||
|
||||
self.sideband.save_configuration()
|
||||
|
||||
def hardware_rnode_secondary_modem_toggle_action(self, sender=None, event=None):
|
||||
if sender.active:
|
||||
self.sideband.config["hw_rnode_secondary_modem"] = True
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_channel,False)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_channel_dec,False)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_channel_inc,False)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_preset,False)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_preset_prev,False)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_preset_next,False)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_advanced_cfg,False)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_advanced_cfg_label,False)
|
||||
else:
|
||||
self.sideband.config["hw_rnode_secondary_modem"] = False
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_channel,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_channel_dec,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_channel_inc,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_preset,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_preset_prev,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_preset_next,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_advanced_cfg,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_advanced_cfg_label,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_frequency,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_bandwidth,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_txpower,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_spreadingfactor,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_codingrate,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_atl_short,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_atl_long,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_airtime_label,True)
|
||||
|
||||
self.sideband.save_configuration()
|
||||
|
||||
def hardware_rnode_bt_toggle_action(self, sender=None, event=None):
|
||||
if sender.active:
|
||||
self.sideband.config["hw_rnode_bluetooth"] = True
|
||||
@ -2973,6 +3302,10 @@ class SidebandApp(MDApp):
|
||||
if not sender.focus:
|
||||
save_connectivity(sender=sender)
|
||||
|
||||
t_channel = self.sideband.config["hw_rnode_channel"]
|
||||
|
||||
t_preset = self.sideband.config["hw_rnode_preset"]
|
||||
|
||||
if self.sideband.config["hw_rnode_frequency"] != None:
|
||||
t_freq = str(self.sideband.config["hw_rnode_frequency"]/1000000.0)
|
||||
else:
|
||||
@ -2993,6 +3326,48 @@ class SidebandApp(MDApp):
|
||||
t_cr = str(self.sideband.config["hw_rnode_coding_rate"])
|
||||
else:
|
||||
t_cr = str(6)
|
||||
if self.sideband.config["hw_rnode_atl_short"] != None:
|
||||
t_ats = str(self.sideband.config["hw_rnode_atl_short"])
|
||||
else:
|
||||
t_ats = ""
|
||||
if self.sideband.config["hw_rnode_atl_long"] != None:
|
||||
t_atl = str(self.sideband.config["hw_rnode_atl_long"])
|
||||
else:
|
||||
t_atl = ""
|
||||
|
||||
t_sec_channel = self.sideband.config["hw_rnode_sec_channel"]
|
||||
|
||||
t_sec_preset = self.sideband.config["hw_rnode_sec_preset"]
|
||||
|
||||
if self.sideband.config["hw_rnode_sec_frequency"] != None:
|
||||
t_sec_freq = str(self.sideband.config["hw_rnode_sec_frequency"]/1000000.0)
|
||||
else:
|
||||
t_sec_freq = ""
|
||||
if self.sideband.config["hw_rnode_sec_bandwidth"] != None:
|
||||
t_sec_bw = str(self.sideband.config["hw_rnode_sec_bandwidth"]/1000.0)
|
||||
else:
|
||||
t_sec_bw = str(62.5)
|
||||
if self.sideband.config["hw_rnode_sec_tx_power"] != None:
|
||||
t_sec_p = str(self.sideband.config["hw_rnode_sec_tx_power"])
|
||||
else:
|
||||
t_sec_p = str(0)
|
||||
if self.sideband.config["hw_rnode_sec_spreading_factor"] != None:
|
||||
t_sec_sf = str(self.sideband.config["hw_rnode_sec_spreading_factor"])
|
||||
else:
|
||||
t_sec_sf = str(8)
|
||||
if self.sideband.config["hw_rnode_sec_coding_rate"] != None:
|
||||
t_sec_cr = str(self.sideband.config["hw_rnode_sec_coding_rate"])
|
||||
else:
|
||||
t_sec_cr = str(6)
|
||||
if self.sideband.config["hw_rnode_sec_atl_short"] != None:
|
||||
t_sec_ats = str(self.sideband.config["hw_rnode_sec_atl_short"])
|
||||
else:
|
||||
t_sec_ats = ""
|
||||
if self.sideband.config["hw_rnode_sec_atl_long"] != None:
|
||||
t_sec_atl = str(self.sideband.config["hw_rnode_sec_atl_long"])
|
||||
else:
|
||||
t_sec_atl = ""
|
||||
|
||||
if self.sideband.config["hw_rnode_beaconinterval"] != None:
|
||||
t_bi = str(self.sideband.config["hw_rnode_beaconinterval"])
|
||||
else:
|
||||
@ -3005,47 +3380,113 @@ class SidebandApp(MDApp):
|
||||
t_btd = str(self.sideband.config["hw_rnode_bt_device"])
|
||||
else:
|
||||
t_btd = ""
|
||||
if self.sideband.config["hw_rnode_atl_short"] != None:
|
||||
t_ats = str(self.sideband.config["hw_rnode_atl_short"])
|
||||
else:
|
||||
t_ats = ""
|
||||
if self.sideband.config["hw_rnode_atl_long"] != None:
|
||||
t_atl = str(self.sideband.config["hw_rnode_atl_long"])
|
||||
else:
|
||||
t_atl = ""
|
||||
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_bluetooth.active = self.sideband.config["hw_rnode_bluetooth"]
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_framebuffer.active = self.sideband.config["hw_rnode_enable_framebuffer"]
|
||||
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_advanced_cfg.active = self.sideband.config["hw_rnode_advanced_cfg"]
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_advanced_cfg.active = self.sideband.config["hw_rnode_sec_advanced_cfg"]
|
||||
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_secondary_modem.active = self.sideband.config["hw_rnode_secondary_modem"]
|
||||
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_channel.text = t_channel
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_preset.text = t_preset
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_frequency.text = t_freq
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_bandwidth.text = t_bw
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_txpower.text = t_p
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_spreadingfactor.text = t_sf
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_codingrate.text = t_cr
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_atl_short.text = t_ats
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_atl_long.text = t_atl
|
||||
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_channel.text = t_sec_channel
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_preset.text = t_sec_preset
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_frequency.text = t_sec_freq
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_bandwidth.text = t_sec_bw
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_txpower.text = t_sec_p
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_spreadingfactor.text = t_sec_sf
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_codingrate.text = t_sec_cr
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_atl_short.text = t_sec_ats
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_atl_long.text = t_sec_atl
|
||||
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_beaconinterval.text = t_bi
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_beacondata.text = t_bd
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_bt_device.text = t_btd
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_atl_short.text = t_ats
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_atl_long.text = t_atl
|
||||
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_frequency.bind(focus=focus_save)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_bandwidth.bind(focus=focus_save)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_txpower.bind(focus=focus_save)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_spreadingfactor.bind(focus=focus_save)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_codingrate.bind(focus=focus_save)
|
||||
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_frequency.bind(focus=focus_save)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_bandwidth.bind(focus=focus_save)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_txpower.bind(focus=focus_save)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_spreadingfactor.bind(focus=focus_save)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_codingrate.bind(focus=focus_save)
|
||||
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_beaconinterval.bind(focus=focus_save)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_beacondata.bind(focus=focus_save)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_bt_device.bind(focus=focus_save)
|
||||
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_frequency.bind(on_text_validate=save_connectivity)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_bandwidth.bind(on_text_validate=save_connectivity)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_txpower.bind(on_text_validate=save_connectivity)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_spreadingfactor.bind(on_text_validate=save_connectivity)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_codingrate.bind(on_text_validate=save_connectivity)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_beaconinterval.bind(on_text_validate=save_connectivity)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_beacondata.bind(on_text_validate=save_connectivity)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_atl_short.bind(on_text_validate=save_connectivity)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_atl_long.bind(on_text_validate=save_connectivity)
|
||||
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_frequency.bind(on_text_validate=save_connectivity)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_bandwidth.bind(on_text_validate=save_connectivity)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_txpower.bind(on_text_validate=save_connectivity)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_spreadingfactor.bind(on_text_validate=save_connectivity)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_codingrate.bind(on_text_validate=save_connectivity)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_atl_short.bind(on_text_validate=save_connectivity)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_atl_long.bind(on_text_validate=save_connectivity)
|
||||
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_beaconinterval.bind(on_text_validate=save_connectivity)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_beacondata.bind(on_text_validate=save_connectivity)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_bluetooth.bind(active=self.hardware_rnode_bt_toggle_action)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_framebuffer.bind(active=self.hardware_rnode_framebuffer_toggle_action)
|
||||
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_advanced_cfg.bind(active=self.hardware_rnode_advanced_cfg_toggle_action)
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_sec_advanced_cfg.bind(active=self.hardware_rnode_sec_advanced_cfg_toggle_action)
|
||||
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_secondary_modem.bind(active=self.hardware_rnode_secondary_modem_toggle_action)
|
||||
|
||||
# Hide secondary modem options by default
|
||||
if (not self.sideband.config["hw_rnode_secondary_modem"]):
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_preset,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_preset_prev,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_preset_next,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_channel,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_channel_dec,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_channel_inc,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_advanced_cfg_label,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_advanced_cfg,True)
|
||||
|
||||
# Hide advanced options by default
|
||||
if (not self.sideband.config["hw_rnode_advanced_cfg"]):
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_frequency,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_bandwidth,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_txpower,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_spreadingfactor,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_codingrate,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_atl_short,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_atl_long,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_airtime_label,True)
|
||||
|
||||
if (not self.sideband.config["hw_rnode_sec_advanced_cfg"]):
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_frequency,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_bandwidth,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_txpower,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_spreadingfactor,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_codingrate,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_atl_short,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_atl_long,True)
|
||||
self.widget_hide(self.hardware_rnode_screen.ids.hardware_rnode_sec_airtime_label,True)
|
||||
|
||||
self.hardware_rnode_ready = True
|
||||
|
||||
def hardware_rnode_validate(self, sender=None):
|
||||
@ -3061,7 +3502,7 @@ class SidebandApp(MDApp):
|
||||
valid = False
|
||||
|
||||
try:
|
||||
valid_vals = [7.8, 10.4, 15.6, 20.8, 31.25, 41.7, 62.5, 125, 250, 500]
|
||||
valid_vals = [7.8, 10.4, 15.6, 20.8, 31.25, 41.7, 62.5, 125, 203.125, 250, 406.25, 500, 812.5, 1625]
|
||||
val = float(self.hardware_rnode_screen.ids.hardware_rnode_bandwidth.text)
|
||||
if not val in valid_vals:
|
||||
raise ValueError("Invalid bandwidth")
|
||||
@ -3083,7 +3524,7 @@ class SidebandApp(MDApp):
|
||||
|
||||
try:
|
||||
val = int(self.hardware_rnode_screen.ids.hardware_rnode_spreadingfactor.text)
|
||||
if val < 7 or val > 12:
|
||||
if val < 5 or val > 12:
|
||||
raise ValueError("Invalid sf")
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_spreadingfactor.error = False
|
||||
self.hardware_rnode_screen.ids.hardware_rnode_spreadingfactor.text = str(val)
|
||||
|
@ -29,8 +29,8 @@
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
|
||||
<!-- Legacy permissions for bluetooth access (Android < 12) -->
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" />
|
||||
<!--<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />-->
|
||||
<!--<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" />-->
|
||||
|
||||
{% for perm in args.permissions %}
|
||||
<uses-permission android:name="{{ perm.name }}"{% if perm.maxSdkVersion %} android:maxSdkVersion="{{ perm.maxSdkVersion }}"{% endif %}{% if perm.usesPermissionFlags %} android:usesPermissionFlags="{{ perm.usesPermissionFlags }}"{% endif %} />
|
||||
|
@ -342,7 +342,12 @@ class SidebandService():
|
||||
|
||||
if self.sideband.interface_rnode != None:
|
||||
if self.sideband.interface_rnode.online:
|
||||
rs = "On-air at "+str(self.sideband.interface_rnode.bitrate_kbps)+" Kbps"
|
||||
if self.sideband.interface_rnode is RNS.Interfaces.Android.RNodeMultiInterface.RNodeMultiInterface:
|
||||
rs = ""
|
||||
for subinterface in self.sideband.interface_rnode.subinterfaces:
|
||||
rs += "On-air at "+str(subinterface.bitrate_kbps)+" Kbps \n" # \todo does this work?
|
||||
else:
|
||||
rs = "On-air at "+str(self.sideband.interface_rnode.bitrate_kbps)+" Kbps"
|
||||
else:
|
||||
rs = "Interface Down"
|
||||
|
||||
|
@ -341,12 +341,47 @@ class SidebandCore():
|
||||
self.config["connect_ifmode_bluetooth"] = "full"
|
||||
|
||||
# Hardware
|
||||
self.config["hw_rnode_presets"] = ["Short range - high data rate", "Medium range - average data rate", "Long range - low data rate", "Very long range - very low data rate"]
|
||||
self.config["hw_rnode_presets_cfg"] = [[125000, 5, 5, 100, 10], [125000, 7, 6, 100, 10], [125000, 9, 7, 100, 10], [125000, 12, 8, 100, 10]]
|
||||
self.config["hw_rnode_advanced_cfg"] = False
|
||||
self.config["hw_rnode_preset"] = self.config["hw_rnode_presets"][0]
|
||||
self.config["hw_rnode_channels"] = {
|
||||
"Channel 1": 865.7, # MHz
|
||||
"Channel 2": 866.3, # MHz
|
||||
"Channel 3": 866.9, # MHz
|
||||
"Channel 4": 867.5, # MHz
|
||||
"Channel 5": 869.525, # MHz
|
||||
}
|
||||
channel_keys = sorted(self.config["hw_rnode_channels"].keys())
|
||||
self.config["hw_rnode_channel_index"] = 0
|
||||
self.config["hw_rnode_channel"] = channel_keys[0]
|
||||
self.config["hw_rnode_frequency"] = None
|
||||
self.config["hw_rnode_modulation"] = "LoRa"
|
||||
self.config["hw_rnode_preset_index"] = 0
|
||||
self.config["hw_rnode_bandwidth"] = 62500
|
||||
self.config["hw_rnode_spreading_factor"] = 8
|
||||
self.config["hw_rnode_coding_rate"] = 6
|
||||
self.config["hw_rnode_tx_power"] = 0
|
||||
self.config["hw_rnode_tx_power"] = 22
|
||||
self.config["hw_rnode_secondary_modem"] = False
|
||||
self.config["hw_rnode_sec_presets_cfg"] = [[1625000, 5, 5, 100, 100], [1625000, 7, 6, 100, 100], [1625000, 9, 7, 100, 100], [1625000, 12, 8, 100, 100]]
|
||||
self.config["hw_rnode_sec_advanced_cfg"] = False
|
||||
self.config["hw_rnode_sec_preset"] = self.config["hw_rnode_presets"][0]
|
||||
self.config["hw_rnode_sec_channels"] = {
|
||||
"Channel 1": 2400.8125, # MHz
|
||||
"Channel 2": 2402.8125, # MHz
|
||||
"Channel 3": 2404.8125, # MHz
|
||||
"Channel 4": 2406.8125, # MHz
|
||||
}
|
||||
channel_keys = sorted(self.config["hw_rnode_sec_channels"].keys())
|
||||
self.config["hw_rnode_sec_channel_index"] = 0
|
||||
self.config["hw_rnode_sec_channel"] = channel_keys[0]
|
||||
self.config["hw_rnode_sec_frequency"] = None
|
||||
self.config["hw_rnode_sec_modulation"] = "LoRa"
|
||||
self.config["hw_rnode_sec_preset_index"] = 0
|
||||
self.config["hw_rnode_sec_bandwidth"] = 62500
|
||||
self.config["hw_rnode_sec_spreading_factor"] = 8
|
||||
self.config["hw_rnode_sec_coding_rate"] = 6
|
||||
self.config["hw_rnode_tx_power"] = 5
|
||||
self.config["hw_rnode_beaconinterval"] = None
|
||||
self.config["hw_rnode_beacondata"] = None
|
||||
self.config["hw_rnode_bt_device"] = None
|
||||
@ -492,6 +527,26 @@ class SidebandCore():
|
||||
self.config["hw_rnode_coding_rate"] = 6
|
||||
if not "hw_rnode_tx_power" in self.config:
|
||||
self.config["hw_rnode_tx_power"] = 0
|
||||
if not "hw_rnode_sec_frequency" in self.config:
|
||||
self.config["hw_rnode_sec_frequency"] = None
|
||||
if not "hw_rnode_sec_modulation" in self.config:
|
||||
self.config["hw_rnode_sec_modulation"] = "LoRa"
|
||||
if not "hw_rnode_sec_bandwidth" in self.config:
|
||||
self.config["hw_rnode_sec_bandwidth"] = 62500
|
||||
if not "hw_rnode_sec_spreading_factor" in self.config:
|
||||
self.config["hw_rnode_sec_spreading_factor"] = 8
|
||||
if not "hw_rnode_sec_coding_rate" in self.config:
|
||||
self.config["hw_rnode_sec_coding_rate"] = 6
|
||||
if not "hw_rnode_sec_tx_power" in self.config:
|
||||
self.config["hw_rnode_sec_tx_power"] = 0
|
||||
if not "hw_rnode_atl_short" in self.config:
|
||||
self.config["hw_rnode_atl_short"] = None
|
||||
if not "hw_rnode_atl_long" in self.config:
|
||||
self.config["hw_rnode_atl_long"] = None
|
||||
if not "hw_rnode_sec_atl_short" in self.config:
|
||||
self.config["hw_rnode_sec_atl_short"] = None
|
||||
if not "hw_rnode_sec_atl_long" in self.config:
|
||||
self.config["hw_rnode_sec_atl_long"] = None
|
||||
if not "hw_rnode_beaconinterval" in self.config:
|
||||
self.config["hw_rnode_beaconinterval"] = None
|
||||
if not "hw_rnode_beacondata" in self.config:
|
||||
@ -502,10 +557,6 @@ class SidebandCore():
|
||||
self.config["hw_rnode_enable_framebuffer"] = False
|
||||
if not "hw_rnode_bt_device" in self.config:
|
||||
self.config["hw_rnode_bt_device"] = None
|
||||
if not "hw_rnode_atl_short" in self.config:
|
||||
self.config["hw_rnode_atl_short"] = None
|
||||
if not "hw_rnode_atl_long" in self.config:
|
||||
self.config["hw_rnode_atl_long"] = None
|
||||
|
||||
if not "hw_modem_baudrate" in self.config:
|
||||
self.config["hw_modem_baudrate"] = 115200
|
||||
@ -1329,7 +1380,7 @@ class SidebandCore():
|
||||
else:
|
||||
if self.is_service:
|
||||
if debug:
|
||||
RNS.loglevel = 6
|
||||
RNS.loglevel = 7 # for debug purposes
|
||||
else:
|
||||
RNS.loglevel = 2
|
||||
return True
|
||||
@ -2925,7 +2976,7 @@ class SidebandCore():
|
||||
def _reticulum_log_debug(self, debug=False):
|
||||
self.log_verbose = debug
|
||||
if self.log_verbose:
|
||||
selected_level = 6
|
||||
selected_level = 7 # debugging purposes
|
||||
else:
|
||||
selected_level = 2
|
||||
|
||||
@ -2935,7 +2986,7 @@ class SidebandCore():
|
||||
|
||||
def __start_jobs_immediate(self):
|
||||
if self.log_verbose:
|
||||
selected_level = 6
|
||||
selected_level = 7 # debugging purposes
|
||||
else:
|
||||
selected_level = 2
|
||||
|
||||
@ -3096,11 +3147,13 @@ class SidebandCore():
|
||||
target_port = None
|
||||
|
||||
bt_device_name = None
|
||||
ble_dispatcher = None
|
||||
rnode_allow_bluetooth = False
|
||||
if self.getpersistent("permissions.bluetooth"):
|
||||
if self.config["hw_rnode_bluetooth"]:
|
||||
RNS.log("Allowing RNode bluetooth", RNS.LOG_DEBUG)
|
||||
rnode_allow_bluetooth = True
|
||||
ble_dispatcher = RNS.Interfaces.Android.RNodeMultiInterface.AndroidBLEDispatcher()
|
||||
if self.config["hw_rnode_bt_device"] != None:
|
||||
bt_device_name = self.config["hw_rnode_bt_device"]
|
||||
|
||||
@ -3131,25 +3184,75 @@ class SidebandCore():
|
||||
else:
|
||||
atl_long = self.config["hw_rnode_atl_long"]
|
||||
|
||||
rnodeinterface = RNS.Interfaces.Android.RNodeInterface.RNodeInterface(
|
||||
RNS.Transport,
|
||||
"RNodeInterface",
|
||||
target_port,
|
||||
frequency = self.config["hw_rnode_frequency"],
|
||||
bandwidth = self.config["hw_rnode_bandwidth"],
|
||||
txpower = self.config["hw_rnode_tx_power"],
|
||||
sf = self.config["hw_rnode_spreading_factor"],
|
||||
cr = self.config["hw_rnode_coding_rate"],
|
||||
flow_control = None,
|
||||
id_interval = self.config["hw_rnode_beaconinterval"],
|
||||
id_callsign = self.config["hw_rnode_beacondata"],
|
||||
allow_bluetooth = rnode_allow_bluetooth,
|
||||
target_device_name = bt_device_name,
|
||||
st_alock = atl_short,
|
||||
lt_alock = atl_long,
|
||||
)
|
||||
if self.config["hw_rnode_secondary_modem"]:
|
||||
subint_config = [[0]*10 for i in range(2)]
|
||||
|
||||
rnodeinterface.OUT = True
|
||||
# Primary modem
|
||||
subint_config[0][0] = "Primary modem" # Name of interface
|
||||
subint_config[0][1] = 0 # Virtual port
|
||||
subint_config[0][2] = self.config["hw_rnode_frequency"]
|
||||
subint_config[0][3] = self.config["hw_rnode_bandwidth"]
|
||||
subint_config[0][4] = self.config["hw_rnode_tx_power"]
|
||||
subint_config[0][5] = self.config["hw_rnode_spreading_factor"]
|
||||
subint_config[0][6] = self.config["hw_rnode_coding_rate"]
|
||||
subint_config[0][7] = False # flow control hardcoded to false for now
|
||||
subint_config[0][8] = atl_short
|
||||
subint_config[0][9] = atl_long
|
||||
|
||||
# Secondary modem
|
||||
subint_config[1][0] = "Secondary modem" # Name of interface
|
||||
subint_config[1][1] = 1 # Virtual port
|
||||
subint_config[1][2] = self.config["hw_rnode_sec_frequency"]
|
||||
subint_config[1][3] = self.config["hw_rnode_sec_bandwidth"]
|
||||
subint_config[1][4] = self.config["hw_rnode_sec_tx_power"]
|
||||
subint_config[1][5] = self.config["hw_rnode_sec_spreading_factor"]
|
||||
subint_config[1][6] = self.config["hw_rnode_coding_rate"]
|
||||
subint_config[1][7] = False # flow control hardcoded to false for now
|
||||
|
||||
if self.config["hw_rnode_atl_short"] == "":
|
||||
sec_atl_short = None
|
||||
else:
|
||||
sec_atl_short = self.config["hw_rnode_sec_atl_short"]
|
||||
|
||||
if self.config["hw_rnode_atl_long"] == "":
|
||||
sec_atl_long = None
|
||||
else:
|
||||
sec_atl_long = self.config["hw_rnode_sec_atl_long"]
|
||||
|
||||
subint_config[1][8] = sec_atl_short
|
||||
subint_config[1][9] = sec_atl_long
|
||||
|
||||
rnodeinterface = RNS.Interfaces.Android.RNodeMultiInterface.RNodeMultiInterface(
|
||||
RNS.Transport,
|
||||
"RNodeInterface",
|
||||
target_port,
|
||||
subint_config,
|
||||
ble_dispatcher = ble_dispatcher,
|
||||
allow_bluetooth = rnode_allow_bluetooth,
|
||||
target_device_name = bt_device_name,
|
||||
)
|
||||
|
||||
rnodeinterface.OUT = True
|
||||
else:
|
||||
rnodeinterface = RNS.Interfaces.Android.RNodeInterface.RNodeInterface(
|
||||
RNS.Transport,
|
||||
"RNodeInterface",
|
||||
target_port,
|
||||
frequency = self.config["hw_rnode_frequency"],
|
||||
bandwidth = self.config["hw_rnode_bandwidth"],
|
||||
txpower = self.config["hw_rnode_tx_power"],
|
||||
sf = self.config["hw_rnode_spreading_factor"],
|
||||
cr = self.config["hw_rnode_coding_rate"],
|
||||
flow_control = None,
|
||||
id_interval = self.config["hw_rnode_beaconinterval"],
|
||||
id_callsign = self.config["hw_rnode_beacondata"],
|
||||
allow_bluetooth = rnode_allow_bluetooth,
|
||||
target_device_name = bt_device_name,
|
||||
st_alock = atl_short,
|
||||
lt_alock = atl_long,
|
||||
)
|
||||
|
||||
rnodeinterface.OUT = True
|
||||
|
||||
if RNS.Reticulum.transport_enabled():
|
||||
if_mode = Interface.Interface.MODE_FULL
|
||||
|
@ -2106,9 +2106,70 @@ MDScreen:
|
||||
on_release: root.app.hardware_rnode_import(self)
|
||||
|
||||
MDLabel:
|
||||
text: "Radio Options"
|
||||
text: "Primary Modem"
|
||||
font_style: "H6"
|
||||
|
||||
MDBoxLayout:
|
||||
orientation: "horizontal"
|
||||
size_hint_y: None
|
||||
padding: [0,0,dp(24),dp(0)]
|
||||
height: dp(48)
|
||||
|
||||
MDRaisedButton:
|
||||
id: hardware_rnode_channel_dec
|
||||
text: "-"
|
||||
pos_hint: {"center_x": .5, "center_y": .5}
|
||||
on_release: root.app.hardware_rnode_channel_set(self)
|
||||
|
||||
MDRectangleFlatButton:
|
||||
id: hardware_rnode_channel
|
||||
text: "No channel selected"
|
||||
pos_hint: {"center_x": .5, "center_y": .5}
|
||||
|
||||
MDRaisedButton:
|
||||
id: hardware_rnode_channel_inc
|
||||
text: "+"
|
||||
pos_hint: {"center_x": .5, "center_y": .5}
|
||||
on_release: root.app.hardware_rnode_channel_set(self)
|
||||
|
||||
MDBoxLayout:
|
||||
orientation: "horizontal"
|
||||
size_hint_y: None
|
||||
padding: [0,0,dp(24),dp(0)]
|
||||
height: dp(48)
|
||||
|
||||
MDRaisedButton:
|
||||
id: hardware_rnode_preset_prev
|
||||
text: "Prev"
|
||||
#pos_hint: {"center_x": .5, "center_y": .5}
|
||||
on_release: root.app.hardware_rnode_preset_set(self)
|
||||
|
||||
MDRectangleFlatButton:
|
||||
id: hardware_rnode_preset
|
||||
text: "No preset selected"
|
||||
#pos_hint: {"center_x": .5, "center_y": .5}
|
||||
|
||||
MDRaisedButton:
|
||||
id: hardware_rnode_preset_next
|
||||
text: "Next"
|
||||
#pos_hint: {"center_x": .5, "center_y": .5}
|
||||
on_release: root.app.hardware_rnode_preset_set(self)
|
||||
|
||||
MDBoxLayout:
|
||||
orientation: "horizontal"
|
||||
size_hint_y: None
|
||||
padding: [0,0,dp(24),dp(0)]
|
||||
height: dp(48)
|
||||
|
||||
MDLabel:
|
||||
text: "Advanced Configuration"
|
||||
font_style: "Subtitle1"
|
||||
|
||||
MDSwitch:
|
||||
id: hardware_rnode_advanced_cfg
|
||||
pos_hint: {"center_y": 0.3}
|
||||
active: False
|
||||
|
||||
# MDTextField:
|
||||
# id: hardware_rnode_modulation
|
||||
# hint_text: "Modulation"
|
||||
@ -2161,27 +2222,10 @@ MDScreen:
|
||||
font_size: dp(24)
|
||||
|
||||
MDLabel:
|
||||
text: "Optional Settings"
|
||||
font_style: "H6"
|
||||
text: "Airtime Settings"
|
||||
font_style: "Subtitle1"
|
||||
id: hardware_rnode_airtime_label
|
||||
|
||||
MDBoxLayout:
|
||||
orientation: "horizontal"
|
||||
spacing: "24dp"
|
||||
size_hint_y: None
|
||||
height: self.minimum_height
|
||||
# padding: [dp(0), dp(0), dp(0), dp(35)]
|
||||
|
||||
MDTextField:
|
||||
id: hardware_rnode_beaconinterval
|
||||
hint_text: "Beacon Interval (seconds)"
|
||||
text: ""
|
||||
font_size: dp(24)
|
||||
|
||||
MDTextField:
|
||||
id: hardware_rnode_beacondata
|
||||
hint_text: "Beacon Data"
|
||||
text: ""
|
||||
font_size: dp(24)
|
||||
|
||||
MDBoxLayout:
|
||||
orientation: "horizontal"
|
||||
@ -2202,6 +2246,174 @@ MDScreen:
|
||||
text: ""
|
||||
font_size: dp(24)
|
||||
|
||||
MDBoxLayout:
|
||||
orientation: "horizontal"
|
||||
size_hint_y: None
|
||||
padding: [0,0,dp(24),dp(0)]
|
||||
height: dp(48)
|
||||
|
||||
MDLabel:
|
||||
text: "Configure Secondary Modem"
|
||||
font_style: "H6"
|
||||
|
||||
MDSwitch:
|
||||
id: hardware_rnode_secondary_modem
|
||||
pos_hint: {"center_y": 0.3}
|
||||
active: False
|
||||
|
||||
MDBoxLayout:
|
||||
orientation: "horizontal"
|
||||
size_hint_y: None
|
||||
padding: [0,0,dp(24),dp(0)]
|
||||
height: dp(48)
|
||||
|
||||
MDRaisedButton:
|
||||
id: hardware_rnode_sec_channel_dec
|
||||
text: "-"
|
||||
pos_hint: {"center_x": .5, "center_y": .5}
|
||||
on_release: root.app.hardware_rnode_channel_set(self)
|
||||
|
||||
MDRectangleFlatButton:
|
||||
id: hardware_rnode_sec_channel
|
||||
text: "No channel selected"
|
||||
pos_hint: {"center_x": .5, "center_y": .5}
|
||||
|
||||
MDRaisedButton:
|
||||
id: hardware_rnode_sec_channel_inc
|
||||
text: "+"
|
||||
pos_hint: {"center_x": .5, "center_y": .5}
|
||||
on_release: root.app.hardware_rnode_channel_set(self)
|
||||
|
||||
MDBoxLayout:
|
||||
orientation: "horizontal"
|
||||
size_hint_y: None
|
||||
padding: [0,0,dp(24),dp(0)]
|
||||
height: dp(48)
|
||||
|
||||
MDRaisedButton:
|
||||
id: hardware_rnode_sec_preset_prev
|
||||
text: "Prev"
|
||||
#pos_hint: {"center_x": .5, "center_y": .5}
|
||||
on_release: root.app.hardware_rnode_preset_set(self)
|
||||
|
||||
MDRectangleFlatButton:
|
||||
id: hardware_rnode_sec_preset
|
||||
text: "No preset selected"
|
||||
#pos_hint: {"center_x": .5, "center_y": .5}
|
||||
|
||||
MDRaisedButton:
|
||||
id: hardware_rnode_sec_preset_next
|
||||
text: "Next"
|
||||
#pos_hint: {"center_x": .5, "center_y": .5}
|
||||
on_release: root.app.hardware_rnode_preset_set(self)
|
||||
|
||||
MDBoxLayout:
|
||||
orientation: "horizontal"
|
||||
size_hint_y: None
|
||||
padding: [0,0,dp(24),dp(0)]
|
||||
height: dp(48)
|
||||
|
||||
MDLabel:
|
||||
text: "Advanced Configuration"
|
||||
font_style: "Subtitle1"
|
||||
id: hardware_rnode_sec_advanced_cfg_label
|
||||
|
||||
MDSwitch:
|
||||
id: hardware_rnode_sec_advanced_cfg
|
||||
pos_hint: {"center_y": 0.3}
|
||||
active: False
|
||||
|
||||
MDBoxLayout:
|
||||
orientation: "horizontal"
|
||||
spacing: "24dp"
|
||||
size_hint_y: None
|
||||
height: self.minimum_height
|
||||
# padding: [dp(0), dp(0), dp(0), dp(35)]
|
||||
|
||||
MDTextField:
|
||||
id: hardware_rnode_sec_frequency
|
||||
hint_text: "Frequency (MHz)"
|
||||
text: ""
|
||||
font_size: dp(24)
|
||||
|
||||
MDTextField:
|
||||
id: hardware_rnode_sec_bandwidth
|
||||
hint_text: "Bandwidth (KHz)"
|
||||
text: ""
|
||||
font_size: dp(24)
|
||||
|
||||
MDTextField:
|
||||
id: hardware_rnode_sec_txpower
|
||||
hint_text: "TX Power (dBm)"
|
||||
text: ""
|
||||
font_size: dp(24)
|
||||
|
||||
MDBoxLayout:
|
||||
orientation: "horizontal"
|
||||
spacing: "24dp"
|
||||
size_hint_y: None
|
||||
height: self.minimum_height
|
||||
padding: [dp(0), dp(0), dp(0), dp(24)]
|
||||
|
||||
MDTextField:
|
||||
id: hardware_rnode_sec_spreadingfactor
|
||||
hint_text: "Spreading Factor"
|
||||
text: ""
|
||||
font_size: dp(24)
|
||||
|
||||
MDTextField:
|
||||
id: hardware_rnode_sec_codingrate
|
||||
hint_text: "Coding Rate"
|
||||
text: ""
|
||||
font_size: dp(24)
|
||||
|
||||
MDLabel:
|
||||
text: "Airtime Settings"
|
||||
font_style: "Subtitle1"
|
||||
id: hardware_rnode_sec_airtime_label
|
||||
|
||||
MDBoxLayout:
|
||||
orientation: "horizontal"
|
||||
spacing: "24dp"
|
||||
size_hint_y: None
|
||||
height: self.minimum_height
|
||||
# padding: [dp(0), dp(0), dp(0), dp(35)]
|
||||
|
||||
MDTextField:
|
||||
id: hardware_rnode_sec_atl_short
|
||||
hint_text: "Airime Limit % (15s)"
|
||||
text: ""
|
||||
font_size: dp(24)
|
||||
|
||||
MDTextField:
|
||||
id: hardware_rnode_sec_atl_long
|
||||
hint_text: "Airime Limit % (1h)"
|
||||
text: ""
|
||||
font_size: dp(24)
|
||||
|
||||
MDLabel:
|
||||
text: "Beacon Settings"
|
||||
font_style: "Subtitle1"
|
||||
|
||||
MDBoxLayout:
|
||||
orientation: "horizontal"
|
||||
spacing: "24dp"
|
||||
size_hint_y: None
|
||||
height: self.minimum_height
|
||||
# padding: [dp(0), dp(0), dp(0), dp(35)]
|
||||
|
||||
MDTextField:
|
||||
id: hardware_rnode_beaconinterval
|
||||
hint_text: "Beacon Interval (seconds)"
|
||||
text: ""
|
||||
font_size: dp(24)
|
||||
|
||||
MDTextField:
|
||||
id: hardware_rnode_beacondata
|
||||
hint_text: "Beacon Data"
|
||||
text: ""
|
||||
font_size: dp(24)
|
||||
|
||||
MDBoxLayout:
|
||||
orientation: "horizontal"
|
||||
size_hint_y: None
|
||||
|
Loading…
Reference in New Issue
Block a user