From 73b0f6d4b28f971b9b6ba5666060a5555ae17c23 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Mon, 13 Apr 2026 16:55:25 +0200 Subject: [PATCH 01/29] Updated readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b2dd190..4e7648b 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Sideband provides many useful and interesting functions, such as: - Remote **telemetry querying**, with strong, secure and cryptographically robust authentication and control. - **Plugin system** that allows you to easily **create your own commands**, services and telemetry sources. -Sideband is fully compatible with other LXMF clients, such as [MeshChat](https://github.com/liamcottle/reticulum-meshchat), and [Nomad Network](https://github.com/markqvist/nomadnet). The Nomad Network client also allows you to easily host Propagation Nodes for your LXMF network, and more. +Sideband is fully compatible with other LXMF clients, such as [MeshChatX](https://git.quad4.io/RNS-Things/MeshChatX), and [Nomad Network](https://github.com/markqvist/nomadnet). The Nomad Network client also allows you to easily host Propagation Nodes for your LXMF network, and more. # Installation From 75373f3aa0a51374fe6fbc140fb6d8ec3308a922 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Mon, 13 Apr 2026 18:28:15 +0200 Subject: [PATCH 02/29] Fixed button navigation on keys screen --- sbapp/ui/keys.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sbapp/ui/keys.py b/sbapp/ui/keys.py index 5b5e8aa..cd62b9c 100644 --- a/sbapp/ui/keys.py +++ b/sbapp/ui/keys.py @@ -37,6 +37,10 @@ class Keys(): self.keys_screen.ids.keys_info.text = info1 self.keys_screen.ids.backup_info.text = info2 + def test_a(self, sender): + RNS.log("TEST ACTION"); + RNS.log(self) + RNS.log(self.app) def _profile_backup_job(self): import tarfile @@ -160,10 +164,10 @@ MDScreen: anchor_title: "left" elevation: 0 left_action_items: - [['menu', lambda x: root.app.nav_drawer.set_state("open")]] + [['menu', lambda x: root.app.app.nav_drawer.set_state("open")]] right_action_items: [ - ['close', lambda x: root.app.close_keys_action(self)], + ['close', lambda x: root.app.app.close_keys_action(self)], ] ScrollView: From 2529a70339dbebcf3051d93600767f6d00d76758 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Mon, 13 Apr 2026 19:15:33 +0200 Subject: [PATCH 03/29] Updated makefile --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 204a51a..c012aa7 100644 --- a/Makefile +++ b/Makefile @@ -79,6 +79,7 @@ prepare_win_pkg: clean build_spkg rm build/winpkg/sbapp/buildozer.spec cp winbuild.bat build/ mv build/winpkg build/sideband_sources + chmod -R a+rw build/sideband_sources cd build; zip -r winbuild.zip sideband_sources winbuild.bat mv build/winbuild.zip dist/winbuild.zip From e798bac4c7f7f6a3f93ee5b2c8682771aef26222 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sat, 18 Apr 2026 16:37:33 +0200 Subject: [PATCH 04/29] Updated versions --- sbapp/main.py | 3 ++- setup.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sbapp/main.py b/sbapp/main.py index 8fe040b..e87c802 100644 --- a/sbapp/main.py +++ b/sbapp/main.py @@ -1,6 +1,6 @@ __debug_build__ = False __disable_shaders__ = False -__version__ = "1.9.0" +__version__ = "1.9.1" __variant__ = "" import sys @@ -483,6 +483,7 @@ else: from .ui.hardware import Hardware from .ui.objectdetails import ObjectDetails from .ui.messages import Messages, ts_format, messages_screen_kv + # from .ui.messages_recycle import Messages, ts_format, messages_screen_kv from .ui.helpers import ContentNavigationDrawer, DrawerList, IconListItem from .ui.helpers import multilingual_markup, mdc, dark_theme_text_color diff --git a/setup.py b/setup.py index d17ed01..725e6a3 100644 --- a/setup.py +++ b/setup.py @@ -114,7 +114,7 @@ setuptools.setup( ] }, install_requires=[ - "rns>=1.1.5", + "rns>=1.1.6", "lxmf>=0.9.4", "lxst>=0.4.6", "kivy>=2.3.0", From cd323c9ca841d08a19c0831c0437ebe4ea9682fd Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sun, 19 Apr 2026 01:31:04 +0200 Subject: [PATCH 05/29] Background data persist on app pause on Android --- sbapp/main.py | 2 +- sbapp/sideband/core.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/sbapp/main.py b/sbapp/main.py index e87c802..9e8be46 100644 --- a/sbapp/main.py +++ b/sbapp/main.py @@ -1063,7 +1063,7 @@ class SidebandApp(MDApp): self.sideband.setstate("app.running", True) self.sideband.setstate("app.foreground", False) self.app_state = SidebandApp.PAUSED - self.sideband.should_persist_data() + self.sideband.should_persist_data(background=True) RNS.log("App paused", RNS.LOG_DEBUG) return True diff --git a/sbapp/sideband/core.py b/sbapp/sideband/core.py index e2b978c..367ba9b 100644 --- a/sbapp/sideband/core.py +++ b/sbapp/sideband/core.py @@ -580,10 +580,8 @@ class SidebandCore(): total += entry.stat(follow_symlinks=False).st_size return total - def should_persist_data(self): - if self.reticulum != None: - self.reticulum._should_persist_data() - + def should_persist_data(self, background=False): + if self.reticulum != None: self.reticulum._should_persist_data(background=background) self.save_configuration() def __load_telemetry_collector_excluded(self): From 6f8f4351f654dd0445e25ca6c0fb59bdcc19723a Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Tue, 21 Apr 2026 10:24:07 +0200 Subject: [PATCH 06/29] Fixed message loading performance --- sbapp/main.py | 1 + sbapp/sideband/core.py | 42 +++++++++++++++++++++++++++--------------- sbapp/ui/messages.py | 3 +-- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/sbapp/main.py b/sbapp/main.py index 9e8be46..e98400b 100644 --- a/sbapp/main.py +++ b/sbapp/main.py @@ -449,6 +449,7 @@ else: from ui.objectdetails import ObjectDetails from ui.announces import Announces from ui.messages import Messages, ts_format, messages_screen_kv + # from ui.messages_recycle import Messages, ts_format, messages_screen_kv from ui.helpers import ContentNavigationDrawer, DrawerList, IconListItem from ui.helpers import multilingual_markup, mdc, dark_theme_text_color from kivymd.toast import toast diff --git a/sbapp/sideband/core.py b/sbapp/sideband/core.py index 367ba9b..0b7d4db 100644 --- a/sbapp/sideband/core.py +++ b/sbapp/sideband/core.py @@ -2999,19 +2999,32 @@ class SidebandCore(): with self.db_lock: db = self.__db_connect() dbc = db.cursor() - + + base_condition = "(dest=:context_dest or source=:context_dest)" if after != None and before == None: - query = "select * from lxm where (dest=:context_dest or source=:context_dest) and rx_ts>:after_ts" - dbc.execute(query, {"context_dest": context_dest, "after_ts": after}) + query = f"select * from lxm where {base_condition} and rx_ts>:after_ts ORDER BY rx_ts DESC" + params = {"context_dest": context_dest, "after_ts": after} + if limit is not None: + query += f" LIMIT :limit_val"; params["limit_val"] = int(limit) + dbc.execute(query, params) elif after == None and before != None: - query = "select * from lxm where (dest=:context_dest or source=:context_dest) and rx_ts<:before_ts" - dbc.execute(query, {"context_dest": context_dest, "before_ts": before}) + query = f"select * from lxm where {base_condition} and rx_ts<:before_ts ORDER BY rx_ts DESC" + params = {"context_dest": context_dest, "before_ts": before} + if limit is not None: + query += f" LIMIT :limit_val"; params["limit_val"] = int(limit) + dbc.execute(query, params) elif after != None and before != None: - query = "select * from lxm where (dest=:context_dest or source=:context_dest) and rx_ts<:before_ts and rx_ts>:after_ts" - dbc.execute(query, {"context_dest": context_dest, "before_ts": before, "after_ts": after}) + query = f"select * from lxm where {base_condition} and rx_ts<:before_ts and rx_ts>:after_ts ORDER BY rx_ts DESC" + params = {"context_dest": context_dest, "before_ts": before, "after_ts": after} + if limit is not None: + query += f" LIMIT :limit_val"; params["limit_val"] = int(limit) + dbc.execute(query, params) else: - query = "select * from lxm where dest=:context_dest or source=:context_dest" - dbc.execute(query, {"context_dest": context_dest}) + query = f"select * from lxm where {base_condition} ORDER BY rx_ts DESC" + params = {"context_dest": context_dest} + if limit is not None: + query += f" LIMIT :limit_val"; params["limit_val"] = int(limit) + dbc.execute(query, params) result = dbc.fetchall() @@ -3034,10 +3047,8 @@ class SidebandCore(): lxm.paper_packed = paper_packed_lxm extras = None - try: - extras = msgpack.unpackb(entry[11]) - except: - pass + try: extras = msgpack.unpackb(entry[11]) + except: pass message = { "hash": lxm.hash, @@ -3054,8 +3065,9 @@ class SidebandCore(): } messages.append(message) - if len(messages) > limit: - messages = messages[-limit:] + + messages.reverse() + if len(messages) > limit: messages = messages[-limit:] return messages def _db_save_lxm(self, lxm, context_dest, originator = False, own_command = False, is_retry = False): diff --git a/sbapp/ui/messages.py b/sbapp/ui/messages.py index 8c9e896..5e2026b 100644 --- a/sbapp/ui/messages.py +++ b/sbapp/ui/messages.py @@ -271,8 +271,7 @@ class Messages(): else: self.hide_widget(self.ids.message_ptt, True) c_ts = time.time() - if len(self.new_messages) > 0: - self.update_widget() + if len(self.new_messages) > 0: self.update_widget() if (len(self.added_item_hashes) < self.db_message_count) and not self.load_more_button in self.list.children: self.list.add_widget(self.load_more_button, len(self.list.children)) From 73b9bd032fdfbf829b74adf48b30e01ccabef876 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Tue, 21 Apr 2026 10:51:25 +0200 Subject: [PATCH 07/29] Updated versions --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 725e6a3..4db951e 100644 --- a/setup.py +++ b/setup.py @@ -114,8 +114,8 @@ setuptools.setup( ] }, install_requires=[ - "rns>=1.1.6", - "lxmf>=0.9.4", + "rns>=1.1.7", + "lxmf>=0.9.5", "lxst>=0.4.6", "kivy>=2.3.0", "numpy>=2.0.0", From 04908eb45b2da76b5045cfad6ca267fd23def87f Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Tue, 21 Apr 2026 19:17:14 +0200 Subject: [PATCH 08/29] Versions --- sbapp/main.py | 2 +- sbapp/sideband/core.py | 16 +++++----------- setup.py | 2 +- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/sbapp/main.py b/sbapp/main.py index e98400b..4b8871f 100644 --- a/sbapp/main.py +++ b/sbapp/main.py @@ -2872,7 +2872,7 @@ class SidebandApp(MDApp): else: self.messages_view.ids.messages_scrollview.dest_known = False if self.messages_view.ids.nokeys_text.text == "": - keys_str = "The crytographic keys for the destination address are unknown at this time. You can wait for an announce to arrive, or query the network for the necessary keys." + keys_str = "The cryptographic keys for the destination address are unknown at this time. You can wait for an announce to arrive, or query the network for the necessary keys." self.messages_view.ids.nokeys_text.text = keys_str self.widget_hide(self.messages_view.ids.message_input_part, True) self.widget_hide(self.messages_view.ids.message_ptt, True) diff --git a/sbapp/sideband/core.py b/sbapp/sideband/core.py index 0b7d4db..c0d8bbc 100644 --- a/sbapp/sideband/core.py +++ b/sbapp/sideband/core.py @@ -957,10 +957,8 @@ class SidebandCore(): def log_announce(self, dest, app_data, dest_type, stamp_cost=None, link_stats=None): try: - if app_data == None: - app_data = b"" - if type(app_data) != bytes: - app_data = msgpack.packb([app_data, stamp_cost]) + if app_data == None: app_data = b"" + if type(app_data) != bytes: app_data = msgpack.packb([app_data, stamp_cost]) RNS.log("Received "+str(dest_type)+" announce for "+RNS.prettyhexrep(dest), RNS.LOG_DEBUG) self._db_save_announce(dest, app_data, dest_type, link_stats) self.setstate("app.flags.new_announces", True) @@ -3418,14 +3416,10 @@ class SidebandCore(): def is_known(self, dest_hash): try: source_identity = RNS.Identity.recall(dest_hash) + if source_identity: return True + else: return False - if source_identity: - return True - else: - return False - - except Exception as e: - return False + except Exception as e: return False def request_key(self, dest_hash): try: diff --git a/setup.py b/setup.py index 4db951e..69e6022 100644 --- a/setup.py +++ b/setup.py @@ -114,7 +114,7 @@ setuptools.setup( ] }, install_requires=[ - "rns>=1.1.7", + "rns>=1.1.8", "lxmf>=0.9.5", "lxst>=0.4.6", "kivy>=2.3.0", From fcc0341fe95b2b5dd9e695a62bbca9895b42b935 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Wed, 22 Apr 2026 13:42:08 +0200 Subject: [PATCH 09/29] Updated versions --- sbapp/main.py | 2 +- setup.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sbapp/main.py b/sbapp/main.py index 4b8871f..c47928d 100644 --- a/sbapp/main.py +++ b/sbapp/main.py @@ -1,6 +1,6 @@ __debug_build__ = False __disable_shaders__ = False -__version__ = "1.9.1" +__version__ = "1.9.2" __variant__ = "" import sys diff --git a/setup.py b/setup.py index 69e6022..d166bf3 100644 --- a/setup.py +++ b/setup.py @@ -114,8 +114,8 @@ setuptools.setup( ] }, install_requires=[ - "rns>=1.1.8", - "lxmf>=0.9.5", + "rns>=1.1.9", + "lxmf>=0.9.6", "lxst>=0.4.6", "kivy>=2.3.0", "numpy>=2.0.0", From 39f00554a80727ae202fdff46b1d207505ed1606 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Thu, 23 Apr 2026 01:19:55 +0200 Subject: [PATCH 10/29] Improved announce logging handling --- sbapp/main.py | 2 +- sbapp/sideband/core.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sbapp/main.py b/sbapp/main.py index c47928d..f7e9032 100644 --- a/sbapp/main.py +++ b/sbapp/main.py @@ -1064,7 +1064,7 @@ class SidebandApp(MDApp): self.sideband.setstate("app.running", True) self.sideband.setstate("app.foreground", False) self.app_state = SidebandApp.PAUSED - self.sideband.should_persist_data(background=True) + self.sideband.should_persist_data(background=False) RNS.log("App paused", RNS.LOG_DEBUG) return True diff --git a/sbapp/sideband/core.py b/sbapp/sideband/core.py index c0d8bbc..5ddead3 100644 --- a/sbapp/sideband/core.py +++ b/sbapp/sideband/core.py @@ -90,10 +90,10 @@ class PropagationNodeDetector(): pass else: - RNS.log(f"Received malformed propagation node announce from {RNS.prettyhexrep(destination_hash)} with data: {app_data}", RNS.LOG_EXTREME) + RNS.log(f"Received malformed propagation node announce from {RNS.prettyhexrep(destination_hash)}", RNS.LOG_EXTREME) else: - RNS.log(f"Received malformed propagation node announce from {RNS.prettyhexrep(destination_hash)} with data: {app_data}", RNS.LOG_EXTREME) + RNS.log(f"Received malformed propagation node announce from {RNS.prettyhexrep(destination_hash)}", RNS.LOG_EXTREME) except Exception as e: RNS.log("Error while processing received propagation node announce: "+str(e)) @@ -371,8 +371,9 @@ class SidebandCore(): self.active_propagation_node = None self.propagation_detector = PropagationNodeDetector(self) - RNS.Transport.register_announce_handler(self) - RNS.Transport.register_announce_handler(self.propagation_detector) + if self.is_service or self.is_standalone: + RNS.Transport.register_announce_handler(self) + RNS.Transport.register_announce_handler(self.propagation_detector) self.active_command_plugins = {} self.active_service_plugins = {} @@ -806,8 +807,7 @@ class SidebandCore(): def __save_config(self, no_thread=False): RNS.log("Saving Sideband configuration...", RNS.LOG_DEBUG) def save_function(): - while self.saving_configuration: - time.sleep(0.15) + while self.saving_configuration: time.sleep(0.15) try: self.saving_configuration = True with open(self.config_path, "wb") as config_file: config_file.write(msgpack.packb(self.config)) @@ -826,8 +826,8 @@ class SidebandCore(): if no_thread: save_function() else: threading.Thread(target=save_function, daemon=True).start() - if self.is_client: - self.setstate("wants.settings_reload", True) + if self.is_client: self.setstate("wants.settings_reload", True) + RNS.log("Sideband configuration saved", RNS.LOG_DEBUG) def __load_plugins(self): plugins_path = self.config["command_plugins_path"] From 5705e24dde6df8db7981203daf1c68efa635c719 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Mon, 27 Apr 2026 16:19:45 +0200 Subject: [PATCH 11/29] Added basic server telemetry plugin example --- docs/example_plugins/server_telemetry.py | 119 +++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 docs/example_plugins/server_telemetry.py diff --git a/docs/example_plugins/server_telemetry.py b/docs/example_plugins/server_telemetry.py new file mode 100644 index 0000000..b6fd63f --- /dev/null +++ b/docs/example_plugins/server_telemetry.py @@ -0,0 +1,119 @@ +# This is a basic server telemetry plugin +# example that you can build upon to +# implement your own telemetry plugins. + +import RNS +import time +import psutil +import shutil +from threading import Thread +import urllib.request, json + +class ServerTelemetryPlugin(SidebandTelemetryPlugin): + plugin_name = "server_telemetry" + + def start(self): + # Do any initialisation work here + RNS.log("Server Telemetry plugin starting...") + self.initialise_values() + + self.power_stats = False + self.storage_stats = True + self.target_disk = {"blkid": "mmcblk0p2", "label": "SD Card"} + self.should_run = True + + self.update_thread = Thread(target=self.update_job, daemon=True) + self.update_thread.start() + + # And finally call start on superclass + super().start() + + def stop(self): + # Do any teardown work here + self.should_run = False + + # And finally call stop on superclass + super().stop() + + def initialise_values(self): + self.battery_percent = None + self.power_production = None + self.power_consumption = None + self.battery_charging = None + self.battery_temperature = None + self.uptime = None + + def update_job(self): + while self.should_run: + try: + # Update uptime + self.uptime = RNS.prettytime(time.time()-psutil.boot_time()) + + # Update power values if enabled + if self.power_stats: + with urllib.request.urlopen("http://some_host/status.json") as url: + data = json.loads(url.read().decode()) + self.power_production = data["solar_yield"] + self.power_consumption = data["inverter_load"]+data["dc_consumption"] + self.battery_charging = data["battery_current"] >= 0.0 + self.battery_charge = data["battery_charge"] + self.battery_temperature = data["battery_temperature"] + + except Exception as e: + RNS.log("Error while updating plugin telemetry: "+str(e), RNS.LOG_ERROR) + + time.sleep(15) + + def update_telemetry(self, telemeter): + if telemeter != None: + + if self.power_stats: + # Create power consumption sensor + telemeter.synthesize("power_consumption") + telemeter.sensors["power_consumption"].update_consumer(self.power_consumption, type_label="Power consumption") + + # Create power production sensor + telemeter.synthesize("power_production") + telemeter.sensors["power_production"].update_producer(self.power_production, type_label="Solar production", custom_icon="solar-power-variant") + + # Create battery sensor + telemeter.synthesize("battery") + telemeter.sensors["battery"].data = {"charge_percent": round(self.battery_charge, 1), "charging": self.battery_charging} + + + # Create NVM sensor if enabled + if self.storage_stats: + mount_point = None + for partition in psutil.disk_partitions(all=False): + if self.target_disk["blkid"] in partition.device: + mount_point = partition.mountpoint + break + + if mount_point: + st = shutil.disk_usage(mount_point) + telemeter.synthesize("nvm") + telemeter.sensors["nvm"].update_entry(capacity=st.total, used=st.used, type_label=self.target_disk["label"]) + + # Create RAM sensors + ms = psutil.virtual_memory() + telemeter.synthesize("ram") + telemeter.sensors["ram"].update_entry(capacity=ms.total, used=ms.used, type_label="RAM") + + # Create CPU sensor + a = psutil.getloadavg() + cps = 0; cpms = 5 + for m in range(cpms): + cps += psutil.cpu_percent()/100.0 + time.sleep(0.05) + cp = cps/cpms + + telemeter.synthesize("processor") + telemeter.sensors["processor"].update_entry(current_load=cp, clock=round(psutil.cpu_freq().current*1e6, 0), load_avgs=[a[0], a[1], a[2]], type_label="CPU") + + # Create custom sensor for uptime + telemeter.synthesize("custom") + telemeter.sensors["custom"].update_entry(self.uptime, type_label="Uptime is", custom_icon="timer-refresh-outline") + +# Finally, tell Sideband what class in this +# file is the actual plugin class. +plugin_class = ServerTelemetryPlugin \ No newline at end of file From 9f0d776e3fded4fd9200f8cb419364d5b39a2d84 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Mon, 27 Apr 2026 16:19:55 +0200 Subject: [PATCH 12/29] Added basic Raspberry Pi telemetry plugin example --- docs/example_plugins/raspi_telemetry.py | 152 ++++++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 docs/example_plugins/raspi_telemetry.py diff --git a/docs/example_plugins/raspi_telemetry.py b/docs/example_plugins/raspi_telemetry.py new file mode 100644 index 0000000..f32f260 --- /dev/null +++ b/docs/example_plugins/raspi_telemetry.py @@ -0,0 +1,152 @@ +# This is a basic Raspberry Pi telemetry plugin +# example that you can build upon to +# implement your own telemetry plugins. + +import os +import RNS +import time +import psutil +import shutil +from threading import Thread +import urllib.request, json + +class RasPiTelemetryPlugin(SidebandTelemetryPlugin): + plugin_name = "raspi_telemetry" + + def start(self): + # Do any initialisation work here + RNS.log("Raspberry Pi Telemetry plugin starting...") + self.initialise_values() + + self.power_stats = False + self.storage_stats = True + self.target_disk = {"blkid": "mmcblk0p2", "label": "SD Card"} + self.should_run = True + + self.update_thread = Thread(target=self.update_job, daemon=True) + self.update_thread.start() + + # And finally call start on superclass + super().start() + + def stop(self): + # Do any teardown work here + self.should_run = False + + # And finally call stop on superclass + super().stop() + + def initialise_values(self): + self.battery_percent = None + self.power_production = None + self.power_consumption = None + self.battery_charging = None + self.battery_temperature = None + self.uptime = None + + def update_job(self): + while self.should_run: + try: + # Update uptime + self.uptime = RNS.prettytime(time.time()-psutil.boot_time()) + + # Update power values if enabled + if self.power_stats: + with urllib.request.urlopen("http://some_host/status.json") as url: + data = json.loads(url.read().decode()) + self.power_production = data["solar_yield"] + self.power_consumption = data["inverter_load"]+data["dc_consumption"] + self.battery_charging = data["battery_current"] >= 0.0 + self.battery_charge = data["battery_charge"] + self.battery_temperature = data["battery_temperature"] + + except Exception as e: + RNS.log("Error while updating plugin telemetry: "+str(e), RNS.LOG_ERROR) + + time.sleep(15) + + def update_telemetry(self, telemeter): + if telemeter != None: + + if self.power_stats: + # Create power consumption sensor + telemeter.synthesize("power_consumption") + telemeter.sensors["power_consumption"].update_consumer(self.power_consumption, type_label="Power consumption") + + # Create power production sensor + telemeter.synthesize("power_production") + telemeter.sensors["power_production"].update_producer(self.power_production, type_label="Solar production", custom_icon="solar-power-variant") + + # Create battery sensor + telemeter.synthesize("battery") + telemeter.sensors["battery"].data = {"charge_percent": round(self.battery_charge, 1), "charging": self.battery_charging} + + + # Create NVM sensor if enabled + if self.storage_stats: + mount_point = None + for partition in psutil.disk_partitions(all=False): + if self.target_disk["blkid"] in partition.device: + mount_point = partition.mountpoint + break + + if mount_point: + st = shutil.disk_usage(mount_point) + telemeter.synthesize("nvm") + telemeter.sensors["nvm"].update_entry(capacity=st.total, used=st.used, type_label=self.target_disk["label"]) + + # Create RAM sensors + ms = psutil.virtual_memory() + telemeter.synthesize("ram") + telemeter.sensors["ram"].update_entry(capacity=ms.total, used=ms.used, type_label="RAM") + + # Create CPU sensor + a = psutil.getloadavg() + cps = 0; cpms = 5 + for m in range(cpms): + cps += psutil.cpu_percent()/100.0 + time.sleep(0.05) + cp = cps/cpms + + telemeter.synthesize("processor") + telemeter.sensors["processor"].update_entry(current_load=cp, clock=round(psutil.cpu_freq().current*1e6, 0), load_avgs=[a[0], a[1], a[2]], type_label="CPU") + + # Create custom sensor for uptime + telemeter.synthesize("custom") + telemeter.sensors["custom"].update_entry(self.uptime, type_label="Uptime is", custom_icon="timer-refresh-outline") + + # Read temperature using built-in sensor + try: + cpu_temp_path = '/sys/class/thermal/thermal_zone0/temp' + with open(cpu_temp_path) as f: temp = int(f.read().strip()) / 1000.0 + + telemeter.synthesize("temperature") + telemeter.sensors["temperature"].data = {"c": round(temp, 2)} + + except Exception as e: RNS.log(f"Getting temperature reading failed: {e}", RNS.LOG_ERROR) + + # Network Interfaces + try: + for iface in os.listdir('/sys/class/net'): + carrier = None + speed = None + + try: + with open(f'/sys/class/net/{iface}/carrier') as f: carrier = int(f.read().strip()) == 1 + except FileNotFoundError: pass + + if iface.startswith('eth') or iface.startswith('wlan'): + try: + with open(f'/sys/class/net/{iface}/speed') as f: speed = int(f.read().strip()) + except (FileNotFoundError, ValueError): pass + + telemeter.synthesize("custom") + speed_str = f" at {RNS.prettyspeed(speed*1e6)}" if speed else "" + sensors_str = f"carrier{speed_str}" if carrier else "has no carrier" + telemeter.sensors["custom"].update_entry(value=f"{sensors_str}", type_label=f"{iface}", custom_icon="lan" if carrier else "lan-disconnect") + + except Exception as e: RNS.log(f"Getting network stats failed: {e}", RNS.LOG_DEBUG) + +# Finally, tell Sideband what class in this +# file is the actual plugin class. +plugin_class = RasPiTelemetryPlugin From cba08b6999928bc6446ddfc10cf7ebaec99fae0a Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Mon, 27 Apr 2026 16:20:08 +0200 Subject: [PATCH 13/29] Cleanup --- sbapp/sideband/core.py | 33 ++++++++++----------------------- setup.py | 2 +- 2 files changed, 11 insertions(+), 24 deletions(-) diff --git a/sbapp/sideband/core.py b/sbapp/sideband/core.py index 5ddead3..baef83b 100644 --- a/sbapp/sideband/core.py +++ b/sbapp/sideband/core.py @@ -3279,42 +3279,31 @@ class SidebandCore(): def update_telemetry(self): try: - try: - latest_telemetry = deepcopy(self.latest_telemetry) - except: - latest_telemetry = None + try: latest_telemetry = deepcopy(self.latest_telemetry) + except: latest_telemetry = None telemetry = self.get_telemetry() packed_telemetry = self.get_packed_telemetry() telemetry_changed = False if telemetry != None and packed_telemetry != None: - if latest_telemetry == None or len(telemetry) != len(latest_telemetry): - telemetry_changed = True + if latest_telemetry == None or len(telemetry) != len(latest_telemetry): telemetry_changed = True if latest_telemetry != None: - if not telemetry_changed: for sn in telemetry: - if telemetry_changed: - break + if telemetry_changed: break if sn != "time": if sn in latest_telemetry: - if telemetry[sn] != latest_telemetry[sn]: - telemetry_changed = True - else: - telemetry_changed = True + if telemetry[sn] != latest_telemetry[sn]: telemetry_changed = True + else: telemetry_changed = True if not telemetry_changed: for sn in latest_telemetry: - - if telemetry_changed: - break - + if telemetry_changed: break if sn != "time": - if not sn in telemetry: - telemetry_changed = True + if not sn in telemetry: telemetry_changed = True if telemetry_changed: self.telemetry_changes += 1 @@ -3323,10 +3312,8 @@ class SidebandCore(): self.setstate("app.flags.last_telemetry", time.time()) if self.is_client: - try: - self.service_set_latest_telemetry(self.latest_telemetry, self.latest_packed_telemetry) - except Exception as e: - RNS.log("Error while sending latest telemetry to service: "+str(e), RNS.LOG_ERROR) + try: self.service_set_latest_telemetry(self.latest_telemetry, self.latest_packed_telemetry) + except Exception as e: RNS.log("Error while sending latest telemetry to service: "+str(e), RNS.LOG_ERROR) except Exception as e: import traceback diff --git a/setup.py b/setup.py index d166bf3..cd8e2e8 100644 --- a/setup.py +++ b/setup.py @@ -114,7 +114,7 @@ setuptools.setup( ] }, install_requires=[ - "rns>=1.1.9", + "rns>=1.2.0", "lxmf>=0.9.6", "lxst>=0.4.6", "kivy>=2.3.0", From cae7152070ac6001596b13b36b6ff428b0dac45d Mon Sep 17 00:00:00 2001 From: markqvist Date: Fri, 29 May 2026 11:04:33 +0200 Subject: [PATCH 14/29] Added release manifest --- sideband_1.9.5.rsm | Bin 0 -> 1455 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 sideband_1.9.5.rsm diff --git a/sideband_1.9.5.rsm b/sideband_1.9.5.rsm new file mode 100644 index 0000000000000000000000000000000000000000..373843f2a3f8286f40b62a4cb695c370793e9969 GIT binary patch literal 1455 zcmdPf^ZMEaks}kf*CsCCcDsB2;-=!O5?6bSx30PSY%a^HTWLo$8$54lwfvZ0%Bi3jXt1x z_Q~b17q>M8PP=lBC(B{4ckSfN|G6#c%F^4GQ?)nYpROC5gEO=dvV2d6wlD zWu|B59T6z=T*}*$$YgZUG28J{XV(8E1&JjYn~G9PGLuVlN^|vLb}dWJ&&|y&xv62C zXk=t)lxC4^WMOEOlxAU+Y+z|_l4N3RWN2Vyk!qT1kd&5el$yLUv8W_7Eit*Icybfi z*?WqU5(^4+!EV(ps5I8i%g;;IP0Xv*E6>PTTvVKX&A2-$akJy4^r)ofgnxDSH5Tov3OQ!VjVn~%1yokp<@nnFUVrGw+#9_% ziHm>TRo-Km@$hl^iNJsZ$a*@PM@dWi+ukkB}x&hy~HhaVdqn=g8lZFEc!uT(jp zGV@K(yoe-;sTEH}Hq3vlCHZ8@VFTH78ogIU8hH=gwtRUdDOqc(?b;Jl&++044W>6u zKfC>4Ld3;)gzKA6zTF*yY9mg~oDVt}RYXPd#!uBqOs}AvZBI zuOu}uF)uk)0h-?xGV_viN>fsc6-qKv6><_wfZ1FDS~3(X Date: Mon, 1 Jun 2026 14:38:40 +0200 Subject: [PATCH 15/29] Added manifest --- sideband_1.9.6.rsm | Bin 0 -> 1611 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 sideband_1.9.6.rsm diff --git a/sideband_1.9.6.rsm b/sideband_1.9.6.rsm new file mode 100644 index 0000000000000000000000000000000000000000..440a7249d050a1f5f1b09acca558b59e7d8c7aa2 GIT binary patch literal 1611 zcmc(feNa?Y7{;q{l2#NUb)2E5Lm=tmF8jgm0#UK?F+(~{1`Ze*oW1w#-oxI#cf05A zF3Xn<9|Q=OpIYen1tJ8<*KMOVFr>PM5GpjCQi(D0d1yc=)cC9bN)DI z-t(Mie$Tw`G?lmFqWAu$s*s|-v1cbgztI1C{jDw;+c32%=E&*RZ&GsnD9LL2Gc@y_ zA65rG&No{4_-b3vxjnCL56N?HT2kJ|K*ES_JMs_)YIOSM*|Qfkc4mEcdBiuRiS<`} zXEKJ2-zt$ccp`J(NGR`oeoMuPW*ZV=wTEB}hXn8PUSZefsIivU^(!B3ScF!+=&?IY zR^;|3CS5)gxTdBkb#2^Z;d{#RLk=FUtjMVvt@*klE3>`pr{}g#T*~fS=ev0N`at(9 zo9fOS56nwEw4t~b`)%cx@X+pN4%$!~!89^Kj&5}#fnc6%Q7hw=`ZfWv2ogje(5N(e zg-TlL47Da+tBcpgz0fXV8zLgK*^lQvT-52|1#H2bceyjIWobFQPcvY&8c$W_`J3%f zWV!?-V#>ifY|(fA@=(0ZhQ*<^Dzye_O_U0$4dxg_tk!_kNJVK4P!*>^YMs`sL9qsH zOl&(8L~MqXNNP*xZ1)lqwA&SPUKMt?R>AQcQb5kFbTRB+fmpoPdc&A=OOfvF(p~S$ z4j0H38K2gi{YpQv?*m2U*vE-i%El|#Y#i1k3~w9HY~TN2N6&6UP|(zkWR)-hXDFX2 zD_bDGcdn(4QV{`1oBBEzX9cZ$y0Pv0WH4}kAFd3Z+2D>jFc)9h{~zDKLYU{$lYTqS zoH;Z(nV6$_7f}{q`#hC^_^?Ht9j_H0CI0E0q4aIb&i*!jQTwxc>R8cRf!~gf{PD|J zfo^|wIIC}WTF+;{|48xR;1?Z7hJCBk$rYw)$wE~4L;aCAUP|9`ss6nY>dBkMz_la! z;3q3e0%}U4W~h_L?kbh8e^OCGyLFz%fGJ_;)xz4~^7G#Al~)J*ce;vBOz&0J-;DaO z@qv#rdWRNIv#wLovAT#Fd3ID?RI@eG|5VV%AGiBT-wX?lT(%GmU)?jIE%sk`Cp=LR zG}4_EaI$cEU(x!mh{=)lDGyzsx85Zhty0$#XhC1z%VjW_fZI(DD4r7`<_Lfsz&1NC zh>#P38Rr8tFMwR5L*&yq5eZTUqFg|DX+X^m0APlg#he9*yd Date: Tue, 9 Jun 2026 22:52:21 +0200 Subject: [PATCH 16/29] Update README.md --- README.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4e7648b..3b5cd95 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,31 @@ This also means that Sideband is designed to be fully compatible with custom (an ## On Linux -On all Linux-based operating systems, Sideband is available as a `pip`/`pipx` package. You can either pull and install Sideband directly from the `pip` repository, or download and install locally using `whl` package from the [latest release page](https://github.com/markqvist/Sideband/releases/latest). +On most Linux-based operating systems, you can simply download the pre-compiled AppImage from the [latest release page](https://github.com/markqvist/Sideband/releases/latest) and run it. + +Depending on your Linux distribution, you may need to install a few other packages for full voice call, audio messaging and clipboard functionality. Make sure you have `opusfile`, and a clipboard manager like `xclip` or `wl-clipboard` installed: + +```bash +# For Debian 13+, Ubuntu 24.04+ and derivatives +sudo apt install libopusfile0 xclip xsel + +# For Debian 12+, Ubuntu 22.04+ and derivatives +sudo apt install libopusfile0 xclip xsel + +# For Manjaro and derivatives +pamac install opusfile xclip xsel + +# For Arch and derivatives +sudo pacman -Sy opusfile xclip xsel + +# Clipboard support on Wayland: If the clipboard is not +# working correctly on Wayland with xclip and xsel, you +# can install wl-clipboard and wl-clipboard-x11 instead. +pamac remove xclip xsel +pamac install wl-clipboard wl-clipboard-x11 +``` + +You can also install Sideband as a `pip`/`pipx` package. You can either pull and install Sideband directly from the `pip` repository, or download and install locally using `whl` package from the [latest release page](https://github.com/markqvist/Sideband/releases/latest). This installation method **includes desktop integration**, so that Sideband will show up in your applications menu and launchers. Below are install steps for the most common recent Linux distros. For Debian 11, see the end of this section. From d1b108035a263c8ae46eeb1c36d0ced155b365e0 Mon Sep 17 00:00:00 2001 From: markqvist Date: Wed, 10 Jun 2026 20:21:59 +0200 Subject: [PATCH 17/29] Update README.md --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 3b5cd95..15cd0e1 100644 --- a/README.md +++ b/README.md @@ -69,9 +69,6 @@ On most Linux-based operating systems, you can simply download the pre-compiled Depending on your Linux distribution, you may need to install a few other packages for full voice call, audio messaging and clipboard functionality. Make sure you have `opusfile`, and a clipboard manager like `xclip` or `wl-clipboard` installed: ```bash -# For Debian 13+, Ubuntu 24.04+ and derivatives -sudo apt install libopusfile0 xclip xsel - # For Debian 12+, Ubuntu 22.04+ and derivatives sudo apt install libopusfile0 xclip xsel From 863b925011473e7e906ef7c93ed14dc8d8f76d70 Mon Sep 17 00:00:00 2001 From: markqvist Date: Wed, 10 Jun 2026 20:27:23 +0200 Subject: [PATCH 18/29] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 15cd0e1..ef9599a 100644 --- a/README.md +++ b/README.md @@ -181,7 +181,9 @@ python3 -m sbapp.main ## On Raspberry Pi -You can install Sideband on all Raspberry Pi models that support 64-bit operating systems, and can run at least Python version 3.11. +The easiest way to install Sideband on Raspberry Pi is to simply download and run the `aarch64` AppImage. On some versions of Raspberry Pi OS, you may also need to install additional libraries for full voice and clipboard functionality with `sudo apt install libopusfile0 xclip xsel`. + +You can also install Sideband using `pip` on all Raspberry Pi models that support 64-bit operating systems, and can run at least Python version 3.11. The install instructions below assume that you are installing Sideband on 64-bit Raspberry Pi OS (based on Debian 13 "Trixie" or later). If you're running something else on your Pi, you might need to modify some commands slightly. From 8601d84580341f2c499041615d772610edb9eaab Mon Sep 17 00:00:00 2001 From: markqvist Date: Fri, 3 Jul 2026 13:51:23 +0200 Subject: [PATCH 19/29] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ef9599a..780531b 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ This also means that Sideband is designed to be fully compatible with custom (an On most Linux-based operating systems, you can simply download the pre-compiled AppImage from the [latest release page](https://github.com/markqvist/Sideband/releases/latest) and run it. -Depending on your Linux distribution, you may need to install a few other packages for full voice call, audio messaging and clipboard functionality. Make sure you have `opusfile`, and a clipboard manager like `xclip` or `wl-clipboard` installed: +Depending on your Linux distribution, you *may* need to install a few other packages for full voice call, audio messaging and clipboard functionality. If any of those features do not work, make sure you have `opusfile`, and a clipboard manager like `xclip` or `wl-clipboard` installed: ```bash # For Debian 12+, Ubuntu 22.04+ and derivatives @@ -181,7 +181,7 @@ python3 -m sbapp.main ## On Raspberry Pi -The easiest way to install Sideband on Raspberry Pi is to simply download and run the `aarch64` AppImage. On some versions of Raspberry Pi OS, you may also need to install additional libraries for full voice and clipboard functionality with `sudo apt install libopusfile0 xclip xsel`. +The easiest way to install Sideband on Raspberry Pi is to simply download and run the `aarch64` AppImage. On some versions of Raspberry Pi OS, you *may* also need to install additional libraries for full voice and clipboard functionality with `sudo apt install libopusfile0 xclip xsel`. You can also install Sideband using `pip` on all Raspberry Pi models that support 64-bit operating systems, and can run at least Python version 3.11. From fa55fb9fae77b49cdf8f69c8388436533873d7c3 Mon Sep 17 00:00:00 2001 From: markqvist Date: Tue, 21 Jul 2026 23:27:34 +0200 Subject: [PATCH 20/29] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 780531b..0ebf24e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Sideband ========= -*This repository is [a public mirror](./MIRROR.md). All development is happening elsewhere.* +*This repository is [a public mirror](./MIRROR.md). All development is happening elsewhere. While new releases are posted here, the latest source code is only available over Reticulum.* To understand the foundational philosophy and goals of this system, read the [Zen of Reticulum](Zen%20of%20Reticulum.md). From 5c2fad812614a024c01ef31d0729cf90f6633ee7 Mon Sep 17 00:00:00 2001 From: markqvist Date: Tue, 21 Jul 2026 23:27:53 +0200 Subject: [PATCH 21/29] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0ebf24e..a4cfca0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ Sideband ========= -*This repository is [a public mirror](./MIRROR.md). All development is happening elsewhere. While new releases are posted here, the latest source code is only available over Reticulum.* +*This repository is [a public mirror](./MIRROR.md). All development is happening elsewhere.* +*While new releases are posted here, the latest source code is only available over Reticulum.* To understand the foundational philosophy and goals of this system, read the [Zen of Reticulum](Zen%20of%20Reticulum.md). From 1dd47f53cc41e1d6d6def0291f7db2a84902fe04 Mon Sep 17 00:00:00 2001 From: markqvist Date: Tue, 21 Jul 2026 23:28:15 +0200 Subject: [PATCH 22/29] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index a4cfca0..1af833f 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ Sideband ========= -*This repository is [a public mirror](./MIRROR.md). All development is happening elsewhere.* -*While new releases are posted here, the latest source code is only available over Reticulum.* +*This repository is [a public mirror](./MIRROR.md). All development is happening elsewhere. While new releases are posted here, the latest source code is only available over Reticulum itself.* To understand the foundational philosophy and goals of this system, read the [Zen of Reticulum](Zen%20of%20Reticulum.md). From 7db7c067d50b0de05e3bcda7a05f409f11dd155c Mon Sep 17 00:00:00 2001 From: markqvist Date: Sat, 26 Sep 2026 22:04:36 +0200 Subject: [PATCH 25/29] Update README.md --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1af833f..18aba11 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,24 @@ Sideband ========= -*This repository is [a public mirror](./MIRROR.md). All development is happening elsewhere. While new releases are posted here, the latest source code is only available over Reticulum itself.* +> [!WARNING] +> Several hastily launched, incorrect, and in most cases entirely LLM-generated fakes of Sideband and associated tools are currently being circulated and marketed. Most of these "projects" violate the license that Sideband was published under, but claim independent ownership and license grants. +> +> Such claims or grants are **not legally valid**, and **not** recognized by the Sideband author and copyright holder. +> +> Any claimed assertion of copyright or grant of license that such projects are making are [void grants](https://reticulum.network/manual/brandolinis.html#void-grants-legal-foundations-of-machine-generated-code). +> +> Both the violators themselves, and **all** downstream projects using the infringing derivatives, are **directly** and **personally** liable for the legal consequences. +> +> For more detailed information, see the relevant sections of the [Brandolini's Reference](https://reticulum.network/manual/brandolinis.html) chapter of the Reticulum Manual. For software and projects recognized by the Reticulum community, see the [Programs Using Reticulum](https://reticulum.network/manual/software.html) chapter. +> +> Do **not** use these "projects", they are a hazard to the entire ecosystem we have been carefully building over the last ten years. + +*Due to the blatant copyright infringement, LLM-laundering and disrespect for open-source developers, the source code in this repository is no longer updated. All development is happening over Reticulum, where the latest source is always available.* + +*Packages and updates continue to ship on PyPI and over `rngit`. Compiled APKs, AppImages, wheels and portable exe bundles will continue to be published here as well.* + +--- To understand the foundational philosophy and goals of this system, read the [Zen of Reticulum](Zen%20of%20Reticulum.md). From ccf1b082080f175324c63581579083ac81362297 Mon Sep 17 00:00:00 2001 From: markqvist Date: Sun, 27 Sep 2026 11:32:57 +0200 Subject: [PATCH 26/29] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 18aba11..d9ff57c 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,8 @@ Sideband