mirror of
https://github.com/markqvist/Sideband.git
synced 2026-12-01 20:36:29 -05:00
Compare commits
59 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d7670cbd1 | ||
|
|
ef572b58e8 | ||
|
|
ccf1b08208 | ||
|
|
7db7c067d5 | ||
|
|
1402bb6a49 | ||
|
|
2000d81a44 | ||
|
|
1dd47f53cc | ||
|
|
5c2fad8126 | ||
|
|
fa55fb9fae | ||
|
|
8601d84580 | ||
|
|
863b925011 | ||
|
|
d1b108035a | ||
|
|
89a0c70635 | ||
|
|
f26a10f0ef | ||
|
|
cae7152070 | ||
|
|
cba08b6999 | ||
|
|
9f0d776e3f | ||
|
|
5705e24dde | ||
|
|
39f00554a8 | ||
|
|
fcc0341fe9 | ||
|
|
04908eb45b | ||
|
|
73b9bd032f | ||
|
|
6f8f4351f6 | ||
|
|
cd323c9ca8 | ||
|
|
e798bac4c7 | ||
|
|
2529a70339 | ||
|
|
75373f3aa0 | ||
|
|
73b0f6d4b2 | ||
|
|
aa05ee20d1 | ||
|
|
3a658198ac | ||
|
|
41e9b17940 | ||
|
|
1fe28ae702 | ||
|
|
606272571a | ||
|
|
b40e83b9b6 | ||
|
|
bd747cadce | ||
|
|
2aec5c0be7 | ||
|
|
aead89262f | ||
|
|
51c58efb75 | ||
|
|
5c37c5f147 | ||
|
|
1cf0b567fa | ||
|
|
6053063720 | ||
|
|
e7bef4d1fc | ||
|
|
4e2e0a53e0 | ||
|
|
75f927d340 | ||
|
|
72d70259a2 | ||
|
|
ead24279eb | ||
|
|
bac1d59c5d | ||
|
|
800616b542 | ||
|
|
63d0e41791 | ||
|
|
b8d0e79c96 | ||
|
|
7786d2a8f1 | ||
|
|
7ddea1e175 | ||
|
|
2e8a17854e | ||
|
|
199d9f9bdf | ||
|
|
d4cf40c72f | ||
|
|
b12dda51b8 | ||
|
|
da834b7539 | ||
|
|
61609de690 | ||
|
|
30c474bade |
21 changed files with 3288 additions and 2309 deletions
|
|
@ -1,31 +1,67 @@
|
||||||
# Contribution Guidelines
|
# Contributing to Reticulum
|
||||||
|
|
||||||
Welcome, and thank you for your interest in contributing to this project!
|
Welcome, and thank you for your interest in contributing to Reticulum!
|
||||||
|
|
||||||
Apart from writing code, there are many ways in which you can contribute. Before interacting with this community, read these short and simple guidelines.
|
Before interacting with this community, read these short and simple guidelines.
|
||||||
|
|
||||||
|
If you didn't shit your pants after reading this document, you may well find that we are all really quite cuddly and nice to be around. Mostly.
|
||||||
|
|
||||||
## Expected Conduct
|
## Expected Conduct
|
||||||
|
|
||||||
First and foremost, there is one simple requirement for taking part in this community: While we primarily interact virtually, your actions matter and have real consequences. Therefore: **Act like a responsible, civilized person** - also in the face of disputes and heated disagreements. Speak your mind here, discussions are welcome. Just do so in the spirit of being face-to-face with everyone else. Thank you.
|
First and foremost, there is one simple requirement for taking part in the development of this technology: While we primarily interact virtually, your actions matter and have real consequences. Therefore: **Act like a responsible, civilized person** - especially in the face of disputes and heated disagreements. Speak your mind here; discussions are welcome. Just do so in the spirit of being face-to-face with everyone else. Thank you.
|
||||||
|
|
||||||
## Asking Questions
|
In order to keep the discourse navigable and useful, the following types of posts and inquiries will be deleted and ignored:
|
||||||
|
|
||||||
If you want to ask a question, **do not open an issue**. The issue tracker is used by people *working on Sideband* to track bugs, issues and improvements.
|
- Spam.
|
||||||
|
- Questions that have already been adequately answered elsewhere. Utilize search functions.
|
||||||
|
- Low-effort posts or comments that contain no actual information or useful substance. [This is not a tea-house](./This%20Is%20Not%20a%20Teahouse.md).
|
||||||
|
- Post or comments solely containing personal opinions or beliefs without adding anything to the discussion. Facebook and X exists.
|
||||||
|
- Content that simply waste the developer's / maintainer's time with completely obvious "ideas", "insights" or "recommendations". Yes, we have *at least* 8 neurons ourselves.
|
||||||
|
- Posts that fail to understand that developing a highly complex software project with a very small amount of resources and people takes time. Imagining perfection on our behalf is useless.
|
||||||
|
|
||||||
Instead, ask away on the [discussions](https://github.com/markqvist/Reticulum/discussions) or on the [Reticulum Matrix channel](https://matrix.to/#/#reticulum:matrix.org) at `#reticulum:matrix.org`
|
If you're new to the community and start out your engagement with any of the above transgressions, you will simply be banned permanently without notice or explanation, and any further communication from you will be ignored.
|
||||||
|
|
||||||
## Providing Feedback & Ideas
|
Except for the case of real, well-grounded, clearly documented, human-written security advisories, technical investigations or bug reports, if your inquiry or communication is not attached to a Reticulum Identity, expect it to be ignored.
|
||||||
|
|
||||||
Likewise, feedback, ideas and feature requests are a very welcome way to contribute, and should also be posted on the [discussions](https://github.com/markqvist/Reticulum/discussions), or on the [Reticulum Matrix channel](https://matrix.to/#/#reticulum:matrix.org) at `#reticulum:matrix.org`.
|
If you find this "harsh", "unfair" or "unwelcoming", go somewhere else. This is not social club, but a work environment for the people contributing to the project.
|
||||||
|
|
||||||
Please do not post feature requests or general ideas on the issue tracker, or in direct messages to the primary developers. You are much more likely to get a response and start a constructive discussion by posting your ideas in the public channels created for these purposes.
|
## Reporting Bugs
|
||||||
|
|
||||||
## Reporting Issues
|
If you have found a bug or issue in this project, please report it to the maintainer over LXMF, or if strictly not possible, over email. Detailed and serious bug reports can also be posted in the various on-network forums and RRC channels that the developers frequent. Due to the realities described in [This Is Not a Teahouse](./This%20Is%20Not%20a%20Teahouse.md), there is no way to report issues or request features over the internet.
|
||||||
|
|
||||||
If you have found a bug or issue in this project, please report it using the issue tracker. If at all possible, be sure to include details on how to reproduce the bug.
|
|
||||||
|
|
||||||
Anything submitted to the issue tracker that does not follow these guidelines will be closed and removed without comments or explanation.
|
|
||||||
|
|
||||||
## Writing Code
|
## Writing Code
|
||||||
|
|
||||||
If you are interested in contributing code, fixing open issues or adding features, please coordinate the effort with the maintainer or one of the main developers first, to ensure your efforts are in alignment with the [Roadmap](./Roadmap.md) and current development focus.
|
Patches and code contributions are *generally* only welcomed from developers already known to the community, with a proven track-record of competence, skill, careful and considerate design and responsible conduct. If we do not know you yet, but you have created something that you believe lives up to such standards, we are eager to hear from you.
|
||||||
|
|
||||||
|
Current development priorities and work documents are not publicly available on the internet, but shared and coordinated directly between the developers over Reticulum itself, following the principles outlined in [Distributed Development](https://reticulum.network/manual/distributed.html).
|
||||||
|
|
||||||
|
## Commit Signing
|
||||||
|
|
||||||
|
All commits in Reticulum and related projects **must** be signed with a Reticulum identity. If you want your author credentials to be included directly in the commit log, ensure that you have [configured commit signing](https://reticulum.network/manual/git.html#commit-signing). Bare patches submitted manually or fetched remote commits without signatures are still very welcome, but we will review, squash merge and sign with the key of the maintainer that approved the changes. Attribution will be provided in the commit message instead (unless you wish to remain anonymous).
|
||||||
|
|
||||||
|
## Machine Assistance & LLMs
|
||||||
|
|
||||||
|
For a highly complex, critical piece of cryptographically based networking infrastructure, we should not need to state the following, but alas, experience has proven otherwise. Therefore:
|
||||||
|
|
||||||
|
**Including material generated using LLMs or other "AI" programs in Reticulum is, almost without exception, prohibited.**
|
||||||
|
|
||||||
|
Before even *thinking* about using a generative software system to "create" something for Reticulum, read [Brandolini's Reference](https://reticulum.network/manual/brandolinis.html), in full. If you do not have the capacity for that, you have failed the first requirement for contributing: Basic literacy.
|
||||||
|
|
||||||
|
*If* you are not already a known contributor with a proven record of being able to responsibly handle these tools, a **full** audit trail of all ML-utilizing workflows, including prompts, LLM reasoning traces, tool calls and outputs (that is, the *entire*, unaltered session log) will need to be provided with any proposed contribution. Without that, we will not even *consider* looking at it.
|
||||||
|
|
||||||
|
This applies to all Reticulum-related projects and documentation, as well as all submitted issues, reports and discussion, **except** of course in cases where language translation, speech recogntion, or other assistive technologies are required.
|
||||||
|
|
||||||
|
In **all** circumstances, clear disclosure is **mandatory**. Any piece of material, file, code snippet, method, function or similar that was generated with machine assistance must be prepended with a disclosure header or comment that states the framework, exact model used and reviewer, such as:
|
||||||
|
|
||||||
|
```python
|
||||||
|
# Generated with lc/deepseek_v4_flash_q8_k_xl
|
||||||
|
# Reviewed and corrected by Mark Qvist
|
||||||
|
```
|
||||||
|
|
||||||
|
Additionally, any explanatory comments or doc-strings generated by software must be manually re-written in clear, concise language by the reviewer stated in the disclosure header.
|
||||||
|
|
||||||
|
## Contributor License Agreement
|
||||||
|
|
||||||
|
By contributing code to this project, you agree that copyright for the code is transferred to the Reticulum maintainers and that the code is irrevocably placed under the [Reticulum License](./LICENSE).
|
||||||
|
|
||||||
|
For a more in-depth elaboration on the current CLA position, see [this post](https://rns.recipes/forum/general/brandolinis-reference-or-alternatively-agentsmd?page=1#post-3002).
|
||||||
|
|
|
||||||
33
MIRROR.md
Normal file
33
MIRROR.md
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
This repository is a public mirror. All potential future development is happening elsewhere.
|
||||||
|
|
||||||
|
I am stepping back from all public-facing interaction with this project. Reticulum has always been primarily my work, and continuing in the current public, internet-facing model is no longer sustainable.
|
||||||
|
|
||||||
|
The software remains available for use as-is. Occasional updates may appear at unpredictable intervals, but there will be no support, no responses to issues, no discussions, and no community management in this or any other public venue. If it doesn't work for you, it doesn't work. That is the entire extent of available troubleshooting assistance I can offer you.
|
||||||
|
|
||||||
|
If you've followed this project for a while, you already know what this means. You know who designed, wrote and tested this, and you know how many years of my life it took. You'll also know about both my particular challenges and strengths, and how I believe anything worth building needs to be built and maintained with our own hands.
|
||||||
|
|
||||||
|
Seven months ago, I said I needed to step back, that I was exhausted, and that I needed to recover. I believed a public resolve would be enough to effectuate that, but while striving to get just a few more useful features and protocols out, the unproductive requests and demands also ramped up, and I got pulled back into the same patterns and draining interactions that I'd explicitly said I couldn't sustain anymore.
|
||||||
|
|
||||||
|
So here's what you might have already guessed: I'm done playing the game by rules I can't win at.
|
||||||
|
|
||||||
|
Everything you need is right here, and by any sensible measure, it's done. Anyone who wants to invest the time, skill and persistence can build on it, or completely re-imagine it with different priorities. That was always the point.
|
||||||
|
|
||||||
|
The people who actually contributed - you know who you are, and you know I mean it when I say: Thank you. All of you who've used this to build something real - that was the goal, and you did it without needing me to hold your hand.
|
||||||
|
|
||||||
|
The rest of you: You have what you need. Use it or don't. I am not going to be the person who explains it to you anymore.
|
||||||
|
|
||||||
|
This is not a temporary break. It's not "see you after some rest", but a recognition that the current model is fundamentally incompatible with my life, my health, and my reality.
|
||||||
|
|
||||||
|
If you want to support continued work, you can do so at the donation links listed in this repository. But please understand, that this is not purchasing support or guaranteeing updates. It is support for work that happens on my timeline, according to my capacity, which at the moment is not what it was.
|
||||||
|
|
||||||
|
If you want Reticulum to continue evolving, you have the power to make that happen. The protocol is public domain. The code is open source. Everything you need is right here. I've provided the tools, but building what comes next is not my responsibility anymore. It's yours.
|
||||||
|
|
||||||
|
To the small group of people who has actually been here, and understood what this work was and what it cost - you already know where to find me if it actually matters.
|
||||||
|
|
||||||
|
To everyone else: This is where we part ways. No hard feelings. It's just time.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
असतो मा सद्गमय
|
||||||
|
तमसो मा ज्योतिर्गमय
|
||||||
|
मृत्योर्मा अमृतं गमय
|
||||||
1
Makefile
1
Makefile
|
|
@ -79,6 +79,7 @@ prepare_win_pkg: clean build_spkg
|
||||||
rm build/winpkg/sbapp/buildozer.spec
|
rm build/winpkg/sbapp/buildozer.spec
|
||||||
cp winbuild.bat build/
|
cp winbuild.bat build/
|
||||||
mv build/winpkg build/sideband_sources
|
mv build/winpkg build/sideband_sources
|
||||||
|
chmod -R a+rw build/sideband_sources
|
||||||
cd build; zip -r winbuild.zip sideband_sources winbuild.bat
|
cd build; zip -r winbuild.zip sideband_sources winbuild.bat
|
||||||
mv build/winbuild.zip dist/winbuild.zip
|
mv build/winbuild.zip dist/winbuild.zip
|
||||||
|
|
||||||
|
|
|
||||||
57
README.md
57
README.md
|
|
@ -1,6 +1,29 @@
|
||||||
Sideband <img align="right" src="https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg"/>
|
Sideband <img align="right" src="https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg"/>
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
> [!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).
|
||||||
|
|
||||||
|
For an Android-specific quickstart guide for new users, see the community-provided [Sideband Quick-start by RNS Moscow](https://docs.rns.moscow/sideband-quickstart/).
|
||||||
|
|
||||||
Sideband is an extensible LXMF messaging and LXST telephony client, situational awareness tracker and remote control and monitoring system for Android, Linux, macOS and Windows. It allows you to communicate with other people or LXMF-compatible systems over Reticulum networks using LoRa, Packet Radio, WiFi, I2P, Encrypted QR Paper Messages, or anything else Reticulum supports.
|
Sideband is an extensible LXMF messaging and LXST telephony client, situational awareness tracker and remote control and monitoring system for Android, Linux, macOS and Windows. It allows you to communicate with other people or LXMF-compatible systems over Reticulum networks using LoRa, Packet Radio, WiFi, I2P, Encrypted QR Paper Messages, or anything else Reticulum supports.
|
||||||
|
|
||||||

|

|
||||||
|
|
@ -26,7 +49,7 @@ Sideband provides many useful and interesting functions, such as:
|
||||||
- Remote **telemetry querying**, with strong, secure and cryptographically robust authentication and control.
|
- 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.
|
- **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
|
# Installation
|
||||||
|
|
||||||
|
|
@ -60,7 +83,28 @@ This also means that Sideband is designed to be fully compatible with custom (an
|
||||||
|
|
||||||
## On Linux
|
## 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. 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
|
||||||
|
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.
|
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.
|
||||||
|
|
||||||
|
|
@ -80,6 +124,11 @@ pamac install python-pyaudio opusfile codec2 xclip xsel
|
||||||
# For Arch and derivatives
|
# For Arch and derivatives
|
||||||
sudo pacman -Sy python-pyaudio opusfile codec2 xclip xsel
|
sudo pacman -Sy python-pyaudio opusfile codec2 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
|
||||||
```
|
```
|
||||||
|
|
||||||
Once those are installed, install the Sideband application itself:
|
Once those are installed, install the Sideband application itself:
|
||||||
|
|
@ -151,7 +200,9 @@ python3 -m sbapp.main
|
||||||
|
|
||||||
## On Raspberry Pi
|
## 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.
|
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.
|
||||||
|
|
||||||
|
|
|
||||||
415
Zen of Reticulum.md
Normal file
415
Zen of Reticulum.md
Normal file
|
|
@ -0,0 +1,415 @@
|
||||||
|
# Zen of Reticulum
|
||||||
|
|
||||||
|
## I: The Illusion Of The Center
|
||||||
|
|
||||||
|
For the better part of a generation, we have been taught to visualize the digital world through the lens of hierarchy. The mental maps we carry are dominated by a single, misleading image: **The Cloud**.
|
||||||
|
|
||||||
|
We imagine the network as a vast, ethereal space "up there" or "out there". A centralized repository of services and data to which we, the lowly clients, must connect. We build our software with this assumption hardcoded into our logic: *There is a server. The server has the authority. The server knows the way. I must find the server to function*.
|
||||||
|
|
||||||
|
This is the Client-Server mental model, and it is the primary obstacle to understanding Reticulum.
|
||||||
|
|
||||||
|
### Fallacy Of The Cloud
|
||||||
|
|
||||||
|
The first step in the Zen of Reticulum is to realize that *there is no cloud*. There is only other people's computers. When you build for the cloud, you are building *for* a landlord. You are accepting that your application's existence is conditional on the permission, uptime, and continued goodwill of a central authority.
|
||||||
|
|
||||||
|
In Reticulum, you must shift your thinking from "connecting to" to "being among". Reticulum is not a service you subscribe to - *it is a fabric you inhabit*. There is no "up there". There is only *here* and *there*, and the space between them is peer-to-peer.
|
||||||
|
|
||||||
|
### Decentralization Or Uncentralizability?
|
||||||
|
|
||||||
|
It is common to hear the word "decentralized" thrown around in modern tech circles. But often, this is merely a marketing term for "slightly distributed centralization". A blockchain with a few dominant miners, or a federated protocol with a few giant servers. *In practice*, it's still centralized. It simply has a few centers instead of one.
|
||||||
|
|
||||||
|
Reticulum goes further. It wants **Uncentralizability**.
|
||||||
|
|
||||||
|
This is not a wishful political stance, but a foundational mathematical characteristic of the protocol, onto which everything else has been built. Reticulum assumes that every peer on the network is potentially hostile, and every link is potentially compromised. It is designed with no "privileged" nodes. While some nodes may act as Transport Instances - forwarding traffic for others - they do so *blindly*, and they only know about their immediate surroundings, and nothing more. They route based on cryptographic proofs, not on administrative privilege. They cannot see who is talking to whom, nor can they selectively manipulate traffic without breaking their own ability to route entirely.
|
||||||
|
|
||||||
|
The system is designed to make hierarchy structurally impossible. You cannot hijack an address, because there is no central registry to hijack. You cannot block a user, because there is no central switch to flip. You can offer paths through the network, but you can't force anyone to use them.
|
||||||
|
|
||||||
|
### Death To The Address
|
||||||
|
|
||||||
|
To break free of the center, you must also let go of the concept of the "Address".
|
||||||
|
|
||||||
|
In the IP world, an address is a location. It is a coordinate in a *deeply hierarchical* and static grid. If you move your computer to a different house, your address changes. If your router reboots, your address might change. Your *identity* is bound to your *location*, and therefore, it is fragile, and easily controlled.
|
||||||
|
|
||||||
|
Reticulum abolishes this link between *Identity* and *Location*.
|
||||||
|
|
||||||
|
In Reticulum, an address is not a place; it is a **Hash of an Identity**. It is a cryptographic representation of *who* you are, not *where* you are. Because of this, your address is portable. You can take a laptop from a WiFi cafe in Berlin, to a LoRa mesh in the mountains, to a packet radio link on a boat, and your "address" - your *Destination Hash* - never changes.
|
||||||
|
|
||||||
|
The network does not route to a place; it routes to a *person* (or a machine). When you send a packet, you are not targeting a coordinate in a grid; you are encrypting a message for a specific entity. The network dynamically discovers where that entity currently resides, and it does so in a way where no one really knows where that entity is actually located physically.
|
||||||
|
|
||||||
|
**Consider:**
|
||||||
|
|
||||||
|
- **The Old Way:** *"I am at `192.168.1.5`. Come find me"*.
|
||||||
|
- **The Zen Way:** *"I am `<327c1b2f87c9353e01769b01090b18f2>`. Wherever I am, my peers can reach me"*.
|
||||||
|
|
||||||
|
Once you stop thinking about servers and start thinking about portable identities, where everyone can always reach everyone else directly, the illusion of the center fades away. You realize there *is* no center holding the network together. No coordinators or bureaucrats required. The network is simply the sum of its peers, communicating directly, sovereignly, and without a master.
|
||||||
|
|
||||||
|
|
||||||
|
## II: Physics Of Trust
|
||||||
|
*Paranoia Is A Great Design Principle*
|
||||||
|
|
||||||
|
If we accept that there is no center - that the network is a chaotic, peer-to-peer mesh - we are forced to confront a terrifying reality: **There is no one guarding the door**.
|
||||||
|
|
||||||
|
In the traditional networking mindset, we rely on the concept of the "trusted core". We assume our local coffee shop WiFi is safe, or that the backbone providers are neutral custodians. We build our security like a castle: strong walls on the outside, soft and trusting on the inside. We use encryption only when we step out into the "wild" internet.
|
||||||
|
|
||||||
|
### Hostile Environments
|
||||||
|
|
||||||
|
The Zen of Reticulum requires you to invert this. You must assume that *every* environment is hostile. This isn't cynicism, just uncaring physics.
|
||||||
|
|
||||||
|
When you transmit information over radio waves, you are shouting into a crowded room. Anyone can listen. When you traverse the internet, your packets pass through routers controlled by strangers, corporations, and state actors. Assuming privacy in this environment without cryptographic protection is not optimism but gross negligence.
|
||||||
|
|
||||||
|
Reticulum is built on the premise that every link is tapped, and every peer is a potential adversary. If your system cannot survive an adversary owning the physical layer, it cannot survive at all.
|
||||||
|
|
||||||
|
But this is the paradox: By assuming the network is hostile, you make it safe. When you accept the dangers for what they are, they become manageable. When you stop trusting the infrastructure and start trusting the math, you eliminate the single point of failure: Human integrity.
|
||||||
|
|
||||||
|
### Encryption Is Not A Feature
|
||||||
|
|
||||||
|
In the world of TCP/IP, encryption is an afterthought. It is a layer we slap on top of the protocol (HTTPS, TLS) to patch the security holes of the original design. It is a "feature" you sometimes *enable* for "sensitive data". This is fundamentally flawed, since all data is sensitive.
|
||||||
|
|
||||||
|
In Reticulum, encryption is **gravity**.
|
||||||
|
|
||||||
|
It is not optional. It is not a plugin. It is the *fundamental force that allows the network to exist*. If you were to strip the encryption from Reticulum, the routing would break. The Transport system uses cryptographic signatures and entropy to verify paths and pass information. If packets were plaintext, intermediate nodes could not prove that a route was valid, nor could endpoints prevent spoofing or tampering.
|
||||||
|
|
||||||
|
In Reticulum, the entropy of the encrypted packet *is* the routing logic.
|
||||||
|
|
||||||
|
To ask for a version of Reticulum without encryption is like asking for a version of the ocean without liquid. You are not asking for a feature change; you're asking for a different physical universe. We design for a universe where information has mass, structure, and integrity.
|
||||||
|
|
||||||
|
### Zero-Trust Architectures
|
||||||
|
|
||||||
|
We must unlearn our reliance on **Institutional Trust**.
|
||||||
|
|
||||||
|
For decades, we have been trained to trust authorities. We trust a website because a chain of Certificate Authorities (companies we don't know) vouches for it. We trust an app because it is in an app store (run by a corporation we don't control). We trust a message because it comes from a phone number assigned by a telecom. Yet, everything in our digital information sphere today is more untrustworthy and risky than a medieval second-hand underwear market.
|
||||||
|
|
||||||
|
Reticulum replaces institutional trust with **Cryptographic Proof**.
|
||||||
|
|
||||||
|
In Reticulum, you do not trust a node because it has a nice hostname or because it is listed in a directory. You trust it because it holds the private key corresponding to the Destination Hash you are communicating with. This trust is binary, mathematical, and **absolute**. Either the signature matches, or it does not. There is no "maybe".
|
||||||
|
|
||||||
|
This shift moves the power from the institution to the individual. You become the ultimate arbiter of your own trust relationships. You decide which keys to accept, which paths to follow, and which identities to recognize.
|
||||||
|
|
||||||
|
**Consider:**
|
||||||
|
|
||||||
|
- **The Old Way:** *"I trust this site because the browser says the lock icon is green"*.
|
||||||
|
- **The Zen Way:** *"I trust this destination because I have verified its hash fingerprint out-of-band, and the math confirms the signature"*.
|
||||||
|
|
||||||
|
When you internalize the Physics of Trust, you stop looking for protection from firewalls, VPNs, and Terms of Service agreements. You realize that true security comes from the design of the protocol itself. You can stop trusting the cloud, and you start trusting the code - because you can verify it yourself.
|
||||||
|
|
||||||
|
|
||||||
|
## III: Merits Of Scarcity
|
||||||
|
*Every Bit Counts*
|
||||||
|
|
||||||
|
We have grown addicted to abundance. In the modern digital ecosystem, bandwidth is treated as an endless, flat ocean. We stream high-definition video without a thought, we ship entire libraries of code just to render a single button, and we measure performance in gigabits per second. This abundance has hollowed out our craft. When constraints vanish, efficiency dies, and with it, a certain kind of Clarity and Quality.
|
||||||
|
|
||||||
|
Reticulum asks you to step out of the ocean and onto the tightrope.
|
||||||
|
|
||||||
|
### The Bandwidth Fallacy
|
||||||
|
|
||||||
|
The Zen of Reticulum requires the realization that **5 bits per second is a valid speed**.
|
||||||
|
|
||||||
|
To a modern developer, this sounds like paralysis. But there is a profound freedom in limits: When you have a gigabit connection, you can be incredibly sloppy. You can be wasteful. You can push your problems onto the infrastructure. *"It’s slow? Get a faster router"*.
|
||||||
|
|
||||||
|
But on a high-latency, low-bandwidth link (be it a noisy HF radio channel or a tenuous LoRa hop) you cannot push problems anywhere. You must solve them. The network does not negotiate with waste.
|
||||||
|
|
||||||
|
This forces a shift from consumption to interaction. You are no longer, then, consuming a service provided by a fat pipe; you are engaging in a careful negotiation with the physical medium. The medium becomes a partner in the conversation, not just a dumb conduit. You suddenly need to *understand the world to be in it*.
|
||||||
|
|
||||||
|
### Cost Of A Byte
|
||||||
|
|
||||||
|
In a scarce economy, a byte is not just data, but energy, time, and space.
|
||||||
|
|
||||||
|
Every byte you transmit consumes battery life on a solar-powered node. It occupies valuable airtime that could have been used by another peer. It represents a measurable slice of the electromagnetic spectrum.
|
||||||
|
|
||||||
|
When you internalize this, you begin to write code differently. You stop asking, "How much data can I send?" and start asking, "What is the *minimum* amount of information required to convey this intent? How can I best utilize my informational entropy?"
|
||||||
|
|
||||||
|
This is where the elegance of Reticulum shines. The protocol is designed to strip away the non-essential. A link establishment takes three very small packets. A destination hash fits in 16 bytes. The overhead is vanishingly small, leaving almost the entire channel for the message itself.
|
||||||
|
|
||||||
|
**Consider:**
|
||||||
|
|
||||||
|
- **The Old Way:** *"I need to send a status update. I'll send a JSON object with metadata, timestamps, and user profile info (15KB)."*
|
||||||
|
- **The Zen Way:** *"I need to send a status update. I'll send a single byte representing the state code. The context is already known."*
|
||||||
|
|
||||||
|
This is of course optimization, but more importantly, *it is a form of respect*. Efficiency in a shared medium is an act of stewardship. By taking only what you need from the network, you leave room for others. The network listens to those who speak with purpose.
|
||||||
|
|
||||||
|
### Flow & Time
|
||||||
|
|
||||||
|
Scarcity also teaches us about time. We have become addicted to the *synchronous* now - the instant ping, the real-time stream. But Reticulum embraces *asynchronous* time.
|
||||||
|
|
||||||
|
When links are intermittent and latency is measured in minutes or hours, "real-time" is an illusion. Reticulum doesn't encourage **Store and Forward** as a mere fallback, but as a primary mode of existence. You write a message, it propagates when it can, and it arrives when it arrives.
|
||||||
|
|
||||||
|
This changes the psychological texture of communication. It removes the anxiety of the immediate response. It allows for contemplation. You are not demanding the recipient's attention *right now*; you are placing a gift in their path, to be found when they are ready.
|
||||||
|
|
||||||
|
By designing for delay, you design for resilience. You are no longer building a house of cards that collapses when a single packet drops. You are building a stone arch that distributes the load *over time*.
|
||||||
|
|
||||||
|
### Liberation From Limits
|
||||||
|
|
||||||
|
There is a strange optimism in scarcity. When you are forced to work within strict constraints, you are forced to prioritize. *You* must decide what truly matters. *That* is the real core of agency.
|
||||||
|
|
||||||
|
In the infinite fantasy world of The Cloud, everything is urgent, so nothing is. In the economy of Reticulum, the cost of transmission forces you to weigh the value of your message. Do you really need to send that heart beat? Is that photo essential?
|
||||||
|
|
||||||
|
When you strip away the noise, what remains is *signal*.
|
||||||
|
|
||||||
|
This discipline creates a different kind of developer. It creates a craftsman who understands that the best code is the code you don't have to write. It creates a user who understands that the most powerful message is the one that is *understood*, not the one that is loudest. In the world of Reticulum, you are not a mere consumer of bandwidth; you are an architect of intent.
|
||||||
|
|
||||||
|
|
||||||
|
## IV: Sovereignty Through Infrastructure
|
||||||
|
**Be Your Own Network**
|
||||||
|
|
||||||
|
We live in an era of digital tenancy. We lease our connectivity from ISPs. We rent our storage from cloud providers. We even borrow our identity from social media platforms. We are tenants in a house we did not build, governed by rules we did not write, subject to eviction at the whim of a landlord who has never met us.
|
||||||
|
|
||||||
|
The Zen of Reticulum is the realization that you *can* own the house.
|
||||||
|
|
||||||
|
### A Carrier-Grade Fallacy
|
||||||
|
|
||||||
|
For decades, we have been gaslit into believing that networking is really not just hard, but impossible. It is presented as a dark art reserved for telcos and billionaires, requiring millions of dollars of fiber optics, climate-controlled data centers, and armies of engineers. We are told that building reliable infrastructure is "too complex" for the individual or small organization.
|
||||||
|
|
||||||
|
This is a big, fat lie.
|
||||||
|
|
||||||
|
Physics is simple. A radio wave needs a transmitter and a receiver. A packet needs a path. The "complexity" of the modern internet is largely bureaucratic - a mountain of billing systems, regulatory capture, and legacy cruft designed to keep the gatekeepers in power.
|
||||||
|
|
||||||
|
Reticulum strips away the bureaucracy. It runs on hardware that costs the price of a dinner. It runs on spectrum that is free to use. It demonstrates that a robust, planetary-scale network does not require a Fortune 500 company. It requires only the will to deploy, and the distributed, uncoordinated efforts of many individuals.
|
||||||
|
|
||||||
|
### Personal Infrastructure
|
||||||
|
|
||||||
|
This is where the rubber meets the road. You can read about Reticulum, you can understand the theory, but the insights only arrive when you plug in a radio and run a Transport Node. Suddenly, you are no longer a consumer. You're an operator.
|
||||||
|
|
||||||
|
This shift is subtle but profound. When you run your own infrastructure, the network ceases to be a service that is provided *to* you. It becomes a space that you *inhabit*. You become responsible for the flow of information. You gain an intimate understanding of the medium - the way the weather affects the radio waves, the way the topology changes, the way the packets dance through the ether.
|
||||||
|
|
||||||
|
There is a quiet competence that comes from this. You stop asking "Is the internet down?" and start asking "Is *my* links up?" You stop waiting for a technician and start checking the logs. This is a form of strength. To understand the system that carries your words is to be free from the mystery that keeps you dependent.
|
||||||
|
|
||||||
|
### The Ability To Disconnect
|
||||||
|
|
||||||
|
Why go to the trouble? Why buy the radio, write the config, and leave the Pi running in the corner?
|
||||||
|
|
||||||
|
Because the old, centralized network is fragile. And because most of us doesn't even really want to be there anymore.
|
||||||
|
|
||||||
|
The internet we rely on today is a chain of single points of failure. Cut the undersea cable, and a continent goes dark. Shut down the power grid, and the cloud evaporates. Deprioritize the "wrong" traffic, and the flow of information is strangled.
|
||||||
|
|
||||||
|
Sovereignty is the ability to survive the cut, whether or not that cut was an accident or on purpose.
|
||||||
|
|
||||||
|
When you build your own infrastructure, you build a lifeline. Reticulum is designed to function over media that the traditional internet cannot touch - bare wires, battery-powered radios, ad-hoc WiFi meshes. When the grid fails, or the censors arrive, or the bill goes unpaid, your Reticulum network continues to hum.
|
||||||
|
|
||||||
|
This is not about "dropping out" of society. It is about building a substrate on which an actual *Society* can function.
|
||||||
|
|
||||||
|
**Consider:**
|
||||||
|
|
||||||
|
- **The Old Way:** "My connection is slow. I should call my ISP and complain."
|
||||||
|
- **The Zen Way:** "The path is noisy. I will adjust the antenna or find a better route."
|
||||||
|
|
||||||
|
By taking ownership of the infrastructure, you take ownership of your voice. You stop shouting into someone else's megaphone and start building your own. The network is no longer something that happens to you; it is something you make happen.
|
||||||
|
|
||||||
|
|
||||||
|
# V: Identity and Nomadism
|
||||||
|
**A Fluid Self**
|
||||||
|
|
||||||
|
In the old world, you are defined by your coordinates. If you are at `34.109.71.5`, you're *here*. If you unplug the cable and walk down the street, you vanish. Your digital self evaporates because it was tethered to the wall. You are a ghost in the endless machinations of gears, levers and transistors, bound to the hardware, and those that own it.
|
||||||
|
|
||||||
|
This creates a subtle, constant anxiety. We are terrified of disconnecting because, in the architecture of the old web, disconnecting is a kind of death.
|
||||||
|
|
||||||
|
The Zen of Reticulum offers a different way to be.
|
||||||
|
|
||||||
|
### Portable Existence
|
||||||
|
|
||||||
|
In Reticulum, your identity is not a location, or a username granted by a service. It is a cryptographic key - a complex, unique mathematical signature that exists independently of the physical world. You can carry it only in your mind, if you want to.
|
||||||
|
|
||||||
|
Think of it less like a street address and more like a name. *A true name*.
|
||||||
|
|
||||||
|
If you travel from Berlin to Tokyo, you do not change your name. You are still you. The people who know you can still recognize you. Reticulum applies this principle to the network layer. Your Destination Hash is **invariant**. It travels with you, stored securely on your device, *immutable as a stone*.
|
||||||
|
|
||||||
|
This changes the relationship between you and the machine. You are not "logged into" the network via a specific gateway. You *are* the endpoint. The network does not connect to a place; *it converges on you*.
|
||||||
|
|
||||||
|
### Roaming Nodes
|
||||||
|
|
||||||
|
This freedom introduces a new concept of time and space: **Nomadism**.
|
||||||
|
|
||||||
|
Because your identity is portable, your connectivity can be fluid. You can be sitting at a desk connected to a fiber backbone one moment, and walking through a field connected only to a long-range LoRa mesh the next. To the rest of the network, nothing has changed. Your friends do not need to update your contact info. The messages they send do not bounce back. The network senses the shift in the medium and reroutes the flow of data automatically.
|
||||||
|
|
||||||
|
You are no longer a stationary node in a fixed grid. You are a wanderer in a fluid medium.
|
||||||
|
|
||||||
|
The interfaces - whether it is WiFi, Ethernet, Packet Radio, or a physical wire - is merely the clothing your node wears. You change it to suit the environment. Underneath, you remain the same. This is the liberation of the protocol. It treats the physical medium as a transient circumstance, not a definition of self.
|
||||||
|
|
||||||
|
**Consider:**
|
||||||
|
|
||||||
|
- **The Old Way:** *"I lost connection. I have to reconnect to the VPN to tell them where I am now."*
|
||||||
|
- **The Zen Way:** *"I moved. The network subtly bends to accomodate this new reality."*
|
||||||
|
|
||||||
|
### Announcing Presence
|
||||||
|
|
||||||
|
How does the network find a wanderer? It listens.
|
||||||
|
|
||||||
|
In the IP world, we query directories. We ask a server, "Where is Mark?" The server checks its database and gives us a coordinate. This means that someone, somewhere, is keeping track of you. It assumes and *requires* surveillance.
|
||||||
|
|
||||||
|
Reticulum replaces surveillance with **Announces**.
|
||||||
|
|
||||||
|
Instead of asking a central authority where you are, you simply state your presence. You broadcast a cryptographic proof: "I am here, and I am who I say I am". This ripples out through the mesh. Your neighbors hear it, update their path tables, and pass it on.
|
||||||
|
|
||||||
|
This is a quiet, organic process. It is the digital equivalent of lighting lanterns in the dark. You do not need to chase the light; you let the light find you. It respects your autonomy. You choose when to announce, how often to speak, and to whom. You also choose when to disappear - for but a moment or perpetually.
|
||||||
|
|
||||||
|
### Anchor In The Flow
|
||||||
|
|
||||||
|
There is a deep peace in this nomadism. It teaches you that stability does not come from standing still. Stability comes from *internal coherence*.
|
||||||
|
|
||||||
|
By holding your own private key, you hold your own center of gravity. The world around you; the infrastructure, the topography and the availability of links can all shift chaotically. Storms can knock out towers. Cables can be cut. The internet can go down.
|
||||||
|
|
||||||
|
But as long as you possess your key, you possess your identity. The entire infrastructure can be destroyed and rebuilt, and you are still you. Nothing lasts, yet nothing is lost.
|
||||||
|
|
||||||
|
You become a sovereign entity moving through the noise, connected not by the rigidity of cables, but by the fluidity of recognition. The network becomes a place you inhabit, rather than a utility you subscribe to: You are at home in the ether.
|
||||||
|
|
||||||
|
|
||||||
|
## VI: Ethics Of The Tool
|
||||||
|
**Technology With Conscience**
|
||||||
|
|
||||||
|
You have unlearned the center. You have accepted the physics of trust. You have embraced the economy of scarcity and the freedom of unbound nomadism. You are standing in a new space. Now, look at the tool in your hand.
|
||||||
|
|
||||||
|
In the old world, we were taught that technology is neutral. We are told that "guns don't kill people, people do", or that a component is just a component, indifferent to what its combinatorial potential is. This is a convenient lie. It serves only to allow the builders to wash their hands of responsibility.
|
||||||
|
|
||||||
|
But we know better now. We know that **architecture is politics**, and *politics is control*. The way you build a system determines how it will be used. If you build a system optimized for mass surveillance, you *will* get a panopticon. If you build a system optimized for centralized control, you *will* get a dictatorship. If you build a system optimized for extraction, you *will* get a parasite.
|
||||||
|
|
||||||
|
The Zen of Reticulum asserts that a tool is never neutral.
|
||||||
|
|
||||||
|
On the very contrary: A tool is intent, **crystallized**.
|
||||||
|
|
||||||
|
### The Harm Principle
|
||||||
|
|
||||||
|
Why does the Reticulum License forbid the software from being used in systems designed to harm humans? Is it not just a restriction on freedom?
|
||||||
|
|
||||||
|
It is a restriction on *license*, yes, but it is an expansion of *freedom*.
|
||||||
|
|
||||||
|
Building powerful tools without a moral compass is in no way virtuous or commendable, it is plain and simple irresponsibility.
|
||||||
|
|
||||||
|
A tool that can easily be used to oppress is a real danger to the user. If you build a network that can be turned against you by a tyrant, you are not free. You are merely waiting for the leash to tighten. By encoding the "Harm Principle" into the legal DNA of the reference implementation, we are building a safeguard. We are stating, clearly and immutably, that *this tool* is for **life**, not for death.
|
||||||
|
|
||||||
|
This aligns the software with the interests of humanity. It cements that the network cannot be conscripted into a kill-system, a weaponized drone controller, or a torture device without breaking the license and the law. It is a line drawn in the sand - not by a government or external authority, but by the creators of the tool itself.
|
||||||
|
|
||||||
|
**Consider:**
|
||||||
|
|
||||||
|
- **The Old Way:** *"It's just software. How people use it is not my problem."*
|
||||||
|
- **The Zen Way:** *"This software is a habitat. I will not allow it to be used to build a cage."*
|
||||||
|
|
||||||
|
It is *your* choice whether to align with this - we are not forcing this stance on anyone. If you choose to align with life over death, with creativity over destruction, we grant you an immensely powerful tool, to own and build with as you please. If you do not, we deny it.
|
||||||
|
|
||||||
|
If you do not like this, we most assuredly do not need you here, and you are on your own.
|
||||||
|
|
||||||
|
### Public Domain Protocol
|
||||||
|
|
||||||
|
This leads to a vital distinction: The difference between the *idea* and the *implementation*.
|
||||||
|
|
||||||
|
The protocol - the mathematical rules of how Reticulum works - is dedicated to the Public Domain. It belongs to humanity. **No one can own it**. Anyone can implement it, improve it, or adapt it. This is the core idea of free communication, which itself must be forever free.
|
||||||
|
|
||||||
|
But the functional, deployed *reference implementation* - the Python code, the maintenance, the years of labor - has a conscience. This distinction is the engine of sustainability. It allows the protocol to be universal, while ensuring that the specific labor of the builders is not hijacked to undermine the foundational intent of the project itself. From this document, it should be very clear what this intent is.
|
||||||
|
|
||||||
|
If you want to build a system with Reticulum that manipulates and damages users for profits or targets missiles, you can use the public domain protocol, and start from scratch. But you cannot take our work. You must do your own. This serves as a pillar of accountability. If you want to build a weapon, *you* go and forge the steel yourself, while the world observes. And when the blood is drawn - it is on **your** hands.
|
||||||
|
|
||||||
|
### Preserving Human Agency
|
||||||
|
|
||||||
|
We live in an era of predatory extraction. The open-source commons is being scraped, ingested, and regurgitated by machine learning algorithms, whose corporate owners seek to replace the very humans who built those commons. Our code, our words, and our creativity is being used to train systems that are specifically designed to make us obsolete, without offering anything else in return than serfdom and leashes.
|
||||||
|
|
||||||
|
Reticulum stands against this.
|
||||||
|
|
||||||
|
The license protects the software from being used to feed the beast. It draws a hard line: This tool is for *people*. It is for human-to-human connection. It is not a dataset to be strip-mined for the purpose of building a synthetic overlord, puppeteered by a miniscule conglomerate of controllers.
|
||||||
|
|
||||||
|
This is a radical act of preservation. By protecting the code from AI appropriation, we are protecting space for human agency. We are ensuring that there remains a digital realm where the actors are flesh, blood and soul, where decisions are made by minds, not overlords hiding behind models.
|
||||||
|
|
||||||
|
When you use Reticulum, you are using a tool that respects you. It does not see you as a product to be tracked. It does not see your data as fuel for an algorithm. It sees you as a sovereign, equal peer.
|
||||||
|
|
||||||
|
This changes the foundational premise of using the technology. It restores dignity to the interaction. You are not the user of a service; you are a participant in a mutual covenant. The tool aligns with your autonomy, rather than eroding it.
|
||||||
|
|
||||||
|
In this way, ethics is not a restriction, but a foundation. It is the foundation that helps ensure the network will still belong to you tomorrow.
|
||||||
|
|
||||||
|
|
||||||
|
## VII: Design Patterns For Post-IP Systems
|
||||||
|
**Practical Philosophy for Developers**
|
||||||
|
|
||||||
|
The philosophy is useless if it cannot be hammered into code. The metaphors we have explored - nomadism, scarcity, trust - are not just poetry, but real-world engineering constraints. When you sit down to write software for Reticulum, these concepts must shape the very structure of your application.
|
||||||
|
|
||||||
|
We are now moving from the *why* to the *how*. This is where the abstract becomes concrete, and where you will see the true depth of the patterns we have been weaving.
|
||||||
|
|
||||||
|
### Store & Forward
|
||||||
|
|
||||||
|
The web has trained us to be impatient. We write synchronous code. We fire a request and we wait, blocking the UI, holding our breath. If the response doesn't come in 250 milliseconds, we show a spinner. If it doesn't come in five seconds, we show an error. We treat network connectivity as a binary state: either we are "online" or we are "broken".
|
||||||
|
|
||||||
|
This is brittle. It is a rejection of reality.
|
||||||
|
|
||||||
|
In Reticulum, connectivity is a spectrum, and presence is asynchronous. If at all applicable to your intent, you must design your applications to embrace **Store & Forward**.
|
||||||
|
|
||||||
|
Instead of demanding an immediate answer, your application should act as a patient participant. You create a message for someone or something in the mesh. The network holds it. It carries it from node to node, perhaps over hours or days, waiting for the recipient to appear. When they finally surface, the message is delivered. This requires a shift from "request/response" to "event/handler". How exactly you do this is a challenge for you to solve intelligently within your problem domain, but Reticulum-based systems already exist that does this extremely well, and you can use them for inspiration.
|
||||||
|
|
||||||
|
**Consider:**
|
||||||
|
|
||||||
|
- **The Old Way:** `Connect() -> Send() -> Wait() -> Crash if timeout.`
|
||||||
|
- **The Zen Way:** `Send() -> Continue living. -> Receive() when it arrives.`
|
||||||
|
|
||||||
|
This changes the user experience profoundly. It removes the anxiety of the loading bar. It creates a sense of continuity. The user is not "waiting for the network"; they are interacting with a persistent log of communication that lives in the network itself.
|
||||||
|
|
||||||
|
### Naming Is Power
|
||||||
|
|
||||||
|
In the IP world, we are slaves to the Domain Name System. We rely on a hierarchy of registrars to map human-readable names to machine-readable addresses. This hierarchy is a choke point. If the registrar revokes your domain, or if the DNS server goes down, you vanish.
|
||||||
|
|
||||||
|
Reticulum dissolves this hierarchy with **Hash-based Identity**.
|
||||||
|
|
||||||
|
In this design pattern, a name is not a string you look up; it is a cryptographic destination you verify. When you design for Reticulum, you stop asking the user for a URL and start asking for a Destination or Identity Hash.
|
||||||
|
|
||||||
|
This feels strange at first. A hash like `<83b7328926fed0d2e6a10a7671f9e237>` looks alien compared to `myfriend.com`. But that alienness is the armor. It **cannot** be spoofed. It **cannot** be censored by a registrar. It is **absolute**.
|
||||||
|
|
||||||
|
Designing for this means shifting your UI metaphors. You are no longer browsing a web of pages; you are managing a ledger of keys. You are building an "Address Book" that is actually a keyring. The names are given by the user, and the power stays with them. That hashes look complex is directly analogous to the strengths of the bonds formed by their use. It forces the user to engage in a moment of verification, an out-of-band handshake, which restores the human element of trust that SSL certificates stripped away.
|
||||||
|
|
||||||
|
### The Interface Is The Medium
|
||||||
|
|
||||||
|
One of the most liberating patterns in Reticulum is **Transport Agnosticism**.
|
||||||
|
|
||||||
|
In traditional networking, your code is often littered with transport logic. "Am I on WiFi? Check bandwidth. Am I on Cellular? Check data plan. Am I on Ethernet?". You are constantly micromanaging the pipe.
|
||||||
|
|
||||||
|
In Reticulum, you write to the API, and the API writes to the medium. You send a packet to a Destination. You do not care if that packet travels over a TCP tunnel, a LoRa radio wave, or a serial wire interface. That is the stack's concern.
|
||||||
|
|
||||||
|
This allows you to write **Universal Applications**.
|
||||||
|
Imagine a messaging app. You write it once. It works on a laptop connected to fiber. It works on a phone in the city using WiFi. And, without a single line of code changed, it works on a device in the wilderness, talking only to other devices via radio.
|
||||||
|
|
||||||
|
The pattern is simple: **Never code to the hardware. Code to the intent.**
|
||||||
|
|
||||||
|
**Consider:**
|
||||||
|
|
||||||
|
- **The Old Way:** `socket.connect(ip, port)`
|
||||||
|
- **The Zen Way:** `RNS.Packet(destination, data).send()`
|
||||||
|
|
||||||
|
By abstracting the medium, you make your software immortal to changes in infrastructure. The user might switch from a 4G hotspot to a HF modem tomorrow. Your software doesn't need to know. It simply continues the conversation.
|
||||||
|
|
||||||
|
### Emergent Patterns
|
||||||
|
|
||||||
|
When you combine these patterns - *Store & Forward*, *Hash-based Identity*, and *Transport Agnosticism* - you create software that feels fundamentally different.
|
||||||
|
|
||||||
|
It feels *grounded*. It doesn't flicker when the signal drops. It doesn't panic when the server is down. It has weight. It has persistence. It has *relevance*.
|
||||||
|
|
||||||
|
You are no longer building a "client" that begs a "server" for attention. You are building an autonomous agent that exists within the mesh. It speaks when it needs to, listens when it can, and carries its identity with it wherever it goes.
|
||||||
|
|
||||||
|
This is the culmination of the Zen. The code is not just a set of instructions: It is a behavioral envelope. It is a way of *being* in the network.
|
||||||
|
|
||||||
|
|
||||||
|
## VIII: Fabric Of The Independent
|
||||||
|
|
||||||
|
We have stripped away the illusions. We have seen that the center is empty, that trust *must* be hard, that resources are finite, and that we must own our infrastructure. We have seen that tools have ethics and that our identity can move fluidly.
|
||||||
|
|
||||||
|
This is a reclaiming of the commons. For too long, we have allowed the most vital substrate of human society - *our ability to speak to one another* - to be colonized by entities that do not share our interests. We have allowed the architecture of our communication to be designed by accountants rather than architects.
|
||||||
|
|
||||||
|
We are taking it back. Not by petitioning the masters, but by building the new world within, over, under and around the shell of the old.
|
||||||
|
|
||||||
|
### The Work Is Finished
|
||||||
|
|
||||||
|
The heavy lifting is done.
|
||||||
|
|
||||||
|
The protocol is in the public domain, a gift to humanity that can never be taken away. The software is written, tested, and running on devices scattered across the globe. The manual lies open before you. The source code for the reference implementation is now distributed on hundreds of thousands of devices across the planet. No one can delete or destroy it. The hardware is accessible and abundant.
|
||||||
|
|
||||||
|
It was a hard road to get here, but we got here. Now, there is no roadmap committee waiting for approval. There is no venture capital dictating the user experience. There is no CEO to sign off on the next feature release.
|
||||||
|
|
||||||
|
There is only you.
|
||||||
|
|
||||||
|
The barrier to entry is no longer complexity: It is the mere habit of dependency. You were conditioned to wait. Wait for the app update. Wait for the ISP to fix the line. Wait for the platform to allow the post. Wait for the government to change the policies. Wait for the likes. Wait for the revolution to be televised.
|
||||||
|
|
||||||
|
The revolution never was televised.
|
||||||
|
|
||||||
|
It is packetized.
|
||||||
|
|
||||||
|
### Open Sky
|
||||||
|
|
||||||
|
The future of this technology is a construction project.
|
||||||
|
|
||||||
|
It looks like a single node on a windowsill, listening to the static. It looks like a message sent to a neighbor, bypassing the noise of the commercial web. It looks like a community mesh that grows, link by link, hop by hop, carried by hands that care more about connection than profit.
|
||||||
|
|
||||||
|
You have the blueprints. You have the tools. You have the philosophy. The noise of the old world has fallen away, leaving you with the quiet clarity of the open spectrum.
|
||||||
|
|
||||||
|
*Mark, early 2026*
|
||||||
152
docs/example_plugins/raspi_telemetry.py
Normal file
152
docs/example_plugins/raspi_telemetry.py
Normal file
|
|
@ -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
|
||||||
119
docs/example_plugins/server_telemetry.py
Normal file
119
docs/example_plugins/server_telemetry.py
Normal file
|
|
@ -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
|
||||||
|
|
@ -69,10 +69,10 @@ endif
|
||||||
fetchshare:
|
fetchshare:
|
||||||
-(rm ./share/pkg/*)
|
-(rm ./share/pkg/*)
|
||||||
-(rm ./share/mirrors/* -r)
|
-(rm ./share/mirrors/* -r)
|
||||||
cp ../../dist_archive/rns-1.0.4-py3-none-any.whl ./share/pkg/
|
cp ../../dist_archive/rns-1.1.5-py3-none-any.whl ./share/pkg/
|
||||||
cp ../../dist_archive/rnspure-1.0.4-py3-none-any.whl ./share/pkg/
|
cp ../../dist_archive/rnspure-1.1.5-py3-none-any.whl ./share/pkg/
|
||||||
cp ../../dist_archive/lxmf-0.9.3-py3-none-any.whl ./share/pkg/
|
cp ../../dist_archive/lxmf-0.9.4-py3-none-any.whl ./share/pkg/
|
||||||
cp ../../dist_archive/nomadnet-0.9.1-py3-none-any.whl ./share/pkg/
|
cp ../../dist_archive/nomadnet-0.9.9-py3-none-any.whl ./share/pkg/
|
||||||
cp ../../dist_archive/rnsh-0.1.7-py3-none-any.whl ./share/pkg/
|
cp ../../dist_archive/rnsh-0.1.7-py3-none-any.whl ./share/pkg/
|
||||||
cp ../../dist_archive/RNode_Firmware_*_Source.zip ./share/pkg/
|
cp ../../dist_archive/RNode_Firmware_*_Source.zip ./share/pkg/
|
||||||
zip --junk-paths ./share/pkg/example_plugins.zip ../docs/example_plugins/*.py
|
zip --junk-paths ./share/pkg/example_plugins.zip ../docs/example_plugins/*.py
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ source.exclude_patterns = app_storage/*,venv/*,Makefile,./Makefil*,requirements,
|
||||||
|
|
||||||
version.regex = __version__ = ['"](.*)['"]
|
version.regex = __version__ = ['"](.*)['"]
|
||||||
version.filename = %(source.dir)s/main.py
|
version.filename = %(source.dir)s/main.py
|
||||||
android.numeric_version = 20251122
|
android.numeric_version = 20251128
|
||||||
|
|
||||||
requirements = kivy==2.3.0,libbz2,sqlite3,pillow==10.2.0,qrcode==7.3.1,usb4a,usbserial4a,able_recipe,libwebp,libogg,libopus,opusfile,numpy,cryptography,codec2,pycodec2,sh,pynacl,typing-extensions,mistune>=3.0.2,beautifulsoup4,lxst
|
requirements = kivy==2.3.0,libbz2,sqlite3,pillow==10.2.0,qrcode==7.3.1,usb4a,usbserial4a,able_recipe,libwebp,libogg,libopus,opusfile,numpy,cryptography,codec2,pycodec2,sh,pynacl,typing-extensions,mistune>=3.0.2,beautifulsoup4,lxst
|
||||||
|
|
||||||
|
|
|
||||||
52
sbapp/compat.py
Normal file
52
sbapp/compat.py
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
def python314_kivy_patch():
|
||||||
|
print("Running Kivy on Python 3.14+ detected, checking compatibility patch...")
|
||||||
|
import os
|
||||||
|
import importlib.util
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
def fail_patch():
|
||||||
|
print("Error: Failed to open Kivy's lang/parser.py file for patching.")
|
||||||
|
print("Kivy currently has bugs that prevents it from running on Python 3.14")
|
||||||
|
print("and above, and this file needs to be patched to run Sideband.")
|
||||||
|
print("\nYou can patch this manually by locating the lang/parser.py file")
|
||||||
|
print(f"and replacing:\n\n{kivy_target_1}\n\nWith:\n\n{kivy_patch_1}\n")
|
||||||
|
os._exit(0)
|
||||||
|
|
||||||
|
kivy_target_1 = """ if isinstance(node, (ast.JoinedStr, ast.BoolOp)):
|
||||||
|
for n in node.values:
|
||||||
|
if isinstance(n, ast.Str):
|
||||||
|
# NOTE: required for python3.6
|
||||||
|
yield from cls.get_names_from_expression(n.s)
|
||||||
|
else:
|
||||||
|
yield from cls.get_names_from_expression(n.value)"""
|
||||||
|
|
||||||
|
kivy_patch_1 = """ if isinstance(node, (ast.JoinedStr, ast.BoolOp)):
|
||||||
|
for n in node.values:
|
||||||
|
yield from cls.get_names_from_expression(n.value)"""
|
||||||
|
|
||||||
|
spec = importlib.util.find_spec("kivy")
|
||||||
|
if spec is None or spec.origin is None or spec.submodule_search_locations is None: fail_patch()
|
||||||
|
contents = None
|
||||||
|
|
||||||
|
target_path = f"{spec.submodule_search_locations[0]}/lang/parser.py"
|
||||||
|
try:
|
||||||
|
with open(target_path, "rb") as fh: contents = fh.read().decode("utf-8")
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Error while reading Kivy's lang parser file: {e}")
|
||||||
|
|
||||||
|
if not contents: fail_patch()
|
||||||
|
contents = contents.replace("\r\n", "\n")
|
||||||
|
|
||||||
|
if kivy_patch_1 in contents: print("Kivy already patched for Python 3.14 compatibility, continuing.")
|
||||||
|
if kivy_target_1 in contents:
|
||||||
|
print("Patching Kivy for Python 3.14 compatibility...")
|
||||||
|
contents = contents.replace(kivy_target_1, kivy_patch_1)
|
||||||
|
if not kivy_patch_1 in contents: fail_patch()
|
||||||
|
try:
|
||||||
|
with open(target_path, "wb") as fh:
|
||||||
|
fh.write(contents.encode("utf-8"))
|
||||||
|
print("Kivy successfully patched for Python 3.14 compatibility")
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Error while patching Kivy: {e}")
|
||||||
|
fail_patch()
|
||||||
1330
sbapp/main.py
1330
sbapp/main.py
File diff suppressed because it is too large
Load diff
|
|
@ -90,10 +90,10 @@ class PropagationNodeDetector():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
else:
|
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:
|
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:
|
except Exception as e:
|
||||||
RNS.log("Error while processing received propagation node announce: "+str(e))
|
RNS.log("Error while processing received propagation node announce: "+str(e))
|
||||||
|
|
@ -202,6 +202,10 @@ class SidebandCore():
|
||||||
self.default_config_template = rns_config
|
self.default_config_template = rns_config
|
||||||
|
|
||||||
if config_path == None:
|
if config_path == None:
|
||||||
|
# h_dir = plyer.storagepath.get_home_dir()
|
||||||
|
# if type(h_dir) == bytes: h_dir = h_dir.decode("utf-8")
|
||||||
|
# self.app_dir = os.path.join(h_dir, ".config", "sideband")
|
||||||
|
# if self.app_dir.startswith("file://"): self.app_dir = self.app_dir.replace("file://", "")
|
||||||
self.app_dir = os.path.join(plyer.storagepath.get_home_dir(), ".config", "sideband")
|
self.app_dir = os.path.join(plyer.storagepath.get_home_dir(), ".config", "sideband")
|
||||||
if self.app_dir.startswith("file://"): self.app_dir = self.app_dir.replace("file://", "")
|
if self.app_dir.startswith("file://"): self.app_dir = self.app_dir.replace("file://", "")
|
||||||
else:
|
else:
|
||||||
|
|
@ -367,6 +371,7 @@ class SidebandCore():
|
||||||
self.active_propagation_node = None
|
self.active_propagation_node = None
|
||||||
self.propagation_detector = PropagationNodeDetector(self)
|
self.propagation_detector = PropagationNodeDetector(self)
|
||||||
|
|
||||||
|
if self.is_service or self.is_standalone:
|
||||||
RNS.Transport.register_announce_handler(self)
|
RNS.Transport.register_announce_handler(self)
|
||||||
RNS.Transport.register_announce_handler(self.propagation_detector)
|
RNS.Transport.register_announce_handler(self.propagation_detector)
|
||||||
|
|
||||||
|
|
@ -576,10 +581,8 @@ class SidebandCore():
|
||||||
total += entry.stat(follow_symlinks=False).st_size
|
total += entry.stat(follow_symlinks=False).st_size
|
||||||
return total
|
return total
|
||||||
|
|
||||||
def should_persist_data(self):
|
def should_persist_data(self, background=False):
|
||||||
if self.reticulum != None:
|
if self.reticulum != None: self.reticulum._should_persist_data(background=background)
|
||||||
self.reticulum._should_persist_data()
|
|
||||||
|
|
||||||
self.save_configuration()
|
self.save_configuration()
|
||||||
|
|
||||||
def __load_telemetry_collector_excluded(self):
|
def __load_telemetry_collector_excluded(self):
|
||||||
|
|
@ -804,8 +807,7 @@ class SidebandCore():
|
||||||
def __save_config(self, no_thread=False):
|
def __save_config(self, no_thread=False):
|
||||||
RNS.log("Saving Sideband configuration...", RNS.LOG_DEBUG)
|
RNS.log("Saving Sideband configuration...", RNS.LOG_DEBUG)
|
||||||
def save_function():
|
def save_function():
|
||||||
while self.saving_configuration:
|
while self.saving_configuration: time.sleep(0.15)
|
||||||
time.sleep(0.15)
|
|
||||||
try:
|
try:
|
||||||
self.saving_configuration = True
|
self.saving_configuration = True
|
||||||
with open(self.config_path, "wb") as config_file: config_file.write(msgpack.packb(self.config))
|
with open(self.config_path, "wb") as config_file: config_file.write(msgpack.packb(self.config))
|
||||||
|
|
@ -824,8 +826,8 @@ class SidebandCore():
|
||||||
if no_thread: save_function()
|
if no_thread: save_function()
|
||||||
else: threading.Thread(target=save_function, daemon=True).start()
|
else: threading.Thread(target=save_function, daemon=True).start()
|
||||||
|
|
||||||
if self.is_client:
|
if self.is_client: self.setstate("wants.settings_reload", True)
|
||||||
self.setstate("wants.settings_reload", True)
|
RNS.log("Sideband configuration saved", RNS.LOG_DEBUG)
|
||||||
|
|
||||||
def __load_plugins(self):
|
def __load_plugins(self):
|
||||||
plugins_path = self.config["command_plugins_path"]
|
plugins_path = self.config["command_plugins_path"]
|
||||||
|
|
@ -845,7 +847,10 @@ class SidebandCore():
|
||||||
plugin_globals["SidebandTelemetryPlugin"] = SidebandTelemetryPlugin
|
plugin_globals["SidebandTelemetryPlugin"] = SidebandTelemetryPlugin
|
||||||
RNS.log("Loading plugin \""+str(file)+"\"", RNS.LOG_NOTICE)
|
RNS.log("Loading plugin \""+str(file)+"\"", RNS.LOG_NOTICE)
|
||||||
plugin_path = os.path.join(plugins_path, file)
|
plugin_path = os.path.join(plugins_path, file)
|
||||||
exec(open(plugin_path).read(), plugin_globals)
|
try: exec(open(plugin_path).read(), plugin_globals)
|
||||||
|
except Exception as e:
|
||||||
|
RNS.log(f"Error loading plugin \"{file}\": {e}", RNS.LOG_ERROR)
|
||||||
|
continue
|
||||||
plugin_class = plugin_globals["plugin_class"]
|
plugin_class = plugin_globals["plugin_class"]
|
||||||
|
|
||||||
if plugin_class != None:
|
if plugin_class != None:
|
||||||
|
|
@ -952,10 +957,8 @@ class SidebandCore():
|
||||||
|
|
||||||
def log_announce(self, dest, app_data, dest_type, stamp_cost=None, link_stats=None):
|
def log_announce(self, dest, app_data, dest_type, stamp_cost=None, link_stats=None):
|
||||||
try:
|
try:
|
||||||
if app_data == None:
|
if app_data == None: app_data = b""
|
||||||
app_data = b""
|
if type(app_data) != bytes: app_data = msgpack.packb([app_data, stamp_cost])
|
||||||
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)
|
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._db_save_announce(dest, app_data, dest_type, link_stats)
|
||||||
self.setstate("app.flags.new_announces", True)
|
self.setstate("app.flags.new_announces", True)
|
||||||
|
|
@ -2032,10 +2035,8 @@ class SidebandCore():
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
RNS.log("Error on client RPC connection: "+str(e), RNS.LOG_ERROR)
|
RNS.log("Error on client RPC connection: "+str(e), RNS.LOG_ERROR)
|
||||||
RNS.trace_exception(e)
|
RNS.trace_exception(e)
|
||||||
try:
|
try: connection.close()
|
||||||
connection.close()
|
except: pass
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
return rpc_client_job
|
return rpc_client_job
|
||||||
|
|
||||||
|
|
@ -2997,18 +2998,31 @@ class SidebandCore():
|
||||||
db = self.__db_connect()
|
db = self.__db_connect()
|
||||||
dbc = db.cursor()
|
dbc = db.cursor()
|
||||||
|
|
||||||
|
base_condition = "(dest=:context_dest or source=:context_dest)"
|
||||||
if after != None and before == None:
|
if after != None and before == None:
|
||||||
query = "select * from lxm where (dest=:context_dest or source=:context_dest) and rx_ts>:after_ts"
|
query = f"select * from lxm where {base_condition} and rx_ts>:after_ts ORDER BY rx_ts DESC"
|
||||||
dbc.execute(query, {"context_dest": context_dest, "after_ts": after})
|
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:
|
elif after == None and before != None:
|
||||||
query = "select * from lxm where (dest=:context_dest or source=:context_dest) and rx_ts<:before_ts"
|
query = f"select * from lxm where {base_condition} and rx_ts<:before_ts ORDER BY rx_ts DESC"
|
||||||
dbc.execute(query, {"context_dest": context_dest, "before_ts": before})
|
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:
|
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"
|
query = f"select * from lxm where {base_condition} and rx_ts<:before_ts and rx_ts>:after_ts ORDER BY rx_ts DESC"
|
||||||
dbc.execute(query, {"context_dest": context_dest, "before_ts": before, "after_ts": after})
|
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:
|
else:
|
||||||
query = "select * from lxm where dest=:context_dest or source=:context_dest"
|
query = f"select * from lxm where {base_condition} ORDER BY rx_ts DESC"
|
||||||
dbc.execute(query, {"context_dest": context_dest})
|
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()
|
result = dbc.fetchall()
|
||||||
|
|
||||||
|
|
@ -3031,10 +3045,8 @@ class SidebandCore():
|
||||||
lxm.paper_packed = paper_packed_lxm
|
lxm.paper_packed = paper_packed_lxm
|
||||||
|
|
||||||
extras = None
|
extras = None
|
||||||
try:
|
try: extras = msgpack.unpackb(entry[11])
|
||||||
extras = msgpack.unpackb(entry[11])
|
except: pass
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
message = {
|
message = {
|
||||||
"hash": lxm.hash,
|
"hash": lxm.hash,
|
||||||
|
|
@ -3051,8 +3063,9 @@ class SidebandCore():
|
||||||
}
|
}
|
||||||
|
|
||||||
messages.append(message)
|
messages.append(message)
|
||||||
if len(messages) > limit:
|
|
||||||
messages = messages[-limit:]
|
messages.reverse()
|
||||||
|
if len(messages) > limit: messages = messages[-limit:]
|
||||||
return messages
|
return messages
|
||||||
|
|
||||||
def _db_save_lxm(self, lxm, context_dest, originator = False, own_command = False, is_retry = False):
|
def _db_save_lxm(self, lxm, context_dest, originator = False, own_command = False, is_retry = False):
|
||||||
|
|
@ -3095,7 +3108,13 @@ class SidebandCore():
|
||||||
else:
|
else:
|
||||||
RNS.log("Received telemetry stream field with no data: "+str(lxm.fields[LXMF.FIELD_TELEMETRY_STREAM]), RNS.LOG_DEBUG)
|
RNS.log("Received telemetry stream field with no data: "+str(lxm.fields[LXMF.FIELD_TELEMETRY_STREAM]), RNS.LOG_DEBUG)
|
||||||
|
|
||||||
if own_command or len(lxm.content) != 0 or len(lxm.title) != 0:
|
attach_msg = False
|
||||||
|
if lxm.fields != None and len(lxm.fields) > 0:
|
||||||
|
if LXMF.FIELD_IMAGE in lxm.fields: attach_msg = True
|
||||||
|
if LXMF.FIELD_AUDIO in lxm.fields: attach_msg = True
|
||||||
|
if LXMF.FIELD_FILE_ATTACHMENTS in lxm.fields: attach_msg = True
|
||||||
|
|
||||||
|
if own_command or len(lxm.content) != 0 or len(lxm.title) != 0 or attach_msg:
|
||||||
with self.db_lock:
|
with self.db_lock:
|
||||||
db = self.__db_connect()
|
db = self.__db_connect()
|
||||||
dbc = db.cursor()
|
dbc = db.cursor()
|
||||||
|
|
@ -3260,42 +3279,31 @@ class SidebandCore():
|
||||||
|
|
||||||
def update_telemetry(self):
|
def update_telemetry(self):
|
||||||
try:
|
try:
|
||||||
try:
|
try: latest_telemetry = deepcopy(self.latest_telemetry)
|
||||||
latest_telemetry = deepcopy(self.latest_telemetry)
|
except: latest_telemetry = None
|
||||||
except:
|
|
||||||
latest_telemetry = None
|
|
||||||
|
|
||||||
telemetry = self.get_telemetry()
|
telemetry = self.get_telemetry()
|
||||||
packed_telemetry = self.get_packed_telemetry()
|
packed_telemetry = self.get_packed_telemetry()
|
||||||
telemetry_changed = False
|
telemetry_changed = False
|
||||||
|
|
||||||
if telemetry != None and packed_telemetry != None:
|
if telemetry != None and packed_telemetry != None:
|
||||||
if latest_telemetry == None or len(telemetry) != len(latest_telemetry):
|
if latest_telemetry == None or len(telemetry) != len(latest_telemetry): telemetry_changed = True
|
||||||
telemetry_changed = True
|
|
||||||
|
|
||||||
if latest_telemetry != None:
|
if latest_telemetry != None:
|
||||||
|
|
||||||
if not telemetry_changed:
|
if not telemetry_changed:
|
||||||
for sn in telemetry:
|
for sn in telemetry:
|
||||||
if telemetry_changed:
|
if telemetry_changed: break
|
||||||
break
|
|
||||||
|
|
||||||
if sn != "time":
|
if sn != "time":
|
||||||
if sn in latest_telemetry:
|
if sn in latest_telemetry:
|
||||||
if telemetry[sn] != latest_telemetry[sn]:
|
if telemetry[sn] != latest_telemetry[sn]: telemetry_changed = True
|
||||||
telemetry_changed = True
|
else: telemetry_changed = True
|
||||||
else:
|
|
||||||
telemetry_changed = True
|
|
||||||
|
|
||||||
if not telemetry_changed:
|
if not telemetry_changed:
|
||||||
for sn in latest_telemetry:
|
for sn in latest_telemetry:
|
||||||
|
if telemetry_changed: break
|
||||||
if telemetry_changed:
|
|
||||||
break
|
|
||||||
|
|
||||||
if sn != "time":
|
if sn != "time":
|
||||||
if not sn in telemetry:
|
if not sn in telemetry: telemetry_changed = True
|
||||||
telemetry_changed = True
|
|
||||||
|
|
||||||
if telemetry_changed:
|
if telemetry_changed:
|
||||||
self.telemetry_changes += 1
|
self.telemetry_changes += 1
|
||||||
|
|
@ -3304,10 +3312,8 @@ class SidebandCore():
|
||||||
self.setstate("app.flags.last_telemetry", time.time())
|
self.setstate("app.flags.last_telemetry", time.time())
|
||||||
|
|
||||||
if self.is_client:
|
if self.is_client:
|
||||||
try:
|
try: self.service_set_latest_telemetry(self.latest_telemetry, self.latest_packed_telemetry)
|
||||||
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:
|
|
||||||
RNS.log("Error while sending latest telemetry to service: "+str(e), RNS.LOG_ERROR)
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
import traceback
|
import traceback
|
||||||
|
|
@ -3397,14 +3403,10 @@ class SidebandCore():
|
||||||
def is_known(self, dest_hash):
|
def is_known(self, dest_hash):
|
||||||
try:
|
try:
|
||||||
source_identity = RNS.Identity.recall(dest_hash)
|
source_identity = RNS.Identity.recall(dest_hash)
|
||||||
|
if source_identity: return True
|
||||||
|
else: return False
|
||||||
|
|
||||||
if source_identity:
|
except Exception as e: return False
|
||||||
return True
|
|
||||||
else:
|
|
||||||
return False
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
return False
|
|
||||||
|
|
||||||
def request_key(self, dest_hash):
|
def request_key(self, dest_hash):
|
||||||
try:
|
try:
|
||||||
|
|
@ -3498,7 +3500,6 @@ class SidebandCore():
|
||||||
if not self.interface_local.had_peers and have_peers:
|
if not self.interface_local.had_peers and have_peers:
|
||||||
RNS.log("Peers became reachable on the interface "+str(self.interface_local), RNS.LOG_DEBUG)
|
RNS.log("Peers became reachable on the interface "+str(self.interface_local), RNS.LOG_DEBUG)
|
||||||
needs_if_change_announce = True
|
needs_if_change_announce = True
|
||||||
announce_attached_interface = self.interface_local
|
|
||||||
announce_delay = 10
|
announce_delay = 10
|
||||||
|
|
||||||
if self.interface_local.had_peers and not have_peers:
|
if self.interface_local.had_peers and not have_peers:
|
||||||
|
|
@ -4433,17 +4434,16 @@ class SidebandCore():
|
||||||
if message.state == LXMF.LXMessage.FAILED and hasattr(message, "try_propagation_on_fail") and message.try_propagation_on_fail:
|
if message.state == LXMF.LXMessage.FAILED and hasattr(message, "try_propagation_on_fail") and message.try_propagation_on_fail:
|
||||||
if hasattr(message, "stamp_generation_failed") and message.stamp_generation_failed == True:
|
if hasattr(message, "stamp_generation_failed") and message.stamp_generation_failed == True:
|
||||||
RNS.log(f"Could not send {message} due to a stamp generation failure", RNS.LOG_ERROR)
|
RNS.log(f"Could not send {message} due to a stamp generation failure", RNS.LOG_ERROR)
|
||||||
if not no_display:
|
if not no_display: self.lxm_ingest(message, originator=True)
|
||||||
self.lxm_ingest(message, originator=True)
|
|
||||||
else:
|
else:
|
||||||
RNS.log("Direct delivery of "+str(message)+" failed. Retrying as propagated message.", RNS.LOG_VERBOSE)
|
RNS.log("Direct delivery of "+str(message)+" failed. Retrying as propagated message.", RNS.LOG_VERBOSE)
|
||||||
message.try_propagation_on_fail = None
|
message.try_propagation_on_fail = None
|
||||||
message.delivery_attempts = 0
|
message.delivery_attempts = 0
|
||||||
if hasattr(message, "next_delivery_attempt"):
|
if hasattr(message, "next_delivery_attempt"): del message.next_delivery_attempt
|
||||||
del message.next_delivery_attempt
|
|
||||||
message.packed = None
|
message.packed = None
|
||||||
message.desired_method = LXMF.LXMessage.PROPAGATED
|
message.desired_method = LXMF.LXMessage.PROPAGATED
|
||||||
self._db_message_set_method(message.hash, LXMF.LXMessage.PROPAGATED)
|
self._db_message_set_method(message.hash, LXMF.LXMessage.PROPAGATED)
|
||||||
|
self._db_message_set_state(message.hash, LXMF.LXMessage.OUTBOUND)
|
||||||
self.message_router.handle_outbound(message)
|
self.message_router.handle_outbound(message)
|
||||||
else:
|
else:
|
||||||
if not no_display:
|
if not no_display:
|
||||||
|
|
|
||||||
266
sbapp/ui/guide.py
Normal file
266
sbapp/ui/guide.py
Normal file
|
|
@ -0,0 +1,266 @@
|
||||||
|
import time
|
||||||
|
import RNS
|
||||||
|
|
||||||
|
from typing import Union
|
||||||
|
from kivy.metrics import dp,sp
|
||||||
|
from kivy.lang.builder import Builder
|
||||||
|
from kivy.core.clipboard import Clipboard
|
||||||
|
from kivy.utils import escape_markup
|
||||||
|
from kivymd.uix.recycleview import MDRecycleView
|
||||||
|
from kivymd.uix.list import OneLineIconListItem
|
||||||
|
from kivymd.uix.pickers import MDColorPicker
|
||||||
|
from kivymd.uix.button import MDRectangleFlatButton
|
||||||
|
from kivymd.uix.button import MDRectangleFlatIconButton
|
||||||
|
from kivymd.uix.dialog import MDDialog
|
||||||
|
from kivy.properties import StringProperty, BooleanProperty, OptionProperty, ColorProperty, Property
|
||||||
|
from kivymd.uix.list import MDList, IconLeftWidget, IconRightWidget, OneLineAvatarIconListItem
|
||||||
|
from kivymd.icon_definitions import md_icons
|
||||||
|
from kivymd.toast import toast
|
||||||
|
from kivy.properties import StringProperty, BooleanProperty
|
||||||
|
from kivy.effects.scroll import ScrollEffect
|
||||||
|
|
||||||
|
if RNS.vendor.platformutils.get_platform() == "android":
|
||||||
|
from ui.helpers import dark_theme_text_color
|
||||||
|
else:
|
||||||
|
from .helpers import dark_theme_text_color
|
||||||
|
|
||||||
|
class Guide():
|
||||||
|
def __init__(self, app):
|
||||||
|
self.app = app
|
||||||
|
self.screen = None
|
||||||
|
|
||||||
|
if not self.app.root.ids.screen_manager.has_screen("guide_screen"):
|
||||||
|
self.screen = Builder.load_string(layout_guide_screen)
|
||||||
|
self.screen.app = self
|
||||||
|
self.app.root.ids.screen_manager.add_widget(self.screen)
|
||||||
|
|
||||||
|
def link_exec(sender=None, event=None):
|
||||||
|
def lj(): webbrowser.open("https://unsigned.io/donate")
|
||||||
|
threading.Thread(target=lj, daemon=True).start()
|
||||||
|
|
||||||
|
guide_text1 = """
|
||||||
|
[size=18dp][b]Introduction[/b][/size][size=5dp]\n \n[/size]Welcome to [i]Sideband[/i], an LXMF client for Android, Linux, macOS and Windows. With Sideband, you can communicate with other people or LXMF-compatible systems over Reticulum networks using LoRa, Packet Radio, WiFi, I2P, or anything else Reticulum supports.
|
||||||
|
|
||||||
|
This short guide will give you a basic introduction to the concepts that underpin Sideband and LXMF (which is the protocol that Sideband uses to communicate). If you are not already familiar with LXMF and Reticulum, it is probably a good idea to read this guide, since Sideband is very different from other messaging apps."""
|
||||||
|
guide_text2 = """
|
||||||
|
[size=18dp][b]Communication Without Subjection[/b][/size][size=5dp]\n \n[/size]Sideband is completely free, permission-less, anonymous and infrastructure-less. Sideband uses the peer-to-peer and distributed messaging system LXMF. There is no sign-up, no service providers, no "end-user license agreements", no data theft and no surveillance. You own the system.
|
||||||
|
|
||||||
|
This also means that Sideband operates differently than what you might be used to. It does not need a connection to a server on the Internet to function, and you do not have an account anywhere."""
|
||||||
|
|
||||||
|
guide_text3 = """
|
||||||
|
[size=18dp][b]Operating Principles[/b][/size][size=5dp]\n \n[/size]When Sideband is started on your device for the first time, it randomly generates a 512-bit Reticulum Identity Key. This cryptographic key is then used to create an LXMF address for your use, and in turn to secure any communication to your address. Any other endpoint in [i]any[/i] Reticulum network will be able to send data to your address, as long as there is [i]some sort of physical connection[/i] between your device and the remote endpoint. You can also move around to other Reticulum networks with this address, even ones that were never connected to the network the address was created on, or that didn't exist when the address was created.\n\nYour LXMF address is yours to keep and control for as long (or short) a time you need it, and you can always delete it and create a new one. You identity keys and corresponding addresses are never registered on or controlled by any external servers or services, and will never leave your device, unless you manually export them for backup."""
|
||||||
|
|
||||||
|
guide_text10 = """
|
||||||
|
[size=18dp][b]Getting Connected[/b][/size][size=5dp]\n \n[/size]If you already have Reticulum connectivity set up on the device you are running Sideband on, no further configuration should be necessary, and Sideband will simply use the available Reticulum connectivity.\n\nIf you are running Sideband on a computer, you can configure interfaces in the Reticulum configuration file ([b]~/.reticulum/config[/b] by default). If you are running Sideband on an Android device, you can configure various interface types in the [b]Connectivity[/b] section. By default, only an [i]AutoInterface[/i] is enabled, which will connect you automatically with any other local devices on the same WiFi and/or Ethernet networks. This may or may not include Reticulum Transport Nodes, which can route your traffic to wider networks.\n\nYou can enable any or all of the other available interface types to gain wider connectivity. For more specific information on interface types, configuration options, and how to effectively build your own Reticulum networks, see the [b]Reticulum Manual[b]."""
|
||||||
|
|
||||||
|
guide_text4 = """
|
||||||
|
[size=18dp][b]Becoming Reachable[/b][/size][size=5dp]\n \n[/size]To establish reachability for any Reticulum destination on a network, an [i]announce[/i] must be sent. By default, Sideband will announce automatically when necessary, but if you want to stay silent, automatic announces can be disabled in [b]Preferences[/b].\n\nTo send an announce manually, press the [i]Announce[/i] button in the [i]Conversations[/i] section of the program. When you send an announce, you make your LXMF address reachable for real-time messaging to the entire network you are connected to. Even in very large networks, you can expect global reachability for your address to be established in under a minute.
|
||||||
|
|
||||||
|
If you don't move to other places in the network, and keep connected through the same hubs or gateways, it is generally not necessary to send an announce more often than once every week. If you change your entry point to the network, you may want to send an announce, or you may just want to stay quiet."""
|
||||||
|
|
||||||
|
guide_text5 = """
|
||||||
|
[size=18dp][b]Relax & Disconnect[/b][/size][size=5dp]\n \n[/size]If you are not connected to the network, it is still possible for other people to message you, as long as one or more [i]Propagation Nodes[/i] exist on the network. These nodes pick up and hold encrypted in-transit messages for offline users. Messages are always encrypted before leaving the originators device, and nobody else than the intended recipient can decrypt messages in transit.
|
||||||
|
|
||||||
|
The Propagation Nodes also distribute copies of messages between each other, such that even the failure of almost every node in the network will still allow users to sync their waiting messages. If all Propagation Nodes disappear or are destroyed, users can still communicate directly.\n\nReticulum and LXMF will degrade gracefully all the way down to single users communicating directly via long-range data radios. Anyone can start up new propagation nodes and integrate them into existing networks without permission or coordination. Even a small and cheap device like a Rasperry Pi can handle messages for millions of users. LXMF networks are designed to be quite resilient, as long as there are people using them."""
|
||||||
|
|
||||||
|
guide_text6 = """
|
||||||
|
[size=18dp][b]Packets Find A Way[/b][/size][size=5dp]\n \n[/size]Connections in Reticulum networks can be wired or wireless, span many intermediary hops, run over fast links or ultra-low bandwidth radio, tunnel over the Invisible Internet (I2P), private networks, satellite connections, serial lines or anything else that Reticulum can carry data over.\n\nIn most cases it will not be possible to know what path packets takes in a Reticulum network, and apart from a destination hash, no transmitted packets carries any identifying characteristics. In Reticulum, [i]there is no source addresses[/i].\n\nAs long as you do not reveal any connecting details between your person and your LXMF address, you can remain anonymous. Sending messages to others does not reveal [i]your[/i] address to anyone else than the intended recipient."""
|
||||||
|
|
||||||
|
guide_text7 = """
|
||||||
|
[size=18dp][b]Be Yourself, Be Unknown, Stay Free[/b][/size][size=5dp]\n \n[/size]Even with the above characteristics in mind, you [b]must remember[/b] that LXMF and Reticulum is not a technology that can guarantee anonymising connections that are already de-anonymised! If you use Sideband to connect to TCP Reticulum hubs over the clear Internet, from a network that can be tied to your personal identity, an adversary may learn that you are generating LXMF traffic.\n\nIf you want to avoid this, it is recommended to use I2P to connect to Reticulum hubs on the Internet. Or only connecting from within pure Reticulum networks, that take one or more hops to reach connections that span the Internet. This is a complex topic, with many more nuances than can be covered here. You are encouraged to ask on the various Reticulum discussion forums if you are in doubt.
|
||||||
|
|
||||||
|
If you use Reticulum and LXMF on hardware that does not carry any identifiers tied to you, it is possible to establish a completely free and identification-less communication system with Reticulum and LXMF clients."""
|
||||||
|
|
||||||
|
guide_text8 = """
|
||||||
|
[size=18dp][b]Keyboard Shortcuts[/b][/size][size=5dp]\n \n[/size]To ease navigation and operation of the program, Sideband has keyboard shortcuts mapped to the most common actions. A reference is included below.
|
||||||
|
|
||||||
|
[b]Quick Actions[/b]
|
||||||
|
- [b]Ctrl-W[/b] Go back
|
||||||
|
- [b]Ctrl-Q[/b] Shut down Sideband
|
||||||
|
- [b]Ctrl-R[/b] Start LXMF sync (from Conversations screen)
|
||||||
|
- [b]Ctrl-N[/b] Create new conversation
|
||||||
|
|
||||||
|
[b]Message Actions[/b]
|
||||||
|
- [b]Ctrl-Shift-A[/b] add message attachment
|
||||||
|
- [b]Ctrl-Shift-V[/b] add high-quality voice
|
||||||
|
- [b]Ctrl-Shift-C[/b] add low-bandwidth voice
|
||||||
|
- [b]Ctrl-Shift-I[/b] add medium-quality image
|
||||||
|
- [b]Ctrl-Shift-F[/b] add file
|
||||||
|
- [b]Ctrl-D[/b] or [b]Ctrl-S[/b] Send message
|
||||||
|
|
||||||
|
[b]Voice & PTT Messages[/b]
|
||||||
|
- [b]Space[/b] Start/stop recording
|
||||||
|
- [b]Enter[/b] Save recording to message
|
||||||
|
- With PTT enabled, hold [b]Space[/b] to talk
|
||||||
|
|
||||||
|
[b]Voice Calls[/b]
|
||||||
|
- [b]Ctrl-Space[/b] Answer incoming call
|
||||||
|
- [b]Ctrl-.[/b] Reject incoming call
|
||||||
|
- [b]Ctrl-.[/b] Hang up active call
|
||||||
|
|
||||||
|
[b]Navigation[/b]
|
||||||
|
- [b]Ctrl-[i]n[/i][/b] Go to conversation number [i]n[/i]
|
||||||
|
- [b]Ctrl-R[/b] Go to Conversations
|
||||||
|
- [b]Ctrl-O[/b] Go to Objects & Devices
|
||||||
|
- [b]Ctrl-E[/b] Go to Voice
|
||||||
|
- [b]Ctrl-L[/b] Go to Announce Stream
|
||||||
|
- [b]Ctrl-M[/b] Go to Situation Map
|
||||||
|
- [b]Ctrl-U[/b] Go to Utilities
|
||||||
|
- [b]Ctrl-T[/b] Go to Telemetry configuration
|
||||||
|
- [b]Ctrl-G[/b] Go to Guide
|
||||||
|
- [b]Ctrl-Y[/b] Display own telemetry
|
||||||
|
|
||||||
|
[b]Map Controls[/b]
|
||||||
|
- [b]Up[/b], [b]down[/b], [b]left[/b], [b]right[/b] Navigate
|
||||||
|
- [b]W[/b], [b]A[/b], [b]S[/b], [b]D[/b] Navigate
|
||||||
|
- [b]H[/b], [b]J[/b], [b]L[/b], [b]K[/b] Navigate
|
||||||
|
- [b]E[/b] or [b]+[/b] Zoom in
|
||||||
|
- [b]Q[/b] or [b]-[/b] Zoom out
|
||||||
|
- Hold [b]Shift[/b] to navigate more coarsely
|
||||||
|
- Hold [b]Alt[/b] to navigate more finely"""
|
||||||
|
|
||||||
|
guide_text9 = """
|
||||||
|
[size=18dp][b]Please Support This Project[/b][/size][size=5dp]\n \n[/size]It took me more than eight years to design and build the entire ecosystem of software and hardware that makes this possible. If this project is valuable to you, please go to [u][ref=link]https://unsigned.io/donate[/ref][/u] to support the project with a donation. Every donation directly makes the entire Reticulum project possible.
|
||||||
|
|
||||||
|
Thank you very much for using Free Communications Systems.
|
||||||
|
"""
|
||||||
|
info1 = guide_text1
|
||||||
|
info2 = guide_text8
|
||||||
|
info3 = guide_text2
|
||||||
|
info4 = guide_text3
|
||||||
|
info10 = guide_text10
|
||||||
|
info5 = guide_text4
|
||||||
|
info6 = guide_text5
|
||||||
|
info7 = guide_text6
|
||||||
|
info8 = guide_text7
|
||||||
|
info9 = guide_text9
|
||||||
|
|
||||||
|
if self.app.theme_cls.theme_style == "Dark":
|
||||||
|
info1 = "[color=#"+dark_theme_text_color+"]"+info1+"[/color]"
|
||||||
|
info2 = "[color=#"+dark_theme_text_color+"]"+info2+"[/color]"
|
||||||
|
info3 = "[color=#"+dark_theme_text_color+"]"+info3+"[/color]"
|
||||||
|
info4 = "[color=#"+dark_theme_text_color+"]"+info4+"[/color]"
|
||||||
|
info5 = "[color=#"+dark_theme_text_color+"]"+info5+"[/color]"
|
||||||
|
info6 = "[color=#"+dark_theme_text_color+"]"+info6+"[/color]"
|
||||||
|
info7 = "[color=#"+dark_theme_text_color+"]"+info7+"[/color]"
|
||||||
|
info8 = "[color=#"+dark_theme_text_color+"]"+info8+"[/color]"
|
||||||
|
info9 = "[color=#"+dark_theme_text_color+"]"+info9+"[/color]"
|
||||||
|
info10 = "[color=#"+dark_theme_text_color+"]"+info10+"[/color]"
|
||||||
|
self.screen.ids.guide_info1.text = info1
|
||||||
|
self.screen.ids.guide_info2.text = info2
|
||||||
|
self.screen.ids.guide_info3.text = info3
|
||||||
|
self.screen.ids.guide_info4.text = info4
|
||||||
|
self.screen.ids.guide_info5.text = info5
|
||||||
|
self.screen.ids.guide_info6.text = info6
|
||||||
|
self.screen.ids.guide_info7.text = info7
|
||||||
|
self.screen.ids.guide_info8.text = info8
|
||||||
|
self.screen.ids.guide_info9.text = info9
|
||||||
|
self.screen.ids.guide_info10.text = info10
|
||||||
|
self.screen.ids.guide_info9.bind(on_ref_press=link_exec)
|
||||||
|
self.screen.ids.guide_scrollview.effect_cls = ScrollEffect
|
||||||
|
|
||||||
|
layout_guide_screen = """
|
||||||
|
MDScreen:
|
||||||
|
name: "guide_screen"
|
||||||
|
|
||||||
|
BoxLayout:
|
||||||
|
orientation: "vertical"
|
||||||
|
|
||||||
|
MDTopAppBar:
|
||||||
|
title: "Guide"
|
||||||
|
anchor_title: "left"
|
||||||
|
elevation: 0
|
||||||
|
left_action_items:
|
||||||
|
[ ['menu', lambda x: root.app.app.nav_drawer.set_state("open")] ]
|
||||||
|
right_action_items:
|
||||||
|
[ ['close', lambda x: root.app.app.close_guide_action(self)] ]
|
||||||
|
|
||||||
|
ScrollView:
|
||||||
|
id:guide_scrollview
|
||||||
|
|
||||||
|
MDBoxLayout:
|
||||||
|
orientation: "vertical"
|
||||||
|
size_hint_y: None
|
||||||
|
height: self.minimum_height
|
||||||
|
padding: [dp(35), dp(16), dp(35), dp(16)]
|
||||||
|
|
||||||
|
MDLabel:
|
||||||
|
id: guide_info1
|
||||||
|
markup: True
|
||||||
|
text: ""
|
||||||
|
size_hint_y: None
|
||||||
|
text_size: self.width, None
|
||||||
|
height: self.texture_size[1]
|
||||||
|
|
||||||
|
MDLabel:
|
||||||
|
id: guide_info2
|
||||||
|
markup: True
|
||||||
|
text: ""
|
||||||
|
size_hint_y: None
|
||||||
|
text_size: self.width, None
|
||||||
|
height: self.texture_size[1]
|
||||||
|
|
||||||
|
MDLabel:
|
||||||
|
id: guide_info3
|
||||||
|
markup: True
|
||||||
|
text: ""
|
||||||
|
size_hint_y: None
|
||||||
|
text_size: self.width, None
|
||||||
|
height: self.texture_size[1]
|
||||||
|
|
||||||
|
MDLabel:
|
||||||
|
id: guide_info4
|
||||||
|
markup: True
|
||||||
|
text: ""
|
||||||
|
size_hint_y: None
|
||||||
|
text_size: self.width, None
|
||||||
|
height: self.texture_size[1]
|
||||||
|
|
||||||
|
MDLabel:
|
||||||
|
id: guide_info10
|
||||||
|
markup: True
|
||||||
|
text: ""
|
||||||
|
size_hint_y: None
|
||||||
|
text_size: self.width, None
|
||||||
|
height: self.texture_size[1]
|
||||||
|
|
||||||
|
MDLabel:
|
||||||
|
id: guide_info5
|
||||||
|
markup: True
|
||||||
|
text: ""
|
||||||
|
size_hint_y: None
|
||||||
|
text_size: self.width, None
|
||||||
|
height: self.texture_size[1]
|
||||||
|
|
||||||
|
MDLabel:
|
||||||
|
id: guide_info6
|
||||||
|
markup: True
|
||||||
|
text: ""
|
||||||
|
size_hint_y: None
|
||||||
|
text_size: self.width, None
|
||||||
|
height: self.texture_size[1]
|
||||||
|
|
||||||
|
MDLabel:
|
||||||
|
id: guide_info7
|
||||||
|
markup: True
|
||||||
|
text: ""
|
||||||
|
size_hint_y: None
|
||||||
|
text_size: self.width, None
|
||||||
|
height: self.texture_size[1]
|
||||||
|
|
||||||
|
MDLabel:
|
||||||
|
id: guide_info8
|
||||||
|
markup: True
|
||||||
|
text: ""
|
||||||
|
size_hint_y: None
|
||||||
|
text_size: self.width, None
|
||||||
|
height: self.texture_size[1]
|
||||||
|
|
||||||
|
MDLabel:
|
||||||
|
id: guide_info9
|
||||||
|
markup: True
|
||||||
|
text: ""
|
||||||
|
size_hint_y: None
|
||||||
|
text_size: self.width, None
|
||||||
|
height: self.texture_size[1]
|
||||||
|
"""
|
||||||
1690
sbapp/ui/hardware.py
Normal file
1690
sbapp/ui/hardware.py
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -43,6 +43,8 @@ color_failed_alt = "Red"
|
||||||
color_unknown_alt = "Gray"
|
color_unknown_alt = "Gray"
|
||||||
color_cancelled_alt = "Red"
|
color_cancelled_alt = "Red"
|
||||||
|
|
||||||
|
dark_theme_text_color = "ddd"
|
||||||
|
|
||||||
class ContentNavigationDrawer(Screen):
|
class ContentNavigationDrawer(Screen):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
||||||
274
sbapp/ui/keys.py
Normal file
274
sbapp/ui/keys.py
Normal file
|
|
@ -0,0 +1,274 @@
|
||||||
|
import time
|
||||||
|
import RNS
|
||||||
|
|
||||||
|
import base64
|
||||||
|
import threading
|
||||||
|
from kivy.metrics import dp,sp
|
||||||
|
from kivy.lang.builder import Builder
|
||||||
|
from kivy.core.clipboard import Clipboard
|
||||||
|
from kivymd.uix.button import MDRectangleFlatButton
|
||||||
|
from kivymd.uix.dialog import MDDialog
|
||||||
|
from kivymd.toast import toast
|
||||||
|
from kivy.effects.scroll import ScrollEffect
|
||||||
|
|
||||||
|
if RNS.vendor.platformutils.get_platform() == "android":
|
||||||
|
from ui.helpers import dark_theme_text_color
|
||||||
|
else:
|
||||||
|
from .helpers import dark_theme_text_color
|
||||||
|
|
||||||
|
class Keys():
|
||||||
|
def __init__(self, app):
|
||||||
|
self.app = app
|
||||||
|
self.keys_screen = None
|
||||||
|
|
||||||
|
if not self.app.root.ids.screen_manager.has_screen("keys_screen"):
|
||||||
|
self.keys_screen = Builder.load_string(layout_keys_screen)
|
||||||
|
self.keys_screen.app = self
|
||||||
|
self.app.root.ids.screen_manager.add_widget(self.keys_screen)
|
||||||
|
self.app.bind_clipboard_actions(self.keys_screen.ids)
|
||||||
|
|
||||||
|
self.keys_screen.ids.keys_scrollview.effect_cls = ScrollEffect
|
||||||
|
info1 = "[size=18dp][b]Encryption Keys[/b][/size][size=5dp]\n \n[/size]Your primary encryption keys are stored in a Reticulum Identity within the Sideband app. If you want to backup this Identity for later use on this or another device, you can export it as a plain text blob, with the key data encoded in Base32 format. This will allow you to restore your address in Sideband or other LXMF clients at a later point.\n\n[b]Warning![/b] Anyone that gets access to the key data will be able to control your LXMF address, impersonate you, and read your messages. It is [b]extremely important[/b] that you keep the Identity data secure if you export it.\n\nBefore displaying or exporting your Identity data, make sure that no machine or person in your vicinity is able to see, copy or record your device screen or similar."
|
||||||
|
info2 = "[size=18dp][b]Backup & Restore[/b][/size][size=5dp]\n \n[/size]You can backup your entire Sideband profile for import on a computer or other device. The exported backup archive will be saved in the downloads folder of your device. Please note that the exported archive contains all your messages, data and encryption keys. Take extreme care to keep this archive secure."
|
||||||
|
|
||||||
|
if not RNS.vendor.platformutils.get_platform() == "android":
|
||||||
|
self.app.widget_hide(self.keys_screen.ids.keys_share)
|
||||||
|
|
||||||
|
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
|
||||||
|
import plyer
|
||||||
|
from .helpers import file_ts_format
|
||||||
|
from kivy.clock import Clock
|
||||||
|
output_path = plyer.storagepath.get_downloads_dir()
|
||||||
|
time_str = time.strftime(file_ts_format, time.localtime(time.time()))
|
||||||
|
target_file = f"{output_path}/sideband_backup_{time_str}.tar.gz"
|
||||||
|
tar = tarfile.open(target_file, "w:gz")
|
||||||
|
tar.add(f"{self.app.sideband.app_dir}/app_storage", arcname="Sideband Backup")
|
||||||
|
tar.close()
|
||||||
|
|
||||||
|
def job(dt):
|
||||||
|
self.keys_screen.ids.keys_backup.disabled = False
|
||||||
|
toast("Backup done")
|
||||||
|
ok_button = MDRectangleFlatButton(text="OK",font_size=dp(18))
|
||||||
|
dialog = MDDialog(text=f"Backup has been saved to {target_file}",
|
||||||
|
buttons=[ok_button])
|
||||||
|
def dl_yes(s): dialog.dismiss()
|
||||||
|
|
||||||
|
ok_button.bind(on_release=dl_yes)
|
||||||
|
dialog.open()
|
||||||
|
|
||||||
|
Clock.schedule_once(job, 0.3)
|
||||||
|
|
||||||
|
def profile_backup_action(self, sender=None):
|
||||||
|
self.keys_screen.ids.keys_backup.disabled = True
|
||||||
|
toast("Creating backup...")
|
||||||
|
threading.Thread(target=self._profile_backup_job, daemon=True).start()
|
||||||
|
|
||||||
|
def identity_display_action(self, sender=None):
|
||||||
|
yes_button = MDRectangleFlatButton(text="OK",font_size=dp(18))
|
||||||
|
|
||||||
|
dialog = MDDialog(
|
||||||
|
text="Your Identity key, in base32 format is as follows:\n\n[b]"+str(base64.b32encode(self.app.sideband.identity.get_private_key()).decode("utf-8"))+"[/b]",
|
||||||
|
buttons=[ yes_button ],
|
||||||
|
# elevation=0,
|
||||||
|
)
|
||||||
|
def dl_yes(s):
|
||||||
|
dialog.dismiss()
|
||||||
|
|
||||||
|
yes_button.bind(on_release=dl_yes)
|
||||||
|
dialog.open()
|
||||||
|
|
||||||
|
def identity_copy_action(self, sender=None):
|
||||||
|
c_yes_button = MDRectangleFlatButton(text="Yes",font_size=dp(18), theme_text_color="Custom", line_color=self.app.color_reject, text_color=self.app.color_reject)
|
||||||
|
c_no_button = MDRectangleFlatButton(text="No, go back",font_size=dp(18))
|
||||||
|
c_dialog = MDDialog(text="[b]Caution![/b]\n\nYour Identity key will be copied to the system clipboard. Take extreme care that no untrusted app steals your key by reading the clipboard data. Clear the system clipboard immediately after pasting your key where you need it.\n\nAre you sure that you wish to proceed?", buttons=[ c_no_button, c_yes_button ])
|
||||||
|
def c_dl_no(s):
|
||||||
|
c_dialog.dismiss()
|
||||||
|
def c_dl_yes(s):
|
||||||
|
c_dialog.dismiss()
|
||||||
|
yes_button = MDRectangleFlatButton(text="OK")
|
||||||
|
dialog = MDDialog(text="Your Identity key was copied to the system clipboard", buttons=[ yes_button ])
|
||||||
|
def dl_yes(s):
|
||||||
|
dialog.dismiss()
|
||||||
|
yes_button.bind(on_release=dl_yes)
|
||||||
|
|
||||||
|
Clipboard.copy(str(base64.b32encode(self.app.sideband.identity.get_private_key()).decode("utf-8")))
|
||||||
|
dialog.open()
|
||||||
|
|
||||||
|
c_yes_button.bind(on_release=c_dl_yes)
|
||||||
|
c_no_button.bind(on_release=c_dl_no)
|
||||||
|
|
||||||
|
c_dialog.open()
|
||||||
|
|
||||||
|
def identity_share_action(self, sender=None):
|
||||||
|
if RNS.vendor.platformutils.get_platform() == "android":
|
||||||
|
self.share_text(str(base64.b32encode(self.app.sideband.identity.get_private_key()).decode("utf-8")))
|
||||||
|
|
||||||
|
def identity_restore_action(self, sender=None):
|
||||||
|
c_yes_button = MDRectangleFlatButton(text="Yes",font_size=dp(18), theme_text_color="Custom", line_color=self.app.color_reject, text_color=self.app.color_reject)
|
||||||
|
c_no_button = MDRectangleFlatButton(text="No, go back",font_size=dp(18))
|
||||||
|
c_dialog = MDDialog(text="[b]Caution![/b]\n\nYou are about to import a new Identity key into Sideband. The currently active key will be irreversibly destroyed, and you will loose your LXMF address if you have not already backed up your current Identity key.\n\nAre you sure that you wish to import the key?", buttons=[ c_no_button, c_yes_button ])
|
||||||
|
def c_dl_no(s):
|
||||||
|
c_dialog.dismiss()
|
||||||
|
def c_dl_yes(s):
|
||||||
|
c_dialog.dismiss()
|
||||||
|
b32_text = self.keys_screen.ids.key_restore_text.text
|
||||||
|
|
||||||
|
try:
|
||||||
|
key_bytes = base64.b32decode(b32_text)
|
||||||
|
new_id = RNS.Identity.from_bytes(key_bytes)
|
||||||
|
|
||||||
|
if new_id != None:
|
||||||
|
new_id.to_file(self.app.sideband.identity_path)
|
||||||
|
|
||||||
|
yes_button = MDRectangleFlatButton(text="OK",font_size=dp(18))
|
||||||
|
dialog = MDDialog(text="[b]The provided Identity key data was imported[/b]\n\nThe app will now exit. Please restart Sideband to use the new Identity.", buttons=[ yes_button ])
|
||||||
|
def dl_yes(s):
|
||||||
|
dialog.dismiss()
|
||||||
|
self.app.quit_action(sender=self)
|
||||||
|
yes_button.bind(on_release=dl_yes)
|
||||||
|
dialog.open()
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
yes_button = MDRectangleFlatButton(text="OK",font_size=dp(18))
|
||||||
|
dialog = MDDialog(text="[b]The provided Identity key data was not valid[/b]\n\nThe error reported by Reticulum was:\n\n[i]"+str(e)+"[/i]\n\nNo Identity was imported into Sideband.", buttons=[ yes_button ])
|
||||||
|
def dl_yes(s):
|
||||||
|
dialog.dismiss()
|
||||||
|
yes_button.bind(on_release=dl_yes)
|
||||||
|
dialog.open()
|
||||||
|
|
||||||
|
|
||||||
|
c_yes_button.bind(on_release=c_dl_yes)
|
||||||
|
c_no_button.bind(on_release=c_dl_no)
|
||||||
|
|
||||||
|
c_dialog.open()
|
||||||
|
|
||||||
|
|
||||||
|
layout_keys_screen = """
|
||||||
|
MDScreen:
|
||||||
|
name: "keys_screen"
|
||||||
|
|
||||||
|
BoxLayout:
|
||||||
|
orientation: "vertical"
|
||||||
|
|
||||||
|
MDTopAppBar:
|
||||||
|
title: "Backup & Keys"
|
||||||
|
anchor_title: "left"
|
||||||
|
elevation: 0
|
||||||
|
left_action_items:
|
||||||
|
[['menu', lambda x: root.app.app.nav_drawer.set_state("open")]]
|
||||||
|
right_action_items:
|
||||||
|
[
|
||||||
|
['close', lambda x: root.app.app.close_keys_action(self)],
|
||||||
|
]
|
||||||
|
|
||||||
|
ScrollView:
|
||||||
|
id:keys_scrollview
|
||||||
|
|
||||||
|
MDBoxLayout:
|
||||||
|
orientation: "vertical"
|
||||||
|
spacing: "24dp"
|
||||||
|
size_hint_y: None
|
||||||
|
height: self.minimum_height
|
||||||
|
padding: [dp(35), dp(35), dp(35), dp(35)]
|
||||||
|
|
||||||
|
|
||||||
|
MDLabel:
|
||||||
|
id: backup_info
|
||||||
|
markup: True
|
||||||
|
text: ""
|
||||||
|
size_hint_y: None
|
||||||
|
text_size: self.width, None
|
||||||
|
height: self.texture_size[1]
|
||||||
|
|
||||||
|
MDRectangleFlatIconButton:
|
||||||
|
id: keys_backup
|
||||||
|
icon: "home-export-outline"
|
||||||
|
text: "Backup Sideband Profile"
|
||||||
|
padding: [dp(0), dp(14), dp(0), dp(14)]
|
||||||
|
icon_size: dp(24)
|
||||||
|
font_size: dp(16)
|
||||||
|
size_hint: [1.0, None]
|
||||||
|
on_release: root.app.profile_backup_action(self)
|
||||||
|
|
||||||
|
MDRectangleFlatIconButton:
|
||||||
|
id: keys_restore
|
||||||
|
icon: "home-import-outline"
|
||||||
|
text: "Restore Sideband Profile"
|
||||||
|
disabled: True
|
||||||
|
padding: [dp(0), dp(14), dp(0), dp(14)]
|
||||||
|
icon_size: dp(24)
|
||||||
|
font_size: dp(16)
|
||||||
|
size_hint: [1.0, None]
|
||||||
|
on_release: root.app.profile_backup_action(self)
|
||||||
|
|
||||||
|
MDLabel:
|
||||||
|
id: keys_info
|
||||||
|
markup: True
|
||||||
|
text: ""
|
||||||
|
size_hint_y: None
|
||||||
|
text_size: self.width, None
|
||||||
|
height: self.texture_size[1]
|
||||||
|
|
||||||
|
MDRectangleFlatIconButton:
|
||||||
|
id: keys_display
|
||||||
|
icon: "eye"
|
||||||
|
text: "Display Identity Key"
|
||||||
|
padding: [dp(0), dp(14), dp(0), dp(14)]
|
||||||
|
icon_size: dp(24)
|
||||||
|
font_size: dp(16)
|
||||||
|
size_hint: [1.0, None]
|
||||||
|
on_release: root.app.identity_display_action(self)
|
||||||
|
|
||||||
|
MDRectangleFlatIconButton:
|
||||||
|
id: keys_copy
|
||||||
|
icon: "file-key"
|
||||||
|
text: "Copy Key To Clipboard"
|
||||||
|
padding: [dp(0), dp(14), dp(0), dp(14)]
|
||||||
|
icon_size: dp(24)
|
||||||
|
font_size: dp(16)
|
||||||
|
size_hint: [1.0, None]
|
||||||
|
on_release: root.app.identity_copy_action(self)
|
||||||
|
|
||||||
|
MDRectangleFlatIconButton:
|
||||||
|
id: keys_share
|
||||||
|
icon: "upload-lock"
|
||||||
|
text: "Send Key To Other App"
|
||||||
|
padding: [dp(0), dp(14), dp(0), dp(14)]
|
||||||
|
icon_size: dp(24)
|
||||||
|
font_size: dp(16)
|
||||||
|
size_hint: [1.0, None]
|
||||||
|
on_release: root.app.identity_share_action(self)
|
||||||
|
|
||||||
|
MDBoxLayout:
|
||||||
|
orientation: "vertical"
|
||||||
|
# spacing: "24dp"
|
||||||
|
size_hint_y: None
|
||||||
|
height: self.minimum_height
|
||||||
|
padding: [dp(0), dp(12), dp(0), dp(0)]
|
||||||
|
|
||||||
|
MDTextField:
|
||||||
|
id: key_restore_text
|
||||||
|
hint_text: "Enter base32 key for import"
|
||||||
|
mode: "rectangle"
|
||||||
|
# size_hint: [1.0, None]
|
||||||
|
pos_hint: {"center_x": .5}
|
||||||
|
|
||||||
|
MDRectangleFlatIconButton:
|
||||||
|
id: keys_restore
|
||||||
|
icon: "download-lock"
|
||||||
|
text: "Restore Identity From Key"
|
||||||
|
padding: [dp(0), dp(14), dp(0), dp(14)]
|
||||||
|
icon_size: dp(24)
|
||||||
|
font_size: dp(16)
|
||||||
|
size_hint: [1.0, None]
|
||||||
|
on_release: root.app.identity_restore_action(self)
|
||||||
|
"""
|
||||||
|
|
@ -849,114 +849,6 @@ MDScreen:
|
||||||
# font_size: dp(24)
|
# font_size: dp(24)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
layout_guide_screen = """
|
|
||||||
MDScreen:
|
|
||||||
name: "guide_screen"
|
|
||||||
|
|
||||||
BoxLayout:
|
|
||||||
orientation: "vertical"
|
|
||||||
|
|
||||||
MDTopAppBar:
|
|
||||||
title: "Guide"
|
|
||||||
anchor_title: "left"
|
|
||||||
elevation: 0
|
|
||||||
left_action_items:
|
|
||||||
[['menu', lambda x: root.app.nav_drawer.set_state("open")]]
|
|
||||||
right_action_items:
|
|
||||||
[
|
|
||||||
['close', lambda x: root.app.close_guide_action(self)],
|
|
||||||
]
|
|
||||||
|
|
||||||
ScrollView:
|
|
||||||
id:guide_scrollview
|
|
||||||
|
|
||||||
MDBoxLayout:
|
|
||||||
orientation: "vertical"
|
|
||||||
size_hint_y: None
|
|
||||||
height: self.minimum_height
|
|
||||||
padding: [dp(35), dp(16), dp(35), dp(16)]
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
id: guide_info1
|
|
||||||
markup: True
|
|
||||||
text: ""
|
|
||||||
size_hint_y: None
|
|
||||||
text_size: self.width, None
|
|
||||||
height: self.texture_size[1]
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
id: guide_info2
|
|
||||||
markup: True
|
|
||||||
text: ""
|
|
||||||
size_hint_y: None
|
|
||||||
text_size: self.width, None
|
|
||||||
height: self.texture_size[1]
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
id: guide_info3
|
|
||||||
markup: True
|
|
||||||
text: ""
|
|
||||||
size_hint_y: None
|
|
||||||
text_size: self.width, None
|
|
||||||
height: self.texture_size[1]
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
id: guide_info4
|
|
||||||
markup: True
|
|
||||||
text: ""
|
|
||||||
size_hint_y: None
|
|
||||||
text_size: self.width, None
|
|
||||||
height: self.texture_size[1]
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
id: guide_info10
|
|
||||||
markup: True
|
|
||||||
text: ""
|
|
||||||
size_hint_y: None
|
|
||||||
text_size: self.width, None
|
|
||||||
height: self.texture_size[1]
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
id: guide_info5
|
|
||||||
markup: True
|
|
||||||
text: ""
|
|
||||||
size_hint_y: None
|
|
||||||
text_size: self.width, None
|
|
||||||
height: self.texture_size[1]
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
id: guide_info6
|
|
||||||
markup: True
|
|
||||||
text: ""
|
|
||||||
size_hint_y: None
|
|
||||||
text_size: self.width, None
|
|
||||||
height: self.texture_size[1]
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
id: guide_info7
|
|
||||||
markup: True
|
|
||||||
text: ""
|
|
||||||
size_hint_y: None
|
|
||||||
text_size: self.width, None
|
|
||||||
height: self.texture_size[1]
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
id: guide_info8
|
|
||||||
markup: True
|
|
||||||
text: ""
|
|
||||||
size_hint_y: None
|
|
||||||
text_size: self.width, None
|
|
||||||
height: self.texture_size[1]
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
id: guide_info9
|
|
||||||
markup: True
|
|
||||||
text: ""
|
|
||||||
size_hint_y: None
|
|
||||||
text_size: self.width, None
|
|
||||||
height: self.texture_size[1]
|
|
||||||
"""
|
|
||||||
|
|
||||||
layout_information_screen = """
|
layout_information_screen = """
|
||||||
MDScreen:
|
MDScreen:
|
||||||
name: "information_screen"
|
name: "information_screen"
|
||||||
|
|
@ -1161,127 +1053,6 @@ MDScreen:
|
||||||
id: map_layout
|
id: map_layout
|
||||||
"""
|
"""
|
||||||
|
|
||||||
layout_keys_screen = """
|
|
||||||
MDScreen:
|
|
||||||
name: "keys_screen"
|
|
||||||
|
|
||||||
BoxLayout:
|
|
||||||
orientation: "vertical"
|
|
||||||
|
|
||||||
MDTopAppBar:
|
|
||||||
title: "Backup & Keys"
|
|
||||||
anchor_title: "left"
|
|
||||||
elevation: 0
|
|
||||||
left_action_items:
|
|
||||||
[['menu', lambda x: root.app.nav_drawer.set_state("open")]]
|
|
||||||
right_action_items:
|
|
||||||
[
|
|
||||||
['close', lambda x: root.app.close_keys_action(self)],
|
|
||||||
]
|
|
||||||
|
|
||||||
ScrollView:
|
|
||||||
id:keys_scrollview
|
|
||||||
|
|
||||||
MDBoxLayout:
|
|
||||||
orientation: "vertical"
|
|
||||||
spacing: "24dp"
|
|
||||||
size_hint_y: None
|
|
||||||
height: self.minimum_height
|
|
||||||
padding: [dp(35), dp(35), dp(35), dp(35)]
|
|
||||||
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
id: backup_info
|
|
||||||
markup: True
|
|
||||||
text: ""
|
|
||||||
size_hint_y: None
|
|
||||||
text_size: self.width, None
|
|
||||||
height: self.texture_size[1]
|
|
||||||
|
|
||||||
MDRectangleFlatIconButton:
|
|
||||||
id: keys_backup
|
|
||||||
icon: "home-export-outline"
|
|
||||||
text: "Backup Sideband Profile"
|
|
||||||
padding: [dp(0), dp(14), dp(0), dp(14)]
|
|
||||||
icon_size: dp(24)
|
|
||||||
font_size: dp(16)
|
|
||||||
size_hint: [1.0, None]
|
|
||||||
on_release: root.app.profile_backup_action(self)
|
|
||||||
|
|
||||||
MDRectangleFlatIconButton:
|
|
||||||
id: keys_restore
|
|
||||||
icon: "home-import-outline"
|
|
||||||
text: "Restore Sideband Profile"
|
|
||||||
disabled: True
|
|
||||||
padding: [dp(0), dp(14), dp(0), dp(14)]
|
|
||||||
icon_size: dp(24)
|
|
||||||
font_size: dp(16)
|
|
||||||
size_hint: [1.0, None]
|
|
||||||
on_release: root.app.profile_backup_action(self)
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
id: keys_info
|
|
||||||
markup: True
|
|
||||||
text: ""
|
|
||||||
size_hint_y: None
|
|
||||||
text_size: self.width, None
|
|
||||||
height: self.texture_size[1]
|
|
||||||
|
|
||||||
MDRectangleFlatIconButton:
|
|
||||||
id: keys_display
|
|
||||||
icon: "eye"
|
|
||||||
text: "Display Identity Key"
|
|
||||||
padding: [dp(0), dp(14), dp(0), dp(14)]
|
|
||||||
icon_size: dp(24)
|
|
||||||
font_size: dp(16)
|
|
||||||
size_hint: [1.0, None]
|
|
||||||
on_release: root.app.identity_display_action(self)
|
|
||||||
|
|
||||||
MDRectangleFlatIconButton:
|
|
||||||
id: keys_copy
|
|
||||||
icon: "file-key"
|
|
||||||
text: "Copy Key To Clipboard"
|
|
||||||
padding: [dp(0), dp(14), dp(0), dp(14)]
|
|
||||||
icon_size: dp(24)
|
|
||||||
font_size: dp(16)
|
|
||||||
size_hint: [1.0, None]
|
|
||||||
on_release: root.app.identity_copy_action(self)
|
|
||||||
|
|
||||||
MDRectangleFlatIconButton:
|
|
||||||
id: keys_share
|
|
||||||
icon: "upload-lock"
|
|
||||||
text: "Send Key To Other App"
|
|
||||||
padding: [dp(0), dp(14), dp(0), dp(14)]
|
|
||||||
icon_size: dp(24)
|
|
||||||
font_size: dp(16)
|
|
||||||
size_hint: [1.0, None]
|
|
||||||
on_release: root.app.identity_share_action(self)
|
|
||||||
|
|
||||||
MDBoxLayout:
|
|
||||||
orientation: "vertical"
|
|
||||||
# spacing: "24dp"
|
|
||||||
size_hint_y: None
|
|
||||||
height: self.minimum_height
|
|
||||||
padding: [dp(0), dp(12), dp(0), dp(0)]
|
|
||||||
|
|
||||||
MDTextField:
|
|
||||||
id: key_restore_text
|
|
||||||
hint_text: "Enter base32 key for import"
|
|
||||||
mode: "rectangle"
|
|
||||||
# size_hint: [1.0, None]
|
|
||||||
pos_hint: {"center_x": .5}
|
|
||||||
|
|
||||||
MDRectangleFlatIconButton:
|
|
||||||
id: keys_restore
|
|
||||||
icon: "download-lock"
|
|
||||||
text: "Restore Identity From Key"
|
|
||||||
padding: [dp(0), dp(14), dp(0), dp(14)]
|
|
||||||
icon_size: dp(24)
|
|
||||||
font_size: dp(16)
|
|
||||||
size_hint: [1.0, None]
|
|
||||||
on_release: root.app.identity_restore_action(self)
|
|
||||||
"""
|
|
||||||
|
|
||||||
layout_plugins_screen = """
|
layout_plugins_screen = """
|
||||||
MDScreen:
|
MDScreen:
|
||||||
name: "plugins_screen"
|
name: "plugins_screen"
|
||||||
|
|
@ -2207,717 +1978,3 @@ MDScreen:
|
||||||
text_size: self.width, None
|
text_size: self.width, None
|
||||||
height: self.texture_size[1]
|
height: self.texture_size[1]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
layout_hardware_screen = """
|
|
||||||
MDScreen:
|
|
||||||
name: "hardware_screen"
|
|
||||||
|
|
||||||
BoxLayout:
|
|
||||||
orientation: "vertical"
|
|
||||||
|
|
||||||
MDTopAppBar:
|
|
||||||
title: "Hardware"
|
|
||||||
anchor_title: "left"
|
|
||||||
elevation: 0
|
|
||||||
left_action_items:
|
|
||||||
[['menu', lambda x: root.app.nav_drawer.set_state("open")]]
|
|
||||||
right_action_items:
|
|
||||||
[
|
|
||||||
['close', lambda x: root.app.close_hardware_action(self)],
|
|
||||||
]
|
|
||||||
|
|
||||||
ScrollView:
|
|
||||||
id: hardware_scrollview
|
|
||||||
|
|
||||||
MDBoxLayout:
|
|
||||||
orientation: "vertical"
|
|
||||||
spacing: "8dp"
|
|
||||||
size_hint_y: None
|
|
||||||
height: self.minimum_height
|
|
||||||
padding: [dp(28), dp(48), dp(28), dp(16)]
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
text: "Configure Hardware Parameters\\n"
|
|
||||||
font_style: "H6"
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
id: hardware_info
|
|
||||||
markup: True
|
|
||||||
text: ""
|
|
||||||
size_hint_y: None
|
|
||||||
text_size: self.width, None
|
|
||||||
height: self.texture_size[1]
|
|
||||||
|
|
||||||
|
|
||||||
MDBoxLayout:
|
|
||||||
orientation: "vertical"
|
|
||||||
spacing: "24dp"
|
|
||||||
size_hint_y: None
|
|
||||||
height: self.minimum_height
|
|
||||||
padding: [dp(0), dp(35), dp(0), dp(35)]
|
|
||||||
|
|
||||||
MDRectangleFlatIconButton:
|
|
||||||
id: hardware_rnode_button
|
|
||||||
icon: "radio-handheld"
|
|
||||||
text: "RNode"
|
|
||||||
padding: [dp(0), dp(14), dp(0), dp(14)]
|
|
||||||
icon_size: dp(24)
|
|
||||||
font_size: dp(16)
|
|
||||||
size_hint: [1.0, None]
|
|
||||||
on_release: root.app.hardware_rnode_action(self)
|
|
||||||
|
|
||||||
MDRectangleFlatIconButton:
|
|
||||||
id: hardware_modem_button
|
|
||||||
icon: "router-wireless"
|
|
||||||
text: "Radio Modem"
|
|
||||||
padding: [dp(0), dp(14), dp(0), dp(14)]
|
|
||||||
icon_size: dp(24)
|
|
||||||
font_size: dp(16)
|
|
||||||
size_hint: [1.0, None]
|
|
||||||
on_release: root.app.hardware_modem_action(self)
|
|
||||||
disabled: False
|
|
||||||
|
|
||||||
MDRectangleFlatIconButton:
|
|
||||||
id: hardware_serial_button
|
|
||||||
icon: "cable-data"
|
|
||||||
text: "Serial Port"
|
|
||||||
padding: [dp(0), dp(14), dp(0), dp(14)]
|
|
||||||
icon_size: dp(24)
|
|
||||||
font_size: dp(16)
|
|
||||||
size_hint: [1.0, None]
|
|
||||||
on_release: root.app.hardware_serial_action(self)
|
|
||||||
disabled: False
|
|
||||||
"""
|
|
||||||
|
|
||||||
layout_hardware_modem_screen = """
|
|
||||||
MDScreen:
|
|
||||||
name: "hardware_modem_screen"
|
|
||||||
|
|
||||||
BoxLayout:
|
|
||||||
orientation: "vertical"
|
|
||||||
|
|
||||||
MDTopAppBar:
|
|
||||||
title: "Radio Modem"
|
|
||||||
anchor_title: "left"
|
|
||||||
elevation: 0
|
|
||||||
left_action_items:
|
|
||||||
[['menu', lambda x: root.app.nav_drawer.set_state("open")]]
|
|
||||||
right_action_items:
|
|
||||||
[
|
|
||||||
['close', lambda x: root.app.close_sub_hardware_action(self)],
|
|
||||||
]
|
|
||||||
|
|
||||||
ScrollView:
|
|
||||||
id: hardware_modem_scrollview
|
|
||||||
|
|
||||||
MDBoxLayout:
|
|
||||||
orientation: "vertical"
|
|
||||||
spacing: "8dp"
|
|
||||||
size_hint_y: None
|
|
||||||
height: self.minimum_height
|
|
||||||
padding: [dp(28), dp(48), dp(28), dp(16)]
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
text: "Modem Hardware Parameters\\n"
|
|
||||||
font_style: "H6"
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
id: hardware_modem_info
|
|
||||||
markup: True
|
|
||||||
text: "To communicate using a Radio Modem, you will need to specify the following parameters. Serial port parameters must be set to match those of the modem. CSMA parameters can be left at their default values in most cases.\\n"
|
|
||||||
size_hint_y: None
|
|
||||||
text_size: self.width, None
|
|
||||||
height: self.texture_size[1]
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
text: "Port Options"
|
|
||||||
font_style: "H6"
|
|
||||||
|
|
||||||
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_modem_baudrate
|
|
||||||
hint_text: "Baud Rate"
|
|
||||||
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_modem_databits
|
|
||||||
hint_text: "Data Bits"
|
|
||||||
text: ""
|
|
||||||
font_size: dp(24)
|
|
||||||
|
|
||||||
MDTextField:
|
|
||||||
id: hardware_modem_parity
|
|
||||||
hint_text: "Parity"
|
|
||||||
text: ""
|
|
||||||
font_size: dp(24)
|
|
||||||
|
|
||||||
MDTextField:
|
|
||||||
id: hardware_modem_stopbits
|
|
||||||
hint_text: "Stop Bits"
|
|
||||||
text: ""
|
|
||||||
font_size: dp(24)
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
text: "CSMA Parameters"
|
|
||||||
font_style: "H6"
|
|
||||||
|
|
||||||
MDBoxLayout:
|
|
||||||
orientation: "horizontal"
|
|
||||||
spacing: "24dp"
|
|
||||||
size_hint_y: None
|
|
||||||
height: self.minimum_height
|
|
||||||
padding: [dp(0), dp(0), dp(0), dp(0)]
|
|
||||||
|
|
||||||
MDTextField:
|
|
||||||
id: hardware_modem_preamble
|
|
||||||
hint_text: "Preamble (ms)"
|
|
||||||
text: ""
|
|
||||||
font_size: dp(24)
|
|
||||||
|
|
||||||
MDTextField:
|
|
||||||
id: hardware_modem_tail
|
|
||||||
hint_text: "TX Tail (ms)"
|
|
||||||
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_modem_persistence
|
|
||||||
hint_text: "Persistence (1-255)"
|
|
||||||
text: ""
|
|
||||||
font_size: dp(24)
|
|
||||||
|
|
||||||
MDTextField:
|
|
||||||
id: hardware_modem_slottime
|
|
||||||
hint_text: "Slot Time (ms)"
|
|
||||||
text: ""
|
|
||||||
font_size: dp(24)
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
text: "Optional Settings"
|
|
||||||
font_style: "H6"
|
|
||||||
|
|
||||||
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_modem_beaconinterval
|
|
||||||
hint_text: "Beacon Interval (seconds)"
|
|
||||||
text: ""
|
|
||||||
font_size: dp(24)
|
|
||||||
|
|
||||||
MDTextField:
|
|
||||||
id: hardware_modem_beacondata
|
|
||||||
hint_text: "Beacon Data"
|
|
||||||
text: ""
|
|
||||||
font_size: dp(24)
|
|
||||||
"""
|
|
||||||
|
|
||||||
layout_hardware_rnode_screen = """
|
|
||||||
MDScreen:
|
|
||||||
name: "hardware_rnode_screen"
|
|
||||||
|
|
||||||
BoxLayout:
|
|
||||||
orientation: "vertical"
|
|
||||||
|
|
||||||
MDTopAppBar:
|
|
||||||
title: "RNode"
|
|
||||||
anchor_title: "left"
|
|
||||||
elevation: 0
|
|
||||||
left_action_items:
|
|
||||||
[['menu', lambda x: root.app.nav_drawer.set_state("open")]]
|
|
||||||
right_action_items:
|
|
||||||
[
|
|
||||||
['close', lambda x: root.app.close_sub_hardware_action(self)],
|
|
||||||
]
|
|
||||||
|
|
||||||
ScrollView:
|
|
||||||
id: hardware_rnode_scrollview
|
|
||||||
|
|
||||||
MDBoxLayout:
|
|
||||||
orientation: "vertical"
|
|
||||||
spacing: "8dp"
|
|
||||||
size_hint_y: None
|
|
||||||
height: self.minimum_height
|
|
||||||
padding: [dp(28), dp(48), dp(28), dp(16)]
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
text: "RNode Hardware Parameters\\n"
|
|
||||||
font_style: "H6"
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
id: hardware_rnode_info
|
|
||||||
markup: True
|
|
||||||
text: "To communicate using an RNode, you will need to specify the following parameters. For two or more RNodes to be able to communicate, all parameters must match, except for the [i]Coding Rate[/i] and [i]TX Power[/i] parameter, which can vary between devices.\\n"
|
|
||||||
size_hint_y: None
|
|
||||||
text_size: self.width, None
|
|
||||||
height: self.texture_size[1]
|
|
||||||
|
|
||||||
MDBoxLayout:
|
|
||||||
orientation: "horizontal"
|
|
||||||
spacing: "24dp"
|
|
||||||
size_hint_y: None
|
|
||||||
height: self.minimum_height
|
|
||||||
padding: [dp(0), dp(0), dp(0), dp(48)]
|
|
||||||
|
|
||||||
MDRectangleFlatIconButton:
|
|
||||||
id: rnode_mote_export
|
|
||||||
icon: "upload"
|
|
||||||
text: "Export"
|
|
||||||
padding: [dp(0), dp(14), dp(0), dp(14)]
|
|
||||||
icon_size: dp(24)
|
|
||||||
font_size: dp(16)
|
|
||||||
size_hint: [1.0, None]
|
|
||||||
on_release: root.app.hardware_rnode_export(self)
|
|
||||||
|
|
||||||
MDRectangleFlatIconButton:
|
|
||||||
id: rnode_mote_import
|
|
||||||
icon: "download"
|
|
||||||
text: "Import"
|
|
||||||
padding: [dp(0), dp(14), dp(0), dp(14)]
|
|
||||||
icon_size: dp(24)
|
|
||||||
font_size: dp(16)
|
|
||||||
size_hint: [1.0, None]
|
|
||||||
on_release: root.app.hardware_rnode_import(self)
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
text: "Radio Options\\n"
|
|
||||||
font_style: "H6"
|
|
||||||
|
|
||||||
# MDTextField:
|
|
||||||
# id: hardware_rnode_modulation
|
|
||||||
# hint_text: "Modulation"
|
|
||||||
# text: "LoRa"
|
|
||||||
# disabled: True
|
|
||||||
# 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(35)]
|
|
||||||
|
|
||||||
MDTextField:
|
|
||||||
id: hardware_rnode_frequency
|
|
||||||
hint_text: "Frequency (MHz)"
|
|
||||||
text: ""
|
|
||||||
font_size: dp(24)
|
|
||||||
|
|
||||||
MDTextField:
|
|
||||||
id: hardware_rnode_bandwidth
|
|
||||||
hint_text: "Bandwidth (KHz)"
|
|
||||||
text: ""
|
|
||||||
font_size: dp(24)
|
|
||||||
|
|
||||||
MDTextField:
|
|
||||||
id: hardware_rnode_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_spreadingfactor
|
|
||||||
hint_text: "Spreading Factor"
|
|
||||||
text: ""
|
|
||||||
font_size: dp(24)
|
|
||||||
|
|
||||||
MDTextField:
|
|
||||||
id: hardware_rnode_codingrate
|
|
||||||
hint_text: "Coding Rate"
|
|
||||||
text: ""
|
|
||||||
font_size: dp(24)
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
text: "Optional Settings"
|
|
||||||
font_style: "H6"
|
|
||||||
|
|
||||||
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"
|
|
||||||
spacing: "24dp"
|
|
||||||
size_hint_y: None
|
|
||||||
height: self.minimum_height
|
|
||||||
# padding: [dp(0), dp(0), dp(0), dp(35)]
|
|
||||||
|
|
||||||
MDTextField:
|
|
||||||
id: hardware_rnode_atl_short
|
|
||||||
hint_text: "Airime Limit % (15s)"
|
|
||||||
text: ""
|
|
||||||
font_size: dp(24)
|
|
||||||
|
|
||||||
MDTextField:
|
|
||||||
id: hardware_rnode_atl_long
|
|
||||||
hint_text: "Airime Limit % (1h)"
|
|
||||||
text: ""
|
|
||||||
font_size: dp(24)
|
|
||||||
|
|
||||||
MDBoxLayout:
|
|
||||||
orientation: "horizontal"
|
|
||||||
size_hint_y: None
|
|
||||||
padding: [0,dp(14),dp(24),dp(0)]
|
|
||||||
height: dp(48)
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
text: "Control RNode Display"
|
|
||||||
font_style: "H6"
|
|
||||||
|
|
||||||
MDSwitch:
|
|
||||||
id: hardware_rnode_framebuffer
|
|
||||||
pos_hint: {"center_y": 0.3}
|
|
||||||
active: False
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
text: "•"
|
|
||||||
font_style: "H6"
|
|
||||||
text_size: self.size
|
|
||||||
halign: "center"
|
|
||||||
size_hint_y: None
|
|
||||||
height: self.texture_size[1]
|
|
||||||
padding: [0, dp(2+14), 0, dp(22+24)]
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
text: "WiFi & Ethernet Connection\\n"
|
|
||||||
font_style: "H6"
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
id: hardware_rnode_info_wifi
|
|
||||||
markup: True
|
|
||||||
text: "If your device is hosting or connected to a WiFi network, you can connect it by entering its IP address or hostname below."
|
|
||||||
size_hint_y: None
|
|
||||||
text_size: self.width, None
|
|
||||||
height: self.texture_size[1]
|
|
||||||
|
|
||||||
MDBoxLayout:
|
|
||||||
orientation: "horizontal"
|
|
||||||
size_hint_y: None
|
|
||||||
padding: [0,dp(12),dp(24),dp(0)]
|
|
||||||
height: dp(36)
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
text: "Connect using WiFi"
|
|
||||||
font_style: "H6"
|
|
||||||
|
|
||||||
MDSwitch:
|
|
||||||
id: hardware_rnode_tcp
|
|
||||||
pos_hint: {"center_y": 0.3}
|
|
||||||
active: False
|
|
||||||
|
|
||||||
MDBoxLayout:
|
|
||||||
orientation: "vertical"
|
|
||||||
# spacing: "24dp"
|
|
||||||
size_hint_y: None
|
|
||||||
height: self.minimum_height
|
|
||||||
# padding: [dp(0), dp(0), dp(0), dp(35)]
|
|
||||||
|
|
||||||
MDTextField:
|
|
||||||
id: hardware_rnode_tcp_host
|
|
||||||
hint_text: "RNode IP address or hostname"
|
|
||||||
text: ""
|
|
||||||
font_size: dp(24)
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
text: "•"
|
|
||||||
font_style: "H6"
|
|
||||||
text_size: self.size
|
|
||||||
halign: "center"
|
|
||||||
size_hint_y: None
|
|
||||||
height: self.texture_size[1]
|
|
||||||
padding: [0, dp(2+14), 0, dp(22+24)]
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
text: "Bluetooth Connection\\n"
|
|
||||||
font_style: "H6"
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
id: hardware_rnode_info
|
|
||||||
markup: True
|
|
||||||
text: "If you enable connection via Bluetooth, Sideband will attempt to connect to any available and paired RNodes over Bluetooth.\\n\\nIf your RNode uses BLE (ESP32-S3 and nRF devices) instead of classic Bluetooth, enable the [i]Device requires BLE[/i] option as well."
|
|
||||||
size_hint_y: None
|
|
||||||
text_size: self.width, None
|
|
||||||
height: self.texture_size[1]
|
|
||||||
|
|
||||||
MDBoxLayout:
|
|
||||||
orientation: "horizontal"
|
|
||||||
size_hint_y: None
|
|
||||||
padding: [0,0,dp(24),dp(0)]
|
|
||||||
height: dp(48)
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
text: "Connect using Bluetooth"
|
|
||||||
font_style: "H6"
|
|
||||||
|
|
||||||
MDSwitch:
|
|
||||||
id: hardware_rnode_bluetooth
|
|
||||||
pos_hint: {"center_y": 0.3}
|
|
||||||
active: False
|
|
||||||
|
|
||||||
MDBoxLayout:
|
|
||||||
orientation: "horizontal"
|
|
||||||
size_hint_y: None
|
|
||||||
padding: [0,0,dp(24),dp(48)]
|
|
||||||
height: dp(86)
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
text: "Device requires BLE"
|
|
||||||
font_style: "H6"
|
|
||||||
|
|
||||||
MDSwitch:
|
|
||||||
id: hardware_rnode_ble
|
|
||||||
pos_hint: {"center_y": 0.3}
|
|
||||||
active: False
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
text: "Bluetooth Pairing\\n"
|
|
||||||
font_style: "H6"
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
id: hardware_rnode_info
|
|
||||||
markup: True
|
|
||||||
text: "To put an RNode into pairing mode, hold down the multi-function user button for more than 5 seconds, and release it. The display will indicate pairing mode. If the in-app pairing does not find any devices, use the Bluetooth settings of your device to scan and pair.\\n"
|
|
||||||
size_hint_y: None
|
|
||||||
text_size: self.width, None
|
|
||||||
height: self.texture_size[1]
|
|
||||||
|
|
||||||
MDBoxLayout:
|
|
||||||
orientation: "vertical"
|
|
||||||
spacing: "24dp"
|
|
||||||
size_hint_y: None
|
|
||||||
height: self.minimum_height
|
|
||||||
padding: [dp(0), dp(0), dp(0), dp(12)]
|
|
||||||
|
|
||||||
MDRectangleFlatIconButton:
|
|
||||||
id: hardware_rnode_bt_scan_button
|
|
||||||
icon: "bluetooth-connect"
|
|
||||||
text: "Pair New Device"
|
|
||||||
padding: [dp(0), dp(14), dp(0), dp(14)]
|
|
||||||
icon_size: dp(24)
|
|
||||||
font_size: dp(16)
|
|
||||||
size_hint: [1.0, None]
|
|
||||||
on_release: root.app.hardware_rnode_bt_scan_action(self)
|
|
||||||
|
|
||||||
MDBoxLayout:
|
|
||||||
id: rnode_scan_results
|
|
||||||
orientation: "vertical"
|
|
||||||
spacing: "24dp"
|
|
||||||
size_hint_y: None
|
|
||||||
height: self.minimum_height
|
|
||||||
padding: [dp(0), dp(0), dp(0), dp(12+24)]
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
text: "Preffered Bluetooth Device\\n"
|
|
||||||
font_style: "H6"
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
id: hardware_rnode_info
|
|
||||||
markup: True
|
|
||||||
text: "Sideband will connect to the first available RNode that is paired. If you want to always use a specific RNode, you can enter its name here, for example \\"RNode A8EB\\"."
|
|
||||||
size_hint_y: None
|
|
||||||
text_size: self.width, None
|
|
||||||
height: self.texture_size[1]
|
|
||||||
|
|
||||||
MDBoxLayout:
|
|
||||||
orientation: "vertical"
|
|
||||||
spacing: "24dp"
|
|
||||||
size_hint_y: None
|
|
||||||
height: self.minimum_height
|
|
||||||
# padding: [dp(0), dp(0), dp(0), dp(35)]
|
|
||||||
|
|
||||||
MDTextField:
|
|
||||||
id: hardware_rnode_bt_device
|
|
||||||
hint_text: "Preferred RNode Device Name"
|
|
||||||
text: ""
|
|
||||||
font_size: dp(24)
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
text: "•"
|
|
||||||
font_style: "H6"
|
|
||||||
text_size: self.size
|
|
||||||
halign: "center"
|
|
||||||
size_hint_y: None
|
|
||||||
height: self.texture_size[1]
|
|
||||||
padding: [0, dp(2+14), 0, dp(22)]
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
text: "\\n\\nDevice Bluetooth Control\\n"
|
|
||||||
font_style: "H6"
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
id: hardware_rnode_info
|
|
||||||
markup: True
|
|
||||||
text: "\\n\\nIf your RNode does not have a physical pairing button, you can enable Bluetooth and put it into pairing mode by first connecting it via a USB cable, and using the buttons below. When plugging in the RNode over USB, you must grant Sideband permission to the USB device for this to work.\\n\\nYou can also change Bluetooth settings using the \\"rnodeconf\\" utility from a computer.\\n"
|
|
||||||
size_hint_y: None
|
|
||||||
text_size: self.width, None
|
|
||||||
height: self.texture_size[1]
|
|
||||||
|
|
||||||
MDBoxLayout:
|
|
||||||
orientation: "vertical"
|
|
||||||
spacing: "24dp"
|
|
||||||
size_hint_y: None
|
|
||||||
height: self.minimum_height
|
|
||||||
# padding: [dp(0), dp(0), dp(0), dp(35)]
|
|
||||||
|
|
||||||
MDRectangleFlatIconButton:
|
|
||||||
id: hardware_rnode_bt_on_button
|
|
||||||
icon: "bluetooth"
|
|
||||||
text: "Enable Bluetooth"
|
|
||||||
padding: [dp(0), dp(14), dp(0), dp(14)]
|
|
||||||
icon_size: dp(24)
|
|
||||||
font_size: dp(16)
|
|
||||||
size_hint: [1.0, None]
|
|
||||||
on_release: root.app.hardware_rnode_bt_on_action(self)
|
|
||||||
|
|
||||||
MDRectangleFlatIconButton:
|
|
||||||
id: hardware_rnode_bt_off_button
|
|
||||||
icon: "bluetooth-off"
|
|
||||||
text: "Disable Bluetooth"
|
|
||||||
padding: [dp(0), dp(14), dp(0), dp(14)]
|
|
||||||
icon_size: dp(24)
|
|
||||||
font_size: dp(16)
|
|
||||||
size_hint: [1.0, None]
|
|
||||||
on_release: root.app.hardware_rnode_bt_off_action(self)
|
|
||||||
disabled: False
|
|
||||||
|
|
||||||
MDRectangleFlatIconButton:
|
|
||||||
id: hardware_rnode_bt_pair_button
|
|
||||||
icon: "link-variant"
|
|
||||||
text: "Start Pairing Mode"
|
|
||||||
padding: [dp(0), dp(14), dp(0), dp(14)]
|
|
||||||
icon_size: dp(24)
|
|
||||||
font_size: dp(16)
|
|
||||||
size_hint: [1.0, None]
|
|
||||||
on_release: root.app.hardware_rnode_bt_pair_action(self)
|
|
||||||
disabled: False
|
|
||||||
"""
|
|
||||||
|
|
||||||
layout_hardware_serial_screen = """
|
|
||||||
MDScreen:
|
|
||||||
name: "hardware_serial_screen"
|
|
||||||
|
|
||||||
BoxLayout:
|
|
||||||
orientation: "vertical"
|
|
||||||
|
|
||||||
MDTopAppBar:
|
|
||||||
title: "Serial Port"
|
|
||||||
anchor_title: "left"
|
|
||||||
elevation: 0
|
|
||||||
left_action_items:
|
|
||||||
[['menu', lambda x: root.app.nav_drawer.set_state("open")]]
|
|
||||||
right_action_items:
|
|
||||||
[
|
|
||||||
['close', lambda x: root.app.close_sub_hardware_action(self)],
|
|
||||||
]
|
|
||||||
|
|
||||||
ScrollView:
|
|
||||||
id: hardware_serial_scrollview
|
|
||||||
|
|
||||||
MDBoxLayout:
|
|
||||||
orientation: "vertical"
|
|
||||||
spacing: "8dp"
|
|
||||||
size_hint_y: None
|
|
||||||
height: self.minimum_height
|
|
||||||
padding: [dp(28), dp(48), dp(28), dp(16)]
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
text: "Serial Hardware Parameters\\n"
|
|
||||||
font_style: "H6"
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
id: hardware_serial_info
|
|
||||||
markup: True
|
|
||||||
text: "To communicate using a serial port, you will need to specify the following parameters. If communicating directly to another Reticulum instance over serial, the parameters must match the other device.\\n\\nIf you are using a serial-connected device to pass on data to other Reticulum instances, it should be configured to pass data transparently to the desired endpoints.\\n"
|
|
||||||
size_hint_y: None
|
|
||||||
text_size: self.width, None
|
|
||||||
height: self.texture_size[1]
|
|
||||||
|
|
||||||
MDLabel:
|
|
||||||
text: "Port Options"
|
|
||||||
font_style: "H6"
|
|
||||||
|
|
||||||
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_serial_baudrate
|
|
||||||
hint_text: "Baud Rate"
|
|
||||||
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_serial_databits
|
|
||||||
hint_text: "Data Bits"
|
|
||||||
text: ""
|
|
||||||
font_size: dp(24)
|
|
||||||
|
|
||||||
MDTextField:
|
|
||||||
id: hardware_serial_parity
|
|
||||||
hint_text: "Parity"
|
|
||||||
text: ""
|
|
||||||
font_size: dp(24)
|
|
||||||
|
|
||||||
MDTextField:
|
|
||||||
id: hardware_serial_stopbits
|
|
||||||
hint_text: "Stop Bits"
|
|
||||||
text: ""
|
|
||||||
font_size: dp(24)
|
|
||||||
"""
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ from kivy.uix.gridlayout import GridLayout
|
||||||
from kivy.uix.boxlayout import BoxLayout
|
from kivy.uix.boxlayout import BoxLayout
|
||||||
from kivy.clock import Clock
|
from kivy.clock import Clock
|
||||||
from kivy.utils import escape_markup
|
from kivy.utils import escape_markup
|
||||||
|
from kivy.app import App
|
||||||
|
|
||||||
from kivymd.uix.button import MDRectangleFlatButton, MDRectangleFlatIconButton
|
from kivymd.uix.button import MDRectangleFlatButton, MDRectangleFlatIconButton
|
||||||
from kivymd.uix.dialog import MDDialog
|
from kivymd.uix.dialog import MDDialog
|
||||||
|
|
@ -48,18 +49,37 @@ if RNS.vendor.platformutils.is_darwin():
|
||||||
|
|
||||||
from kivy.lang.builder import Builder
|
from kivy.lang.builder import Builder
|
||||||
from kivymd.uix.list import OneLineIconListItem, IconLeftWidget
|
from kivymd.uix.list import OneLineIconListItem, IconLeftWidget
|
||||||
|
import re
|
||||||
|
import webbrowser
|
||||||
|
|
||||||
MSG_RENDER_LIMIT = 11000
|
MSG_RENDER_LIMIT = 11000
|
||||||
|
|
||||||
|
# Match URLs starting with http(s):// or www.
|
||||||
|
_url_pattern = re.compile(r"(https?://[^\s\]]+|www\.[^\s\]]+)")
|
||||||
|
|
||||||
|
|
||||||
|
def _add_url_refs(text: str) -> str:
|
||||||
|
if "[ref=" in text: return text
|
||||||
|
return _url_pattern.sub(r"[u][ref=\1]\1[/ref][/u]", text)
|
||||||
|
|
||||||
class DialogItem(OneLineIconListItem):
|
class DialogItem(OneLineIconListItem):
|
||||||
divider = None
|
divider = None
|
||||||
icon = StringProperty()
|
icon = StringProperty()
|
||||||
|
|
||||||
|
|
||||||
class ListLXMessageCard(MDCard):
|
class ListLXMessageCard(MDCard):
|
||||||
# class ListLXMessageCard(MDCard, FakeRectangularElevationBehavior):
|
# class ListLXMessageCard(MDCard, FakeRectangularElevationBehavior):
|
||||||
text = StringProperty()
|
text = StringProperty()
|
||||||
heading = StringProperty()
|
heading = StringProperty()
|
||||||
|
|
||||||
|
def on_ref_press(self, instance, ref):
|
||||||
|
try:
|
||||||
|
if isinstance(ref, str) and (ref.startswith("http://") or ref.startswith("https://")):
|
||||||
|
webbrowser.open(ref)
|
||||||
|
except Exception as e:
|
||||||
|
RNS.log(f"Error opening URL reference {ref}: {e}", RNS.LOG_ERROR)
|
||||||
|
RNS.trace_exception(e)
|
||||||
|
|
||||||
class Messages():
|
class Messages():
|
||||||
def __init__(self, app, context_dest):
|
def __init__(self, app, context_dest):
|
||||||
self.app = app
|
self.app = app
|
||||||
|
|
@ -251,8 +271,7 @@ class Messages():
|
||||||
else: self.hide_widget(self.ids.message_ptt, True)
|
else: self.hide_widget(self.ids.message_ptt, True)
|
||||||
|
|
||||||
c_ts = time.time()
|
c_ts = time.time()
|
||||||
if len(self.new_messages) > 0:
|
if len(self.new_messages) > 0: self.update_widget()
|
||||||
self.update_widget()
|
|
||||||
|
|
||||||
if (len(self.added_item_hashes) < self.db_message_count) and not self.load_more_button in self.list.children:
|
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))
|
self.list.add_widget(self.load_more_button, len(self.list.children))
|
||||||
|
|
@ -535,7 +554,10 @@ class Messages():
|
||||||
if not ("lxm" in m and m["lxm"] != None and m["lxm"].fields != None and LXMF.FIELD_COMMANDS in m["lxm"].fields):
|
if not ("lxm" in m and m["lxm"] != None and m["lxm"].fields != None and LXMF.FIELD_COMMANDS in m["lxm"].fields):
|
||||||
message_input = "[i]This message contains no text content[/i]".encode("utf-8")
|
message_input = "[i]This message contains no text content[/i]".encode("utf-8")
|
||||||
|
|
||||||
message_markup = multilingual_markup(message_input)
|
# Add clickable URL refs before multilingual font markup is applied
|
||||||
|
message_text_for_markup = message_input.decode("utf-8")
|
||||||
|
message_text_for_markup = _add_url_refs(message_text_for_markup)
|
||||||
|
message_markup = multilingual_markup(message_text_for_markup.encode("utf-8"))
|
||||||
|
|
||||||
txstr = time.strftime(ts_format, time.localtime(m["sent"]))
|
txstr = time.strftime(ts_format, time.localtime(m["sent"]))
|
||||||
rxstr = time.strftime(ts_format, time.localtime(m["received"]))
|
rxstr = time.strftime(ts_format, time.localtime(m["received"]))
|
||||||
|
|
@ -1489,6 +1511,7 @@ Builder.load_string("""
|
||||||
id: content_text
|
id: content_text
|
||||||
text: root.text
|
text: root.text
|
||||||
markup: True
|
markup: True
|
||||||
|
on_ref_press: root.on_ref_press(*args)
|
||||||
size_hint_y: None
|
size_hint_y: None
|
||||||
text_size: self.width, None
|
text_size: self.width, None
|
||||||
height: self.texture_size[1]
|
height: self.texture_size[1]
|
||||||
|
|
|
||||||
6
setup.py
6
setup.py
|
|
@ -114,9 +114,9 @@ setuptools.setup(
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
install_requires=[
|
install_requires=[
|
||||||
"rns>=1.0.4",
|
"rns>=1.2.0",
|
||||||
"lxmf>=0.9.3",
|
"lxmf>=0.9.6",
|
||||||
"lxst>=0.4.5",
|
"lxst>=0.4.6",
|
||||||
"kivy>=2.3.0",
|
"kivy>=2.3.0",
|
||||||
"numpy>=2.0.0",
|
"numpy>=2.0.0",
|
||||||
"pillow>=10.2.0",
|
"pillow>=10.2.0",
|
||||||
|
|
|
||||||
BIN
sideband_1.9.5.rsm
Normal file
BIN
sideband_1.9.5.rsm
Normal file
Binary file not shown.
BIN
sideband_1.9.6.rsm
Normal file
BIN
sideband_1.9.6.rsm
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue