Compare commits

...

1014 commits
0.2.4 ... main

Author SHA1 Message Date
markqvist
1d7670cbd1
Update README.md 2026-11-20 15:03:40 +01:00
markqvist
ef572b58e8
Update CONTRIBUTING.md 2026-10-01 16:59:29 +02:00
markqvist
ccf1b08208
Update README.md 2026-09-27 11:32:57 +02:00
markqvist
7db7c067d5
Update README.md 2026-09-26 22:04:36 +02:00
markqvist
1402bb6a49
Update README.md 2026-08-28 17:36:52 +02:00
markqvist
2000d81a44
Update README.md 2026-07-26 19:43:10 +02:00
markqvist
1dd47f53cc
Update README.md 2026-07-21 23:28:15 +02:00
markqvist
5c2fad8126
Update README.md 2026-07-21 23:27:53 +02:00
markqvist
fa55fb9fae
Update README.md 2026-07-21 23:27:34 +02:00
markqvist
8601d84580
Update README.md 2026-07-03 13:51:23 +02:00
markqvist
863b925011
Update README.md 2026-06-10 20:27:23 +02:00
markqvist
d1b108035a
Update README.md 2026-06-10 20:21:59 +02:00
markqvist
89a0c70635
Update README.md 2026-06-09 22:52:21 +02:00
markqvist
f26a10f0ef
Added manifest 2026-06-01 14:38:40 +02:00
markqvist
cae7152070
Added release manifest 2026-05-29 11:04:33 +02:00
Mark Qvist
cba08b6999 Cleanup 2026-04-27 16:20:08 +02:00
Mark Qvist
9f0d776e3f Added basic Raspberry Pi telemetry plugin example 2026-04-27 16:19:55 +02:00
Mark Qvist
5705e24dde Added basic server telemetry plugin example 2026-04-27 16:19:45 +02:00
Mark Qvist
39f00554a8 Improved announce logging handling 2026-04-23 01:19:55 +02:00
Mark Qvist
fcc0341fe9 Updated versions 2026-04-22 13:42:08 +02:00
Mark Qvist
04908eb45b Versions 2026-04-21 19:17:14 +02:00
Mark Qvist
73b9bd032f Updated versions 2026-04-21 10:51:25 +02:00
Mark Qvist
6f8f4351f6 Fixed message loading performance 2026-04-21 10:24:07 +02:00
Mark Qvist
cd323c9ca8 Background data persist on app pause on Android 2026-04-19 01:31:04 +02:00
Mark Qvist
e798bac4c7 Updated versions 2026-04-18 16:37:33 +02:00
Mark Qvist
2529a70339 Updated makefile 2026-04-13 19:15:33 +02:00
Mark Qvist
75373f3aa0 Fixed button navigation on keys screen 2026-04-13 18:28:15 +02:00
Mark Qvist
73b0f6d4b2 Updated readme 2026-04-13 16:55:25 +02:00
Mark Qvist
aa05ee20d1 Updated resources 2026-04-13 14:51:10 +02:00
Mark Qvist
3a658198ac Cleanup 2026-04-13 14:18:37 +02:00
Mark Qvist
41e9b17940 Cleanup 2026-04-13 14:16:57 +02:00
Mark Qvist
1fe28ae702 Implemented runtime patch to fix broken Kivy on Python 3.14+ 2026-04-13 13:56:55 +02:00
Mark Qvist
606272571a Updated readme 2026-04-13 12:55:32 +02:00
Mark Qvist
b40e83b9b6 Cleanup 2026-04-13 02:00:24 +02:00
Mark Qvist
bd747cadce Formatting 2026-04-13 01:59:21 +02:00
markqvist
2aec5c0be7
Merge pull request #96 from MatthieuTexier/main
Add clickable URL links in message view
2026-04-13 01:55:30 +02:00
Mark Qvist
aead89262f Cleanup 2026-04-13 01:52:59 +02:00
markqvist
51c58efb75
Merge pull request #97 from ant9000/pr/load_plugin_error_handling
Trap and log errors when loading plugins
2026-04-13 01:51:13 +02:00
Mark Qvist
5c37c5f147 Updated version 2026-04-12 20:34:52 +02:00
Mark Qvist
1cf0b567fa Updated versions 2026-04-12 20:03:01 +02:00
Antonio Galea
6053063720 Trap and log errors when loading plugins 2026-01-27 16:03:23 +01:00
matthieu Texier
e7bef4d1fc make links clicable in sideband 2026-01-19 13:26:10 +01:00
Mark Qvist
4e2e0a53e0 Updated versions 2026-01-17 19:10:34 +01:00
Mark Qvist
75f927d340 Updated readme 2026-01-10 21:57:14 +01:00
Mark Qvist
72d70259a2 Added Zen of Reticulum 2026-01-10 21:57:04 +01:00
Mark Qvist
ead24279eb Updated versions 2026-01-10 13:54:15 +01:00
Mark Qvist
bac1d59c5d Fixed attachment messages with no text content not displaying in user interface 2026-01-10 00:27:43 +01:00
Mark Qvist
800616b542 Cleanup 2026-01-09 01:19:56 +01:00
Mark Qvist
63d0e41791 Updated versions 2026-01-04 01:05:59 +01:00
Mark Qvist
b8d0e79c96 Updated readme 2025-12-28 01:05:25 +01:00
Mark Qvist
7786d2a8f1 Cleanup 2025-12-25 22:41:46 +01:00
Mark Qvist
7ddea1e175 Refactored hardware screen 2025-12-25 22:20:34 +01:00
Mark Qvist
2e8a17854e Refactored keys screen 2025-12-25 16:10:16 +01:00
Mark Qvist
199d9f9bdf Cleanup 2025-12-25 15:44:21 +01:00
Mark Qvist
d4cf40c72f Refactored guide screen 2025-12-25 15:40:39 +01:00
Mark Qvist
b12dda51b8 Updated version 2025-12-20 14:53:33 +01:00
Mark Qvist
da834b7539 Fixed invalid announce interface attachment on AutoInterface peer availability after no peers 2025-12-20 00:16:47 +01:00
Mark Qvist
61609de690 Fixed UI message state progress not updating on direct message failure and retry as propagated 2025-12-02 19:10:54 +01:00
Mark Qvist
30c474bade Updated Android build code 2025-11-28 12:47:47 +01:00
Mark Qvist
d97795de9d Fixed repo server not serving space-names 2025-11-27 23:28:29 +01:00
Mark Qvist
96aafe0ced Reduced build size 2025-11-27 23:11:02 +01:00
Mark Qvist
13fb3b299e Automated builds for Windows 2025-11-27 22:56:29 +01:00
Mark Qvist
18d180e3a1 Updated dependency 2025-11-27 15:17:55 +01:00
Mark Qvist
bed2c760e6 Updated readme 2025-11-27 14:43:10 +01:00
Mark Qvist
dfbe58621f Cleanup 2025-11-27 14:01:59 +01:00
Mark Qvist
3560b4c142 Cleanup unneeded dependencies 2025-11-27 13:58:13 +01:00
Mark Qvist
65e08a9d41 Cleanup unneeded dependencies 2025-11-27 13:57:16 +01:00
Mark Qvist
c727abe1ef Cleanup dependencies 2025-11-27 13:46:15 +01:00
Mark Qvist
424c2fcd06 Fixed notifications not displaying on windows. Ignore accidental PTT presses. Cleaned up file path resolution. 2025-11-27 11:11:58 +01:00
Mark Qvist
fbb46a63c7 Cleanup 2025-11-27 02:13:34 +01:00
Mark Qvist
7d5266de05 Handle all audio processing with LXST 2025-11-27 02:12:01 +01:00
Mark Qvist
6808620f0c Cleanup 2025-11-26 22:14:49 +01:00
Mark Qvist
e6a4ab919a Fix codec2 decode target rate 2025-11-26 19:04:22 +01:00
Mark Qvist
f8a84cfa58 Enabled full audio messaging support on Windows and macOS 2025-11-26 18:52:03 +01:00
Mark Qvist
e3c0da0375 Use LXST for LXMF voice message handling 2025-11-26 18:48:22 +01:00
Mark Qvist
8541fce028 Use LXST to play audio message contents. Adds support for audio message playback on Windows and macOS. 2025-11-26 13:18:38 +01:00
Mark Qvist
ab42d8d502 Updated readme 2025-11-25 11:03:53 +01:00
Mark Qvist
beb5788e86 Updated readme 2025-11-25 10:57:47 +01:00
Mark Qvist
0e8b1d41cf Updated readme 2025-11-25 10:57:01 +01:00
Mark Qvist
0a781464a6 Updated readme 2025-11-25 10:56:12 +01:00
Mark Qvist
13be8031d9 Updated readme 2025-11-25 10:55:35 +01:00
Mark Qvist
1311b99ba0 Updated readme 2025-11-25 10:55:03 +01:00
Mark Qvist
b97bba07db Updated readme 2025-11-25 10:53:51 +01:00
Mark Qvist
467b63671c Updated readme 2025-11-24 23:50:24 +01:00
Mark Qvist
5fc5eec700 Workaround for Kivy/SDL window positioning bug 2025-11-24 21:06:09 +01:00
Mark Qvist
0bf7fce688 Fixed display resolution getter on rotated displays 2025-11-24 19:47:07 +01:00
Mark Qvist
314febee3a Added message size rendering limit to conversation view. Fixes #93. 2025-11-24 18:43:32 +01:00
Mark Qvist
1ae7cea2b6 Added in-call profile switching for voice calls. Improved voice call UI feedback on establishment failure. 2025-11-24 13:38:20 +01:00
Mark Qvist
581e8073c5 Improved call status feedback and decreased call connect timeout 2025-11-24 11:38:19 +01:00
Mark Qvist
3f1cdd2724 Updated dependency versions 2025-11-24 01:58:59 +01:00
Mark Qvist
194efbbf22 Updated version 2025-11-24 01:56:16 +01:00
Mark Qvist
a911996070 Build native LXST filterlib.so and inject into APK 2025-11-24 01:46:51 +01:00
Mark Qvist
4c99029f9f Fixed toast 2025-11-22 20:23:34 +01:00
Mark Qvist
d99393dfd6 Updated dependency versions 2025-11-22 15:20:03 +01:00
Mark Qvist
2fb4c0132f Updated Android build code 2025-11-22 15:17:30 +01:00
Mark Qvist
d854a2d93d Fixed text-field rendering bug no Android 2025-11-22 10:56:45 +01:00
Mark Qvist
6edc6e3771 Render toast component in-application on all platforms 2025-11-22 10:28:42 +01:00
Mark Qvist
75e6fd05e8 Updated info view 2025-11-21 17:17:21 +01:00
Mark Qvist
d38f91898c Added call profile configuration to voice screen. Added automatic incoming call profile configuration. 2025-11-21 16:55:57 +01:00
Mark Qvist
e4d649ca79 Added ability to clear call log 2025-11-21 00:10:38 +01:00
Mark Qvist
24bf675ca3 Added call confirm dialog to calls made from call log 2025-11-20 23:55:45 +01:00
Mark Qvist
0de6b2d1d0 Added ability to start Sideband at device boot on Android 2025-11-20 23:30:57 +01:00
Mark Qvist
ca2ef3ca37 Startup checks for CLI console 2025-11-20 11:37:14 +01:00
Mark Qvist
2e32f22076 Updated dependency versions 2025-11-19 16:48:45 +01:00
Mark Qvist
6d8960563d Updated repository versions and flasher URL 2025-11-19 16:38:25 +01:00
Mark Qvist
553401884a Fixed peer appearance updates from bulk telemetry transfer 2025-11-19 14:38:22 +01:00
Mark Qvist
4ed2be0707 Added ability to connect RNodes over WiFi/Ethernet on Android 2025-11-18 12:29:59 +01:00
Mark Qvist
576bc3fd85 Cleanup 2025-11-18 12:02:36 +01:00
Mark Qvist
5d5f949a15 Added wifi connection option to RNode settings 2025-11-18 11:59:01 +01:00
Mark Qvist
ecdbacd5d2 Cleanup 2025-11-18 11:13:27 +01:00
Mark Qvist
5b1c910f1f Fixed call log saving when identity could not be resolved 2025-11-10 02:13:14 +01:00
Mark Qvist
7a89c3ed79 Improved call notification visibility 2025-11-10 02:12:03 +01:00
Mark Qvist
04a09623a9 Fixed voice screen failing to load if voice calls were disabled 2025-11-10 00:01:34 +01:00
Mark Qvist
2bc80d2936 Only keep call log for 14 days 2025-11-09 14:22:31 +01:00
Mark Qvist
596bef2db4 Added reject button to voice screen 2025-11-09 14:18:38 +01:00
Mark Qvist
4b2e2bacd5 Added ability to dial from call log 2025-11-09 14:12:56 +01:00
Mark Qvist
8121de96d7 Added simple call log to voice call screen 2025-11-09 13:58:40 +01:00
Mark Qvist
09400ec863 Cache Android activity launch intent dropped by Kivy and retrieve for handling after UI init 2025-11-09 11:36:45 +01:00
Mark Qvist
5d7a83a39c Fixed regression in service RPC signature. Added service RPC connection re-init if connection drops unexpectedly. 2025-11-08 20:10:26 +01:00
Mark Qvist
a6618da229 Fixed missing location permission check for scanning and pairing BLE RNodes 2025-11-08 13:59:23 +01:00
Mark Qvist
4ee9623033 Request microphone permission on voice calls enable 2025-11-08 00:14:57 +01:00
Mark Qvist
0c965d9259 Ensure RNS exit handlers are executed on service shutdown, in case OS event is not sent. Fixes #90. 2025-11-07 23:15:23 +01:00
Mark Qvist
dce43bdcfc Updated version 2025-11-07 10:43:26 +01:00
Mark Qvist
92635ea1f2 Fixed missing telephone announce handler in frontend/service proxy on Android 2025-11-07 10:24:26 +01:00
Mark Qvist
3754f3bfa9 Updated LXST dependency 2025-11-06 22:52:35 +01:00
Mark Qvist
0112f85d34 Added low-latency output mode configuration option for LXST voice calls 2025-11-06 22:46:22 +01:00
Mark Qvist
829ccc6df9 Cleanup 2025-11-06 17:07:48 +01:00
Mark Qvist
6b09c6b262 Added voice call notifications 2025-11-06 17:07:00 +01:00
Mark Qvist
cf0d64a746 Implemented voice call support on Android 2025-11-06 12:11:54 +01:00
Mark Qvist
7d0c9e8c4d Enabled LXST voice calls on Android 2025-11-06 09:17:12 +01:00
Mark Qvist
e5dfa81b0a Implemented Kivy/SDL2 workaround for slow window resize updates on Linux 2025-11-04 15:26:00 +01:00
Mark Qvist
00b9517458 Implemented window size and position persistence 2025-11-04 14:19:46 +01:00
Mark Qvist
88e8db6118 Updated required LXMF to 0.9.1 2025-11-03 22:35:22 +01:00
Mark Qvist
ef53318d29 Fixed potential race configuration in first config init 2025-11-03 21:20:53 +01:00
Mark Qvist
017a1c1b28 Cleanup 2025-11-03 20:16:41 +01:00
Mark Qvist
8cd00f29d9 Updated Linux install instructions 2025-11-03 20:10:25 +01:00
Mark Qvist
c94e177405 Updated makefile 2025-11-03 20:10:11 +01:00
Mark Qvist
14436bce08 Go home Windows, you're drunk. Only apply UI scaling factor to window size on Linux. 2025-11-03 20:09:54 +01:00
Mark Qvist
36af5d805d Updated Linux install instructions 2025-11-03 16:29:04 +01:00
Mark Qvist
4daf4ef40a Updated Linux install instructions 2025-11-03 16:27:18 +01:00
Mark Qvist
8b191784f3 Updated Raspberry Pi install instructions 2025-11-03 16:20:39 +01:00
Mark Qvist
1bb61c1009 Added Able to credits 2025-11-03 15:06:08 +01:00
Mark Qvist
b7e24d8813 Updated build code 2025-11-03 15:05:55 +01:00
Mark Qvist
b3057dabf8 Cleanup 2025-11-03 14:31:54 +01:00
Mark Qvist
f3b0c71c7b Added Weave interface to connectivity settings 2025-11-03 14:25:41 +01:00
Mark Qvist
2fe1527ba2 Consistent pane close event handling 2025-11-03 14:09:49 +01:00
Mark Qvist
fc9e1bf86f Added call confirm dialog 2025-11-03 13:37:48 +01:00
Mark Qvist
ef0aed51a2 Cleanup 2025-11-02 18:35:35 +01:00
Mark Qvist
a2c2de49fe Fixed missing none check 2025-11-02 03:03:28 +01:00
Mark Qvist
9a11bfded2 Various UI improvements 2025-11-02 02:57:51 +01:00
Mark Qvist
2eec1d0a50 Updated dependencies 2025-11-02 00:39:11 +01:00
Mark Qvist
9bd7a5970c Implemented getting and displaying backend service log on Android 2025-11-02 00:27:57 +01:00
Mark Qvist
0a1be10411 Implemented profile backup and export. Implemented window size following UI scaling factor. 2025-11-02 00:00:38 +01:00
Mark Qvist
9a3cda077c Implemented workaround for Kivy/SDL bug where on_resume is not dispatched on Android 2025-11-01 23:33:49 +01:00
Mark Qvist
42d859f96e Improved audio processing for voice optimizaiton. Fixes #82. 2025-11-01 00:03:24 +01:00
Mark Qvist
6802161b4f Updates for LXMF 0.9.0 compatibility 2025-10-31 22:28:08 +01:00
Mark Qvist
2758b571ff WeaveInterface compatibility on Android 2025-10-29 15:45:25 +01:00
Mark Qvist
9b6a51a03e Use local version of able 2025-10-29 12:54:59 +01:00
Mark Qvist
2e44d49d6b Updated gitignore 2025-10-29 12:51:50 +01:00
Mark Qvist
d8581c981c Refactored conversation list 2025-10-29 02:22:23 +01:00
Mark Qvist
165f480d7e Conversation list refactoring 2025-10-29 02:08:27 +01:00
Mark Qvist
3f0d91ecdb Fixed Android BLE stack re-connection hang for RNodeInterface 2025-10-28 12:33:06 +01:00
Mark Qvist
dfac5cbd4a Updated dependencies 2025-10-28 02:29:25 +01:00
Mark Qvist
88010b76fc Updated build configuration 2025-10-28 02:24:11 +01:00
Mark Qvist
4b3e3d9e4e Updated gitignore 2025-10-28 02:23:56 +01:00
Mark Qvist
6a133842db Updated build recipes 2025-10-28 02:22:25 +01:00
Mark Qvist
846e7d7687 Updated makefile 2025-10-27 18:10:43 +01:00
Mark Qvist
26e115765f Updated dependencies 2025-10-27 12:28:13 +01:00
Mark Qvist
354fb08297 Cleanup 2025-07-14 21:35:58 +02:00
Mark Qvist
f0ec8fde42 Updated bluetooth scanning text 2025-07-14 20:37:58 +02:00
Mark Qvist
73601ebe1e Added in-app BLE scanning and pairing 2025-07-14 16:06:50 +02:00
Mark Qvist
0d2f7b25a3 Added service restart 2025-07-14 00:11:21 +02:00
Mark Qvist
aee675d38b Fixed missing widget hide 2025-07-13 14:58:24 +02:00
Mark Qvist
e6ef41815c Updated dependencies 2025-07-13 14:58:16 +02:00
Mark Qvist
2d7b5d2527 Merge branch 'main' of github.com:markqvist/Sideband 2025-05-18 18:03:53 +02:00
Mark Qvist
cd7562390c Fixed incorrect widget ID. Closes #79. 2025-05-18 18:03:25 +02:00
markqvist
aaed27d4ac
Update README.md 2025-05-17 20:37:55 +02:00
Mark Qvist
3c03070b6e Added funding 2025-05-17 10:26:29 +02:00
Mark Qvist
668dd48cee Updated dependencies 2025-05-16 12:50:38 +02:00
Mark Qvist
5c5d5f8306 Updated dialog texts 2025-05-16 12:36:18 +02:00
Mark Qvist
5355f0e91f Fixed link stats in object details 2025-05-15 15:58:21 +02:00
Mark Qvist
137c0b284e Added option to configure shared instance access 2025-05-15 01:38:40 +02:00
Mark Qvist
98c64acb3b Updated version and RNS dependency version 2025-05-13 18:13:01 +02:00
Mark Qvist
4aa290e41e Updated dependencies 2025-05-12 18:15:58 +02:00
Mark Qvist
2f35ecff80 Fixed missing none check 2025-05-12 14:46:23 +02:00
Mark Qvist
eb4d31ab35 Updated dependencies 2025-05-12 11:59:08 +02:00
Mark Qvist
2638688bbc Added ability to exclude objects from telemetry collector responses 2025-05-12 00:08:57 +02:00
Mark Qvist
09f6d4bd98 Added transfer speed to outgoing message status 2025-05-11 22:32:02 +02:00
Mark Qvist
55bf57d0ab Updated version and RNS dependency version 2025-05-06 19:15:41 +02:00
Mark Qvist
0e552d4b9d Added link mode to object details screen 2025-05-06 19:11:54 +02:00
Mark Qvist
922dd91d7f Added option to specify RNS config path 2025-05-06 19:11:39 +02:00
Mark Qvist
a60c0d830e Updated readme and gitignore 2025-04-29 11:44:36 +02:00
Mark Qvist
9e636de5b1 Added basic console functionality 2025-04-17 20:35:30 +02:00
Mark Qvist
b86725c96d Added console argument 2025-04-17 14:09:32 +02:00
Mark Qvist
9749147b34 Use abstract domain sockets for RPC. Use epoll backend for TCP connections on Android. 2025-04-09 17:16:30 +02:00
Mark Qvist
a97c6dc9bb Updated versions 2025-04-08 18:19:10 +02:00
Mark Qvist
e8461b3f33 Cleanup 2025-04-07 18:21:35 +02:00
Mark Qvist
6a56d02afb Fixed potential change during iteration 2025-04-05 14:39:21 +02:00
Mark Qvist
1054ddf1c4 Updated build spec 2025-03-27 22:20:51 +01:00
Mark Qvist
a0a6b0fd55 Handle MQTT client memory leak 2025-03-27 22:16:54 +01:00
Mark Qvist
b2c3411c90 Fixed missing property init 2025-03-14 21:51:24 +01:00
Mark Qvist
f6d2325785 Updated readme 2025-03-14 21:51:13 +01:00
Mark Qvist
e4bb1e17eb Updated readme 2025-03-14 21:31:59 +01:00
Mark Qvist
41536eb25a Updated readme 2025-03-14 21:30:21 +01:00
Mark Qvist
ff8b1d4c28 Updated readme 2025-03-14 21:23:16 +01:00
Mark Qvist
45f5d3e9ad Added windows location plugin example 2025-03-14 21:21:37 +01:00
Mark Qvist
fdb4003a17 Updated readme 2025-03-14 21:21:25 +01:00
Mark Qvist
7b2745692d Updated build spec 2025-03-14 18:41:22 +01:00
Mark Qvist
1c855aa24b Disable voice call option on Android 2025-03-14 17:20:49 +01:00
Mark Qvist
999054ab34 Improved map init time 2025-03-14 17:13:02 +01:00
Mark Qvist
dd12a76bf9 Added option to block non-trusted callers 2025-03-14 15:05:51 +01:00
Mark Qvist
4d9bba3e4c Added audio device config ui 2025-03-14 14:09:38 +01:00
Mark Qvist
3d7e894a9d Updated dependencies 2025-03-14 11:21:43 +01:00
Mark Qvist
86e68f0dba Fixed key mapping 2025-03-12 10:52:05 +01:00
Mark Qvist
5e749bc0c3 Fixed voice dialog not being dismissed 2025-03-11 17:38:42 +01:00
Mark Qvist
a24f1f1073 Adjust window size on small devices 2025-03-11 17:35:04 +01:00
Mark Qvist
b1678a1532 Voice call UI additions 2025-03-10 17:25:40 +01:00
Mark Qvist
9e058cc12e Fixed inadverdent audio message play on swipe back 2025-03-09 20:44:48 +01:00
Mark Qvist
1c9342d772 Added full RNS status button on Android 2025-03-09 19:16:54 +01:00
Mark Qvist
143f440df7 Added basic LXST voice call UI 2025-03-09 18:32:31 +01:00
Mark Qvist
a0a03c9eba Added voice call service base 2025-03-09 14:29:02 +01:00
Mark Qvist
902e1c5451 Added ringtones 2025-03-09 14:28:33 +01:00
Mark Qvist
3faa7e2203 Added BME280 telemetry plugin 2025-03-09 14:28:03 +01:00
Mark Qvist
fbd5896856 Fixed telemetry plugin init error 2025-03-09 11:15:33 +01:00
Mark Qvist
88f427b97c Catch OS notification limit exceptions 2025-02-24 12:39:12 +01:00
Mark Qvist
63030a6f48 Added link stats to object details 2025-02-23 22:42:43 +01:00
Mark Qvist
f006f0d71a Added audioop-lts on python >= 3.13 2025-02-22 21:26:44 +01:00
Mark Qvist
3d6d039a48 Updated intent filter to allow sharing any file type for attachments 2025-02-20 23:03:38 +01:00
Mark Qvist
4b5128f177 Cleanup 2025-02-18 16:18:22 +01:00
Mark Qvist
3f9204e1e1 Cleanup 2025-02-18 16:17:34 +01:00
Mark Qvist
9494ab8095 Improved markdown rendering 2025-02-18 16:16:11 +01:00
Mark Qvist
03cc00483b Improved markdown rendering 2025-02-18 16:15:21 +01:00
Mark Qvist
09db4a9328 Removed library 2025-02-18 16:13:57 +01:00
Mark Qvist
6b2cf01c69 Updated version 2025-02-18 13:59:41 +01:00
Mark Qvist
1bf11aca6f Always use local markdown library 2025-02-18 13:51:37 +01:00
Mark Qvist
587773ace4 Updated dependencies 2025-02-17 22:45:00 +01:00
Mark Qvist
54000a72c7 Improved markdown rendering 2025-02-17 21:55:50 +01:00
Mark Qvist
b4a063a4e7 Added periodic telemetry data cleaning 2025-02-17 20:42:00 +01:00
Mark Qvist
3b2e1adaf2 Added connection map sensor 2025-01-28 15:18:00 +01:00
Mark Qvist
2c25b75042 Added aggregate propagation stats 2025-01-27 14:40:49 +01:00
Mark Qvist
fc5ffab9ce Updated loglevels 2025-01-27 11:41:12 +01:00
Mark Qvist
5153a1178b Updated sensor stale times 2025-01-27 11:41:00 +01:00
Mark Qvist
de125004e6 Updated issue template 2025-01-27 10:24:55 +01:00
Mark Qvist
e65b2306cc Include signal icon in all cases. Fixes #70. 2025-01-27 10:15:25 +01:00
Mark Qvist
329bf6f3e6 Cleanup 2025-01-27 10:04:38 +01:00
Mark Qvist
e743493ffd Updated versions 2025-01-26 21:56:27 +01:00
Mark Qvist
cbb388fb63 Fixed stat 2025-01-26 21:51:32 +01:00
Mark Qvist
c873b9fa33 Cleanup 2025-01-26 14:12:13 +01:00
Mark Qvist
120d29db75 Moved mqtt lib 2025-01-26 14:10:45 +01:00
Mark Qvist
0d548e4cbb Fixed fstring parsing error on Android 2025-01-26 13:02:05 +01:00
Mark Qvist
a812f0a589 Added lxmd telemetry plugin to examples 2025-01-26 12:53:40 +01:00
Mark Qvist
ebc4462a50 Updated text 2025-01-26 12:21:28 +01:00
Mark Qvist
b03d91d206 Background updater for lxmd sensor 2025-01-26 12:15:26 +01:00
Mark Qvist
cc87e8c109 Improved RNS Transport stats 2025-01-26 01:12:06 +01:00
Mark Qvist
fc3e97b8fc Upped queue size 2025-01-25 16:20:49 +01:00
Mark Qvist
156c2d4bd2 Fix traffic counter entries 2025-01-25 16:20:40 +01:00
Mark Qvist
93aa17177b Added RNS Transport stats sensor to sensors UI 2025-01-25 15:59:39 +01:00
Mark Qvist
d459780ed7 Added MQTT configuration UI 2025-01-25 15:46:37 +01:00
Mark Qvist
c4cdd388b7 Added telemetry entries 2025-01-25 15:41:08 +01:00
Mark Qvist
4f201c5615 Port handling 2025-01-25 15:39:47 +01:00
Mark Qvist
23e0e2394e Cleanup 2025-01-25 15:39:22 +01:00
Mark Qvist
17d4de36c4 Improved MQTT error handling 2025-01-25 14:57:11 +01:00
Mark Qvist
94809b0ec4 Added RNS Transport sensor and MQTT renderers 2025-01-25 14:23:03 +01:00
Mark Qvist
cc722dec9f Set default stale time for LXMF PN sensor, cleanup 2025-01-24 22:32:57 +01:00
Mark Qvist
be6a1de135 Added LXMF PN sensor to Telemeter 2025-01-24 22:15:05 +01:00
Mark Qvist
9ef43ecef6 Implemented scheduler for MQTT handler 2025-01-23 00:30:45 +01:00
Mark Qvist
8899d82031 Added telemetry to MQTT option 2025-01-22 22:37:49 +01:00
Mark Qvist
3441bd9dba Added basic MQTT handler 2025-01-22 22:35:47 +01:00
Mark Qvist
74ba296fa6 Added MQTT library credits to info 2025-01-22 22:32:21 +01:00
Mark Qvist
9bb4f3cc8b Added MQTT library 2025-01-22 22:31:16 +01:00
Mark Qvist
5def619930 Added MQTT renderers to Telemeter 2025-01-22 22:30:27 +01:00
Mark Qvist
b3b5d607e0 Updated example 2025-01-22 02:35:59 +01:00
Mark Qvist
13071fd9d8 Updated build spec 2025-01-20 17:28:29 +01:00
Mark Qvist
0a28ec76f3 Added library 2025-01-20 14:46:48 +01:00
Mark Qvist
033c3d6658 Unify bbcode sizing across devices with different display densities 2025-01-20 14:46:28 +01:00
Mark Qvist
84b214cb90 Added markdown rendering and message composing 2025-01-20 14:25:58 +01:00
Mark Qvist
a90a451865 Set LXMF renderer field if message has BB-code markup 2025-01-20 11:46:32 +01:00
Mark Qvist
95fec8219b Updated build code 2025-01-20 11:32:50 +01:00
Mark Qvist
1d438f925b Updated info text 2025-01-19 22:30:30 +01:00
Mark Qvist
304469315d Updated build code 2025-01-19 22:20:11 +01:00
Mark Qvist
d6f54a0df3 Update peer telemetry from map by right-clicking 2025-01-19 22:09:41 +01:00
Mark Qvist
ebaf66788b Cancel message menu item 2025-01-19 10:05:29 +01:00
Mark Qvist
56add0bc50 Strip markup from notifications 2025-01-18 23:48:35 +01:00
Mark Qvist
dd1399d7ce Improved attachment feedback 2025-01-18 23:23:16 +01:00
Mark Qvist
4d7cb57d38 Fixed attachments not displaying while sending message 2025-01-18 23:15:02 +01:00
Mark Qvist
235bfa6459 Auto switch message mode on attachment 2025-01-18 22:45:24 +01:00
Mark Qvist
752c080d83 Updated versions 2025-01-18 21:39:59 +01:00
Mark Qvist
3111f767f0 Show indication on receiver message reject 2025-01-18 21:34:33 +01:00
Mark Qvist
4dfd423915 Added ability to cancel outbound messages 2025-01-18 19:12:08 +01:00
Mark Qvist
60591d3f0d Fixed typo 2025-01-15 09:43:52 +01:00
Mark Qvist
b9e224579b Updated versions 2025-01-14 22:05:28 +01:00
Mark Qvist
ad32349e2c Fix propagation node detector in daemon mode 2025-01-13 16:05:31 +01:00
Mark Qvist
5b61885bea Updated issue template 2025-01-06 20:46:34 +01:00
Mark Qvist
e515889e21 Add support for SX1280 bandwidth options 2025-01-03 22:35:27 +01:00
Mark Qvist
9f48fae6e8 Updated version 2025-01-02 11:37:14 +01:00
Mark Qvist
19e3364b7f Launch RNode flasher directly from utilities 2025-01-02 11:25:34 +01:00
Mark Qvist
b80a42947b Changed formatting 2025-01-02 11:24:46 +01:00
Mark Qvist
0c062ee16b Fix repository link handling typo 2025-01-02 11:17:21 +01:00
markqvist
f49019c93e
Merge pull request #68 from malteish/fix/urlRendering2
fix formatting of rnode server urls
2025-01-02 11:00:25 +01:00
Mark Qvist
2ce03c1508 Fixed advanced RNS config acting unexpectedly 2025-01-02 10:55:13 +01:00
malteish
ab5798d8de
fix formatting of rnode server urls 2024-12-28 19:58:49 +01:00
Mark Qvist
c1f04e8e3e Fixed cert generation on Android. Fixes #65. 2024-12-17 13:25:55 +01:00
Mark Qvist
9e6cdc859a Updated readme 2024-12-15 12:06:06 +01:00
Mark Qvist
78f2b5de3b Updated readme 2024-12-15 12:03:48 +01:00
Mark Qvist
e083fd2fb4 Fixed stray newline in URL 2024-12-15 11:38:12 +01:00
Mark Qvist
426c9d9617 Updated GPS data struct packing. Fixes #58. 2024-12-13 10:42:18 +01:00
Mark Qvist
bc8dcb82a3 Updated versions 2024-12-11 22:35:57 +01:00
Mark Qvist
19cae41062 Cleanup 2024-12-11 21:56:41 +01:00
Mark Qvist
15600d5172 Added signal stats to announce stream 2024-12-11 19:25:46 +01:00
Mark Qvist
887c0a9a16 Squelch excessive certificate validation error logging from client 2024-12-11 17:49:55 +01:00
Mark Qvist
a4e22c7868 Squelch excessive certificate validation error logging from client 2024-12-11 17:01:58 +01:00
Mark Qvist
02aadc4442 Add license to certgen 2024-12-11 14:33:46 +01:00
Mark Qvist
7d1de23ea9 Serve repository over HTTPS 2024-12-11 13:57:40 +01:00
Mark Qvist
7759264b37 Added self-signed SSL certificate generator 2024-12-11 13:57:12 +01:00
Mark Qvist
cc1e42cc66 Advanced config info 2024-12-11 02:19:07 +01:00
Mark Qvist
443c8938be UI cleanup 2024-12-11 02:01:50 +01:00
Mark Qvist
c210754aa4 Added advanced RNS configuration and multiple interfaces support 2024-12-11 01:58:46 +01:00
Mark Qvist
b301dc569b Updated repository 2024-12-10 21:18:52 +01:00
Mark Qvist
55baede2fc Enabled Repository server on desktop. Added RNode Flasher to utilities. Added RNode firmware downloads to repository update action. 2024-12-10 20:24:09 +01:00
Mark Qvist
79ad4bb353 Updated message colors 2024-12-09 20:25:50 +01:00
Mark Qvist
1989330d21 Added message color style toggle option 2024-12-09 19:59:30 +01:00
Mark Qvist
79ba89373a Added message markup rendering option to preferences 2024-12-09 17:58:56 +01:00
Mark Qvist
0573af2ba0 Improved message markup handling 2024-12-09 17:26:49 +01:00
Mark Qvist
fbb58eb7b9 Improved message markup handling 2024-12-09 16:10:32 +01:00
Mark Qvist
3b8700c197 Added glyph and box drawing fonts 2024-12-09 15:40:22 +01:00
Mark Qvist
b2a5b8c193 Added detection of failed markup rendering, and plaintext fallback 2024-12-09 12:25:59 +01:00
Mark Qvist
ad58ab335a Hide overview menu item 2024-12-08 22:58:38 +01:00
Mark Qvist
a2575559cb Added per-object livetracking functionality 2024-12-08 21:17:41 +01:00
Mark Qvist
d2efd8e91a Default to more sane window size 2024-12-08 20:22:22 +01:00
Mark Qvist
f71a3934d7 Default to more sane window size 2024-12-08 20:19:22 +01:00
Mark Qvist
2cc4182376 Show rnstatus in connectivity status on desktop 2024-12-08 19:45:17 +01:00
Mark Qvist
401d152935 Update log buffer length 2024-12-08 14:29:36 +01:00
Mark Qvist
afac322859 Enable icon display by default 2024-12-08 12:45:50 +01:00
Mark Qvist
9e992c83fd Added log viewer 2024-12-07 22:27:39 +01:00
Mark Qvist
922107df50 Updated version 2024-12-07 21:29:49 +01:00
Mark Qvist
83b8130311 Updated dependencies 2024-12-07 21:28:59 +01:00
Mark Qvist
211a0ad16b Added utilities section 2024-12-07 21:28:51 +01:00
Mark Qvist
ba0c80dd80 Updated readme 2024-11-30 01:08:10 +01:00
Mark Qvist
25e31d8d9d Updated install instructions 2024-11-29 14:15:43 +01:00
Mark Qvist
dcfc76e459 Updated install instructions 2024-11-29 14:02:32 +01:00
Mark Qvist
5d64fe1f8d Updated macOS install instructions 2024-11-29 14:02:08 +01:00
Mark Qvist
7f54cbfb17 Updated Windows install instructions 2024-11-29 13:55:45 +01:00
Mark Qvist
be8051240f Updated Windows install instructions 2024-11-29 13:53:47 +01:00
Mark Qvist
970ec7b3b3 Updated Windows install instructions 2024-11-29 13:50:26 +01:00
Mark Qvist
63a96dea37 Fixed desktop entry icon reference for RasPi OS 2024-11-28 16:57:00 +01:00
Mark Qvist
3979a806b0 Enable windows build 2024-11-27 14:07:48 +01:00
Mark Qvist
ee18dcab31 Preparation for Windows build 2024-11-27 13:14:46 +01:00
Mark Qvist
2e5d557aa7 Updated freeze file 2024-11-27 13:13:50 +01:00
Mark Qvist
364463c541 Updated readme 2024-11-26 14:46:05 +01:00
Mark Qvist
32b6fd0a81 Fixed Windows install dependencies 2024-11-26 14:46:01 +01:00
Mark Qvist
10b073d1c2 Updated readme 2024-11-25 21:47:15 +01:00
Mark Qvist
4004151f39 Added user interface scaling 2024-11-25 21:00:08 +01:00
Mark Qvist
7885f39708 Updated dependencies 2024-11-25 20:59:50 +01:00
Mark Qvist
fe4c61880e Fixed new conversation error dialog being wonky 2024-11-24 12:45:49 +01:00
Mark Qvist
0cbd4c71ab Added message attachments from sharing intent on Android and drag-and-drop on desktop 2024-11-23 17:23:12 +01:00
Mark Qvist
a9269f20d4 Updated graphics 2024-11-23 17:19:17 +01:00
Mark Qvist
bf8fbe5f86 Fixed UI redraw bug causing black screen on Android on app resume 2024-11-23 14:24:45 +01:00
Mark Qvist
9f86c4130c Prepare interface modularity. Fixed occasional missing view redraw on wake on Android. 2024-11-21 16:42:27 +01:00
Mark Qvist
6fb9a94a43 Fixed stamp cost display in announce stream 2024-11-17 12:12:26 +01:00
Mark Qvist
46450098b4 Validate propagation node data before logging it 2024-11-17 11:43:03 +01:00
Mark Qvist
c14699151d Updated sync dialog 2024-11-17 11:42:08 +01:00
Mark Qvist
293023be12 Updated sync dialog 2024-11-17 11:35:40 +01:00
Mark Qvist
91883a0510 Fixed invalid speed being reported to telemetry system 2024-11-15 17:06:33 +01:00
Mark Qvist
2221629315 Updated requirements 2024-10-20 14:15:34 +02:00
Mark Qvist
046cbbc30c Fixed stamp generation status not being displayed in some cases 2024-10-13 14:37:45 +02:00
Mark Qvist
8a8d2a77c3 Updated versions 2024-10-13 14:36:21 +02:00
Mark Qvist
d3fec0bd74 Updated Android build code 2024-10-11 23:46:23 +02:00
Mark Qvist
f8f1cd739b Updated versions 2024-10-11 18:03:45 +02:00
Mark Qvist
605124ab13 Updated Android build code 2024-10-11 18:02:37 +02:00
Mark Qvist
6654368064 Updated versions 2024-10-10 23:38:46 +02:00
Mark Qvist
763db20770 Updated version and dependencies 2024-10-09 20:10:24 +02:00
Mark Qvist
5e15c43ab7 Updated version 2024-10-06 11:32:27 +02:00
Mark Qvist
86c3b18f84 Display RNode hardware errors if available 2024-10-05 15:24:59 +02:00
Mark Qvist
ca21e47910 Handle BLE MTU errors 2024-10-01 23:50:58 +02:00
Mark Qvist
0d0267cf66 Updated versions 2024-10-01 17:30:29 +02:00
Mark Qvist
c12a6ce0ec Added BLE connection toggle to RNode hardware config 2024-10-01 17:00:38 +02:00
Mark Qvist
a7b581716a Updated build spec 2024-10-01 16:24:11 +02:00
Mark Qvist
2cf7d8ad84 Added thread lock to service RPC calls 2024-10-01 16:22:47 +02:00
Mark Qvist
6b97fd8e4b Allow connecting RNode over BLE 2024-10-01 15:55:56 +02:00
Mark Qvist
54cac42aed Added RNode battery info to connectivity dialog 2024-10-01 15:46:19 +02:00
Mark Qvist
17180283e2 Updated Android build code 2024-09-25 16:18:29 +02:00
Mark Qvist
e989536232 Updated versions 2024-09-25 15:51:12 +02:00
Mark Qvist
0902f869e1 Fixed invalid automatic telemetry request scheduling timebase 2024-09-25 12:29:53 +02:00
Mark Qvist
1d5cd89a49 Update info string 2024-09-24 13:39:08 +02:00
Mark Qvist
5aa7e91460 Updated build 2024-09-24 13:35:56 +02:00
Mark Qvist
a90364dd5b Updated versions 2024-09-24 13:28:39 +02:00
Mark Qvist
a16058329b Updated guide 2024-09-24 13:26:43 +02:00
Mark Qvist
e38a7b2559 Update dependency 2024-09-23 23:44:06 +02:00
Mark Qvist
558771293d Update version 2024-09-23 21:54:19 +02:00
Mark Qvist
88e03340cf Fix file manager access on Android 10 2024-09-23 17:54:43 +02:00
Mark Qvist
210163de0a Add option to use high-quality voice for ptt 2024-09-23 12:05:27 +02:00
Mark Qvist
26899f8cd6 Allow predictive text on Android by default, add option to block predictive text. Fixes #55. 2024-09-23 00:42:17 +02:00
Mark Qvist
919cd6a449 Allow predictive text on Android by default, add option to block predictive text. Fixes #55. 2024-09-23 00:03:13 +02:00
Mark Qvist
c2dcc55d6e Update build code 2024-09-22 11:45:26 +02:00
Mark Qvist
6a21429469 Don't set PN until message router has been instantiated 2024-09-22 11:42:18 +02:00
Mark Qvist
1e604f15a8 Open conversations from notifications on Android 2024-09-22 00:36:35 +02:00
Mark Qvist
30ccd64535 Improved notification handling on Android 2024-09-22 00:10:40 +02:00
Mark Qvist
4a12c136a0 Set immutable flag on notification intent. Closes #56. 2024-09-21 20:59:50 +02:00
Mark Qvist
7e6f95e965 Detect Android background power restrictions 2024-09-21 20:56:14 +02:00
Mark Qvist
92ccbbec0a Fixed invalid log output 2024-09-21 20:53:13 +02:00
Mark Qvist
f299e0c0ed Ask for power optimisation disabling on Android 2024-09-21 19:08:11 +02:00
Mark Qvist
cf8f704319 Updated readme 2024-09-19 23:55:20 +02:00
Mark Qvist
7f28192228 Updated versions 2024-09-19 23:27:17 +02:00
Mark Qvist
dc44071a1a Updated Android build code 2024-09-19 00:44:37 +02:00
Mark Qvist
241f5d9c01 Cleanup 2024-09-18 12:36:37 +02:00
Mark Qvist
1bbbbd849f Updated readme 2024-09-18 12:36:20 +02:00
Mark Qvist
6cd22aa4ef Adjusted settings screen 2024-09-18 10:38:03 +02:00
Mark Qvist
08ea89be1d Updated announce intervals 2024-09-18 10:07:00 +02:00
Mark Qvist
72e21a4735 Skip saving config on spurious scroll events 2024-09-18 10:06:49 +02:00
Mark Qvist
074bb4aa4e Check message db return is not none 2024-09-17 14:24:56 +02:00
Mark Qvist
69ab910590 Send commands opportunistically if ratchets are available 2024-09-16 20:25:32 +02:00
Mark Qvist
4fddc45dbc Updated versions 2024-09-16 20:13:42 +02:00
Mark Qvist
92d7ba24cc Added delivery method icons to message view 2024-09-16 19:51:48 +02:00
Mark Qvist
2ecdf1c853 Send messages opportunistically if ratchets are available 2024-09-16 18:59:33 +02:00
Mark Qvist
f8b3e3760b Handle undecodable message content 2024-09-16 18:06:49 +02:00
Mark Qvist
548663655b Perform telemetry requests and updates via service on Android. Update service heartbeat monitoring. 2024-09-16 09:59:21 +02:00
Mark Qvist
6038bc541c Get link establishment rates via service on Android 2024-09-14 19:55:25 +02:00
Mark Qvist
3a952334ad Updated Android build code 2024-09-13 13:05:07 +02:00
Mark Qvist
e68926806c Show exit screen on window close 2024-09-13 12:48:17 +02:00
Mark Qvist
a13607646c Dispatch commands via service on Android 2024-09-12 21:37:36 +02:00
Mark Qvist
9c66538ec1 Dispatch messages via service on Android 2024-09-12 20:17:44 +02:00
Mark Qvist
a33158570a Updated Android build code 2024-09-12 18:26:53 +02:00
Mark Qvist
597f8a28a2 Improved announce details display 2024-09-12 10:06:24 +02:00
Mark Qvist
33d1b7c90d Updated readme 2024-09-11 18:04:31 +02:00
Mark Qvist
bad80fab50 Updated version and dependencies 2024-09-11 12:05:20 +02:00
Mark Qvist
042726d27f Added configuration option for ignoring messages with invalid stamps 2024-09-11 02:05:55 +02:00
Mark Qvist
c2881e70e9 Updated Android build code 2024-09-09 16:15:45 +02:00
Mark Qvist
04f20cc4fd PTT hide on unsupported platforms 2024-09-09 02:10:14 +02:00
Mark Qvist
b9d963733f Cleanup 2024-09-08 20:31:52 +02:00
Mark Qvist
c50e904ac6 Updated Android build code 2024-09-08 19:01:56 +02:00
Mark Qvist
b2517d8c82 Added stamp cost settings to UI 2024-09-08 17:50:19 +02:00
Mark Qvist
a813e84ff5 Updated message encryption descriptions 2024-09-08 17:50:04 +02:00
Mark Qvist
5f6c4c3bea Display message size in message details 2024-09-08 15:17:42 +02:00
Mark Qvist
12ddf61436 Disable notifications in daemon mode 2024-09-08 15:17:26 +02:00
Mark Qvist
edb07c7cea Display outgoing stamps in message details 2024-09-08 14:51:36 +02:00
Mark Qvist
12b7250a37 Added message details dialog 2024-09-08 13:18:12 +02:00
Mark Qvist
66065bc3ef Fixed dialog sizing on mobile 2024-09-08 13:17:04 +02:00
Mark Qvist
c6f82a917d Save and display stamp status on messages 2024-09-08 01:20:52 +02:00
Mark Qvist
7ec35db6c9 Include tickets to trusted peers 2024-09-07 23:24:49 +02:00
Mark Qvist
e0e1540a94 Added ratchet info display to object details 2024-09-07 22:29:30 +02:00
Mark Qvist
5d586d26fc Implemented outbound stamp cost handling and stamp cost display in object details 2024-09-07 11:30:19 +02:00
Mark Qvist
ff58028ca7 Fix PTT button hiding 2024-09-07 09:44:07 +02:00
Mark Qvist
bdf968084e Compatibility with stamps 2024-09-07 02:08:24 +02:00
Mark Qvist
aa77083f74 Updated recipe 2024-09-07 02:08:04 +02:00
Mark Qvist
802f43c71f Updated version 2024-09-06 20:54:35 +02:00
Mark Qvist
d6c5787104 Fix random announce interval calculation 2024-09-04 20:09:56 +02:00
Mark Qvist
454eedd8d1 Added battery temperature to telemetry 2024-09-02 15:13:59 +02:00
Mark Qvist
0425beeda5 Updated version 2024-09-02 15:13:28 +02:00
Mark Qvist
19c54319a6 Added PTT playback queue and playback lock while recording. Added database operation thread locking. 2024-09-02 13:05:32 +02:00
Mark Qvist
08bf53c998 Added keyboard hotkey for PTT 2024-09-02 10:43:55 +02:00
Mark Qvist
9e770fc3f1 Added inbound PTT audio queue and playback block when recording 2024-09-02 01:04:13 +02:00
Mark Qvist
abd5187571 Updated dependencies 2024-08-30 22:08:24 +02:00
Mark Qvist
18cbb5dfe2 Added PTT mode. Improved notification display. 2024-08-30 21:17:22 +02:00
Mark Qvist
f4d148cbaf Added T3S3 to device filter list 2024-08-30 15:55:19 +02:00
Mark Qvist
596c548522 Added settings import and export 2024-08-30 15:12:59 +02:00
Mark Qvist
bbefc39fd7 Added LilyGO T3S3 v1.2 to USB device filter 2024-08-17 16:39:27 +02:00
Mark Qvist
0b5075339f Merge branch 'main' of github.com:markqvist/Sideband 2024-08-17 14:28:23 +02:00
markqvist
7716b1fde6
Merge pull request #52 from jacobeva/main
Fix sideband not detecting RAK4631
2024-08-17 14:27:40 +02:00
Mark Qvist
3318c66b1b Merge branch 'main' of github.com:markqvist/Sideband 2024-08-17 14:23:21 +02:00
Mark Qvist
a55c8a2425 Added version info to startup log 2024-08-17 14:23:01 +02:00
Mark Qvist
51523a216d Updated telemetry change processing method 2024-07-20 18:21:17 +02:00
jacob.eva
c640f9ad30
Fix sideband not detecting RAK4631 2024-07-08 11:54:15 +01:00
Mark Qvist
0d38fa7ef7 Updated readme 2024-06-29 22:18:32 +02:00
Mark Qvist
7ab94e81ea Updated readme 2024-06-29 22:14:36 +02:00
Mark Qvist
24f16101ab Added pycodec2 wheel 2024-06-29 22:12:29 +02:00
Mark Qvist
744f5a7f06 Cleanup 2024-06-29 22:12:19 +02:00
Mark Qvist
4abf8c5766 Updated readme 2024-06-29 22:12:07 +02:00
Mark Qvist
d7393d9219 Updated readme 2024-06-29 22:11:51 +02:00
Mark Qvist
59da14141a Updated readme 2024-06-29 22:08:40 +02:00
Mark Qvist
2d5d975d68 Added pycodec2 wheel 2024-06-29 19:59:55 +02:00
Mark Qvist
386705a015 Updated readme 2024-06-29 19:59:46 +02:00
Mark Qvist
e90133a90f Updated recipes 2024-06-29 18:07:48 +02:00
Mark Qvist
c83798b123 Updated readme 2024-06-29 18:03:21 +02:00
Mark Qvist
9160dc19b8 Updated readme 2024-06-29 18:01:13 +02:00
Mark Qvist
657831fc53 Updated readme 2024-06-29 17:59:19 +02:00
Mark Qvist
808a8ddeea Updated readme 2024-06-29 17:58:14 +02:00
Mark Qvist
05607cbf6c Updated readme 2024-06-29 17:55:44 +02:00
Mark Qvist
96f9d8a54f Updated desktop entry 2024-06-29 17:35:27 +02:00
Mark Qvist
bbb982c69c Added desktop integration on Linux, regardless of install source 2024-06-29 17:33:47 +02:00
Mark Qvist
f3f72b3022 Don't play empty audio segments 2024-06-29 17:32:37 +02:00
Mark Qvist
7d107ce33d Updated desktop entry 2024-06-29 17:31:51 +02:00
Mark Qvist
2a784499e0 Fixed error display and audio playback on missing codec2 library 2024-06-29 13:51:27 +02:00
Mark Qvist
42cfd91ec3 Updated requirements 2024-06-29 13:50:46 +02:00
Mark Qvist
5ae4079e40 Updated codec2 recipe 2024-06-29 13:50:30 +02:00
Mark Qvist
0ebde8580f Updated build config 2024-06-29 13:50:21 +02:00
Mark Qvist
b308dcde6c Updated readme 2024-06-07 18:50:19 +02:00
Mark Qvist
bea87275e0 Updated readme 2024-06-07 18:46:20 +02:00
Mark Qvist
b2b316396b Updated readme 2024-06-07 18:42:46 +02:00
markqvist
1f1885d911
Update README.md 2024-06-07 18:35:43 +02:00
markqvist
655c03faba
Update README.md 2024-06-07 18:34:55 +02:00
markqvist
f64a8905e8
Update README.md, closes #50 2024-06-07 18:31:40 +02:00
Mark Qvist
9de6cbb8a2 Updated readme 2024-06-07 14:48:17 +02:00
markqvist
fc10cededd
Update README.md 2024-06-07 14:31:35 +02:00
Mark Qvist
66d4f30840 Fixed desktop category 2024-06-06 23:45:15 +02:00
Mark Qvist
5123a83629 Updated build code 2024-06-06 23:37:07 +02:00
Mark Qvist
534acaba17 Fixed invalid import 2024-06-06 23:37:02 +02:00
Mark Qvist
7ac24c76ec Updated dependency 2024-06-06 16:06:18 +02:00
Mark Qvist
ad17283eff Updated keyboard shortcuts and guide 2024-06-06 15:40:41 +02:00
Mark Qvist
a0b40fc825 Only allow recording on Android >= 10 2024-06-06 14:38:54 +02:00
Mark Qvist
3a67ecb942 Updated build code 2024-06-06 14:38:35 +02:00
Mark Qvist
a73b143d61 Cleanup 2024-06-06 13:53:44 +02:00
Mark Qvist
718b2bcb65 Updated wheel build 2024-06-06 13:51:25 +02:00
Mark Qvist
f4eb3c4ad3 Added manifest 2024-06-06 13:50:52 +02:00
Mark Qvist
8eea3bb5bb Don't send empty commands 2024-06-06 13:20:58 +02:00
Mark Qvist
43e1912a0a Improved preferences screen layout 2024-06-06 13:04:20 +02:00
Mark Qvist
94a0bca250 Fixed LXMF delivery limits not getting updated until restart 2024-06-06 12:54:10 +02:00
Mark Qvist
1bc2b9bf39 Updated build code 2024-06-06 00:46:57 +02:00
Mark Qvist
83b64619b2 Added freeze script 2024-06-05 20:35:31 +02:00
Mark Qvist
f31caebdca Record button color 2024-06-05 17:26:35 +02:00
Mark Qvist
e870382951 Updated readme 2024-06-05 00:32:44 +02:00
markqvist
78932b84df
Updated readme 2024-06-05 00:32:07 +02:00
Mark Qvist
a3594ecf28 Updated readme 2024-06-05 00:30:39 +02:00
markqvist
320daf0c61
Update README.md 2024-06-05 00:27:00 +02:00
markqvist
af2f18d762
Updated readme 2024-06-05 00:25:29 +02:00
markqvist
7f7bbcc0b2
Updated readme 2024-06-05 00:22:33 +02:00
markqvist
7039430e24
Updated readme 2024-06-05 00:17:41 +02:00
Mark Qvist
d0fa61fb73 Message text on commands 2024-06-05 00:13:00 +02:00
Mark Qvist
2c3c0f40d1 Fixed missing service intent flag for new API level target 2024-06-04 22:13:56 +02:00
Mark Qvist
feb51aff32 Updated build spec 2024-06-04 18:51:36 +02:00
Mark Qvist
e9ee682e20 Fixed missing button actions 2024-06-04 18:51:27 +02:00
Mark Qvist
197a42b962 Added audio processing when available 2024-06-04 18:12:28 +02:00
Mark Qvist
0143da127c Updated dependencies 2024-06-04 18:12:08 +02:00
Mark Qvist
1f907d91ce Updated build spec 2024-06-04 18:11:23 +02:00
Mark Qvist
288bebb787 Detect codec2 shared libs and display message if not available 2024-06-04 16:18:32 +02:00
Mark Qvist
fb725ea4de Platform audio handling 2024-06-04 15:51:29 +02:00
Mark Qvist
7cf53ba62a Improve message display on attachment-only messages 2024-06-04 15:51:07 +02:00
Mark Qvist
11d73090ed Audio messaging feature dialogs 2024-06-04 15:50:48 +02:00
Mark Qvist
7e0a96f455 Updated install dependency handling 2024-06-04 15:50:12 +02:00
Mark Qvist
8d9254ffe1 Updated readme 2024-06-04 15:49:17 +02:00
Mark Qvist
584267dcc5 Audio recording on Linux 2024-06-04 14:29:28 +02:00
Mark Qvist
1a224fd65a Updated dependencies based on platforms 2024-06-04 11:11:36 +02:00
Mark Qvist
551949b808 Import variations 2024-06-04 11:11:19 +02:00
Mark Qvist
050b3aa17a Improved audio playback on Linux 2024-06-04 04:46:47 +02:00
Mark Qvist
912f86ea8f Added compiled Codec2 libs 2024-06-04 03:19:45 +02:00
Mark Qvist
53479d4700 Added PyDub 2024-06-04 03:19:24 +02:00
Mark Qvist
446181aa58 Updated credits 2024-06-04 03:19:00 +02:00
Mark Qvist
217e133003 Updated build spec 2024-06-04 03:18:33 +02:00
Mark Qvist
7ec68a7c28 Added shared lib ELF patch to makefile 2024-06-04 03:18:14 +02:00
Mark Qvist
eed3efe66a Updated recipe 2024-06-04 03:17:45 +02:00
Mark Qvist
43944b74cd Audio message recording and playback 2024-06-04 02:57:58 +02:00
Mark Qvist
e645eccb2e Audio message playback 2024-06-04 02:57:05 +02:00
Mark Qvist
11cfc56bd0 Codec2 encode and decode 2024-06-04 02:56:23 +02:00
Mark Qvist
3fc67ceb2b Audio output 2024-06-04 02:55:13 +02:00
Mark Qvist
768943e166 Unify audio playback for Linux and Android 2024-06-03 13:20:41 +02:00
Mark Qvist
4b6ff73907 Fixed missing has_audio attribute init 2024-06-03 12:55:35 +02:00
Mark Qvist
88d3d5ed95 Strip emojis from Linux notifications 2024-06-03 12:55:21 +02:00
Mark Qvist
381c437886 Fixed send button not reactivating after send error 2024-06-03 12:54:35 +02:00
Mark Qvist
8e97c05862 Updated build spec 2024-06-03 12:53:44 +02:00
Mark Qvist
113df51f13 Updated codec2 recipe 2024-06-03 12:53:27 +02:00
Mark Qvist
d4dda92278 Added codec2 recipe 2024-06-03 12:04:05 +02:00
Mark Qvist
0ef5fe2870 Added custom recipes 2024-06-03 01:55:24 +02:00
Mark Qvist
17c4febc96 Added pyogg 2024-06-03 01:54:58 +02:00
Mark Qvist
dcf722d85f Added audio messaging 2024-06-03 01:53:54 +02:00
Mark Qvist
4ffe16b209 Added audio recording UI elements 2024-06-02 18:33:46 +02:00
Mark Qvist
c32b7ce1cf Updated build spec 2024-06-02 18:32:50 +02:00
Mark Qvist
7c5c6a7ed0 Added audioprocessing util 2024-06-02 18:32:19 +02:00
Mark Qvist
bb86bee399 Updated, modded and refactored plyer 2024-06-02 18:31:58 +02:00
Mark Qvist
16e055ba25 Cleanup 2024-06-02 00:45:12 +02:00
Mark Qvist
b1aa8cb704 Updated keyboard shortcuts and guide 2024-06-01 15:35:10 +02:00
Mark Qvist
3bf142d21a Expanded emoji rendering to alternate input scripts 2024-06-01 15:07:38 +02:00
Mark Qvist
b3b9b55863 Updated fonts 2024-06-01 15:06:50 +02:00
Mark Qvist
eb4af3c56b Added emoji rendering in input field 2024-06-01 14:14:12 +02:00
Mark Qvist
d453ca2abb Added fonts 2024-06-01 14:13:51 +02:00
Mark Qvist
a4bc4634ca Expanded emoji lookup table 2024-06-01 12:42:22 +02:00
Mark Qvist
be84d4cce5 Updated telemetry plugin example 2024-06-01 12:15:13 +02:00
Mark Qvist
e701c10ec6 Cleanup 2024-06-01 12:09:52 +02:00
Mark Qvist
971a207582 Added tank and fuel sensor types. Added basic renderer for proximity, gravity, magnetics and angular velocity. 2024-06-01 12:08:09 +02:00
Mark Qvist
4c9de8b184 Added CPU, storage and RAM sensors. Added custom sensor. 2024-06-01 11:11:29 +02:00
Mark Qvist
3bf13d7435 Improved navigation 2024-06-01 01:12:10 +02:00
Mark Qvist
e64e3b6627 Updated version 2024-06-01 00:45:38 +02:00
Mark Qvist
6f3e73290d Formatting 2024-06-01 00:45:27 +02:00
Mark Qvist
132e02685b Added objects view. Added ability to display icon styles from everyone. 2024-05-31 23:35:42 +02:00
Mark Qvist
d72f74699d Updated build code 2024-05-31 13:49:02 +02:00
Mark Qvist
0175ca917d Updated build manifests 2024-05-31 13:45:55 +02:00
Mark Qvist
7a6ff84683 Set nav bar colors on Android 2024-05-31 13:43:47 +02:00
Mark Qvist
8741fedf3f Added concurrent call stat to call spec simulator 2024-05-22 20:13:30 +02:00
Mark Qvist
e6aa9ae25a Updated utility 2024-05-22 17:34:11 +02:00
Mark Qvist
ac98e62627 Updated utility 2024-05-22 17:10:16 +02:00
Mark Qvist
262d552108 Added calculator utility 2024-05-22 15:54:06 +02:00
Mark Qvist
32eed96f15 Updated build code 2024-05-22 12:42:51 +02:00
Mark Qvist
440677d8ae Updated installation instructions 2024-05-21 18:41:15 +02:00
Mark Qvist
ead1fcd4d3 Updated installation instructions 2024-05-21 18:39:10 +02:00
Mark Qvist
8fe3e4b8c9 Updated buildozer spec 2024-05-18 19:34:29 +02:00
Mark Qvist
7aae93515a Updated versions 2024-05-18 00:28:20 +02:00
Mark Qvist
f3e9381895 Added icon file for Windows 2024-05-18 00:28:05 +02:00
Mark Qvist
e83ead7b37 Added network stats to object details 2024-05-06 16:46:12 +02:00
Mark Qvist
4eea61b629 Added network stats to object details 2024-05-06 16:35:33 +02:00
Mark Qvist
20f0e12651 Added network stats to object details 2024-05-06 16:14:16 +02:00
Mark Qvist
7fb5dcd362 Focus message input field with tab 2024-05-06 16:13:44 +02:00
Mark Qvist
2da2fc26e7 Improved example plugins 2024-05-06 15:00:19 +02:00
Mark Qvist
3967a85ab0 Updated readme 2024-05-05 19:39:42 +02:00
Mark Qvist
94237e87e3 Updated readme 2024-05-05 19:34:00 +02:00
Mark Qvist
df49d9e3de Updated readme 2024-05-05 19:29:12 +02:00
Mark Qvist
0d4c91ee1c Added app launcher integration 2024-05-05 14:44:36 +02:00
Mark Qvist
5cff275bcc Added app launcher integration 2024-05-05 14:24:18 +02:00
Mark Qvist
6282d58bc3 Merge branch 'main' of github.com:markqvist/Sideband 2024-05-04 23:27:39 +02:00
Mark Qvist
70fb2170be Updated dependency version 2024-05-04 23:27:27 +02:00
markqvist
a7a886ce84
Merge pull request #47 from mindstorms6/main
Fix pipx install command in README
2024-05-04 23:24:19 +02:00
Mark Qvist
493d9f9105 Updated version 2024-05-04 23:18:02 +02:00
Breland Miley
b77eb6aa76
Fix pipx install command in README
Under the `pipx` section - the Mac app was missing the `x` in `pipx`. Add the missing `x`.
2024-05-04 10:17:36 -04:00
Mark Qvist
e92224f89e Fixed missing check on light and pressure sensors 2024-04-01 17:36:45 +02:00
Mark Qvist
18698da14e Updated version 2024-04-01 15:03:22 +02:00
Mark Qvist
19bfe35fe3 Added config path argument 2024-04-01 15:02:50 +02:00
Mark Qvist
8375ea224a Fixed info telemetry field not updating immediately after settings change 2024-04-01 14:38:19 +02:00
Mark Qvist
d3a27f4121 Fixed relative telemetry display for negative AAMSL values 2024-04-01 12:25:24 +02:00
Mark Qvist
f436a98fc2 Updated build code 2024-03-29 19:04:02 +01:00
Mark Qvist
094cfdb8b5 Display overview of loaded plugins 2024-03-29 18:19:35 +01:00
Mark Qvist
10329932a9 Updated version 2024-03-28 12:22:49 +01:00
markqvist
54a2764815
Merge pull request #46 from faragher/main
Added Windows API for MMAP in Geo.py
2024-03-28 12:20:33 +01:00
faragher
daa395cb8a Updated MMAP API for Windows 2024-03-27 21:41:31 -05:00
faragher
81c51d004b
Delete metadata/en-US directory 2024-03-27 21:07:01 -05:00
faragher
ab9daceeee
Merge branch 'markqvist:main' into main 2024-03-27 21:04:58 -05:00
Mark Qvist
72e11fd859 Disable notifications in daemon mode 2024-03-27 18:41:04 +01:00
Mark Qvist
6700b7f8b7 Updated view example 2024-03-27 18:37:13 +01:00
Mark Qvist
48908842c6 Fixed asset path on Windows 2024-03-27 15:31:38 +01:00
Mark Qvist
a428d4c938 Updated view example 2024-03-27 15:30:52 +01:00
Mark Qvist
ad3a0b9df6 Added remote view plugin example 2024-03-27 01:09:45 +01:00
Mark Qvist
beff037a65 Increased timeout 2024-03-26 20:39:36 +01:00
Mark Qvist
191a958335 Updated readme 2024-03-26 18:11:26 +01:00
Mark Qvist
2cf06e9fe0 Fixed startup error on some macOS versions 2024-03-26 17:17:22 +01:00
Mark Qvist
c3dee106e8 Add geoids to wheel 2024-03-26 15:26:24 +01:00
Mark Qvist
5db8ff0b0c Add plugin examples to repository server 2024-03-26 14:51:08 +01:00
Mark Qvist
26b8dba490 Updated build code 2024-03-26 14:43:27 +01:00
Mark Qvist
cbf8ece4d9 Updated readme 2024-03-26 14:36:20 +01:00
Mark Qvist
b0d3ac763a Updated readme 2024-03-26 14:32:49 +01:00
Mark Qvist
a2f04e23a6 Added EGM2008 world altitude correction. 2024-03-26 14:18:42 +01:00
Mark Qvist
e2cb57d1fb Added Linux GPSd location plugin example 2024-03-26 12:37:25 +01:00
Mark Qvist
6122df0600 Added support for location provider plugins 2024-03-26 12:36:56 +01:00
Mark Qvist
c93fe2ce0d Added telemetry plugin functionality 2024-03-26 00:29:49 +01:00
Mark Qvist
d5630d72de Fixed message texture size logic 2024-03-25 19:32:03 +01:00
Mark Qvist
aae1377a42 Updated readme 2024-03-25 17:06:44 +01:00
Mark Qvist
f1f7c332a3 Added remote image fetch example 2024-03-25 01:28:24 +01:00
Mark Qvist
84bc1f786d Added basic plugin examples 2024-03-25 00:59:39 +01:00
Mark Qvist
ced7e881b9 Added plugin functionality 2024-03-25 00:58:58 +01:00
Mark Qvist
02805290b0 Added basic plugin class definitions 2024-03-25 00:56:59 +01:00
Mark Qvist
301053a949 Updated readme 2024-03-24 12:08:53 +01:00
Mark Qvist
535dee5e9d Updated dependencies 2024-03-23 19:54:59 +01:00
Mark Qvist
be9eb37927 Updated version 2024-03-23 19:43:15 +01:00
Mark Qvist
68e603057c Fixed interface mode settings not working correctly 2024-03-23 19:42:47 +01:00
faragher
0dccab48b6
Delete metadata/en-US/touch 2024-03-19 21:18:27 -05:00
faragher
04e7833c92
Adding metadata for F-Droid 2024-03-19 21:07:24 -05:00
faragher
7fe25edce6
Create touch 2024-03-19 21:06:39 -05:00
Mark Qvist
f09e01e065 Convert image buffers to PNG format on macOS 2024-03-19 19:57:48 +01:00
Mark Qvist
09f849a19d Add python wheel to repo server 2024-03-19 16:16:01 +01:00
Mark Qvist
9b2bd3a650 Updated dependencies 2024-03-19 13:56:56 +01:00
Mark Qvist
17a6653068 Improved message transfer feedback 2024-03-19 13:45:26 +01:00
Mark Qvist
bfcff07025 Added ability to allow transfers of LXMs larger than 1 megabyte 2024-03-19 11:56:21 +01:00
Mark Qvist
b87b80f152 Added handling of missing access to WiFi Manager and Power Manager on Android 2024-03-19 11:55:52 +01:00
Mark Qvist
e800ce054b Added message transfer progress indication 2024-03-19 11:05:00 +01:00
Mark Qvist
70b8ebef58 Fixed automatic telemetry updates from collector not being initiated 2024-03-17 01:08:42 +01:00
Mark Qvist
6d5a7b0219 Cleanup 2024-03-17 01:01:39 +01:00
Mark Qvist
af56178064 Added image and file attachment saving 2024-03-17 00:23:55 +01:00
Mark Qvist
7f891d68e0 Added image and file attachment sending 2024-03-16 22:59:19 +01:00
Mark Qvist
8f8c1ec68f Updated dependencies 2024-03-16 22:54:43 +01:00
Mark Qvist
ece113eb82 Updated dependencies 2024-03-16 22:52:55 +01:00
Mark Qvist
98dacf5bff Updated makefile 2024-03-16 22:52:41 +01:00
Mark Qvist
58751bb0e5 Updated drop-down menu colors 2024-03-11 01:21:54 +01:00
Mark Qvist
bc2e524ec9 Added LXMF image reception and display 2024-03-10 18:14:04 +01:00
Mark Qvist
1e86b266a9 Display warning on very large messages 2024-03-10 16:36:41 +01:00
Mark Qvist
9a18878c42 Updated variant string 2024-03-04 00:59:59 +01:00
Mark Qvist
465f117dcd Updated version and dependency versions 2024-03-01 00:35:08 +01:00
Mark Qvist
385cf78ec6 Improved text 2024-02-29 18:09:25 +01:00
Mark Qvist
98dcc4a9f7 Added issue templates 2024-02-29 18:09:07 +01:00
Mark Qvist
0f6054bd21 Updated readme 2024-02-16 17:54:22 +01:00
Mark Qvist
3858315b56 Updated readme 2024-02-16 17:49:21 +01:00
Mark Qvist
122d80ff78 Upated error text 2024-02-14 17:17:37 +01:00
Mark Qvist
7bc2391920 Updated versions 2024-02-14 17:17:22 +01:00
Mark Qvist
30fbbe5826 Updated USB device filter 2024-01-24 22:57:18 +01:00
Mark Qvist
fd4253721d Update about 2024-01-17 23:54:57 +01:00
Mark Qvist
265b6b580e Updated versions 2024-01-17 23:50:57 +01:00
Mark Qvist
40f7216c40 Fixed typo 2024-01-05 20:15:32 +01:00
Mark Qvist
c6ddb66b57 Fixed font path includes 2024-01-05 19:50:13 +01:00
Mark Qvist
5413db18d2 Added own location button to map screen 2024-01-05 19:28:47 +01:00
Mark Qvist
b12860f7d7 Added multilingual text input options 2024-01-05 18:05:34 +01:00
Mark Qvist
2ef0941a6d Added fonts for Devangari 2024-01-05 17:50:32 +01:00
Mark Qvist
8956b44a63 Added international fonts 2024-01-05 01:52:27 +01:00
Mark Qvist
22be3b6067 Added multilingual text rendering 2024-01-05 01:49:25 +01:00
Mark Qvist
f51796a184 Updated contribution guidelines 2024-01-03 11:48:26 +01:00
Mark Qvist
0ae8977408 Reverted PR due to re-introducing bug fixed in d870585178 2024-01-03 11:29:08 +01:00
Mark Qvist
2604674ef1 Merge branch 'main' of github.com:markqvist/Sideband 2024-01-03 11:22:13 +01:00
markqvist
70e7fea54f
Merge pull request #38 from jooray/patch-1
Fix for predictive text
2024-01-03 11:21:12 +01:00
Juraj Bednar
55f6a8c6c2
Fix for predictive text
Kivy's default for input boxes changed from "text" to "null" in Kivy 2.1.0. Not specifying it disallowed typing using predictive text keyboards such as Gboard or Swiftkey swiping, which was irritating, when you are typing text messages.
2023-12-31 21:54:39 +01:00
Mark Qvist
ddbb03af51 Fixed missing check for None on telemetry save, when own location was not yet determined 2023-12-31 14:45:26 +01:00
Mark Qvist
237f6693f7 Fixed stale time updates on fixed location 2023-12-31 00:09:23 +01:00
Mark Qvist
fef618f96c Updated build code 2023-12-07 14:29:13 +01:00
Mark Qvist
b26447d4c5 Merge branch 'main' of https://git.unsigned.io/markqvist/Sideband 2023-12-06 00:04:06 +01:00
Mark Qvist
419ff759e8 Fixed missing announce on fast roam 2023-12-05 23:56:45 +01:00
Mark Qvist
1375f4028e Improved error logging on telemetry screen 2023-12-05 21:13:37 +01:00
Mark Qvist
6120c1dd31 Fixed missing check for none value 2023-12-05 21:00:42 +01:00
Mark Qvist
c39b7ac148 Fixed incorrect defaults for IFAC size after increase in default values in RNS 2023-12-05 20:40:14 +01:00
Mark Qvist
3b7d1b7892 Fixed incorrect defaults for IFAC size after increase in default values in RNS 2023-12-05 20:37:05 +01:00
Mark Qvist
7e5948403b Updated GPS polling frequency 2023-12-04 11:16:51 +01:00
Mark Qvist
484d7ddf7a Only run background telemetry updates when location service is available 2023-12-03 11:26:22 +01:00
Mark Qvist
19cacd0e86 Implemented background telemetry 2023-12-03 02:08:04 +01:00
Mark Qvist
ecf13e0041 Fixed light sensor bug in plyer 2023-12-03 02:05:12 +01:00
Mark Qvist
e69f0b9055 Fixed typo 2023-11-16 14:26:46 +01:00
Mark Qvist
26e4f1981d Updated RNS dependency and version 2023-11-14 10:26:31 +01:00
Mark Qvist
fb2ea1e64c Updated build code 2023-11-13 17:24:55 +01:00
Mark Qvist
da26fa714a Updated version 2023-11-13 16:27:32 +01:00
Mark Qvist
7a4a5a3938 Fixed typos 2023-11-13 15:56:33 +01:00
Mark Qvist
f8a97e5b36 Updated build code 2023-11-08 20:55:50 +01:00
Mark Qvist
f0df6c28be Updated version 2023-11-08 20:50:43 +01:00
Mark Qvist
7c2ec3ea04 Added telemtry buttons to map screen 2023-11-08 00:19:37 +01:00
Mark Qvist
1db3133f0d Fixed markup not being activated in command messages 2023-11-08 00:16:45 +01:00
Mark Qvist
5228d5659e Adjusted logging, added exception handler 2023-11-07 00:11:37 +01:00
Mark Qvist
bd74b33094 Updated build code 2023-11-05 20:30:33 +01:00
Mark Qvist
74ed2dced7 Improved autointerface rediscovery 2023-11-05 19:54:20 +01:00
Mark Qvist
f7516693bd Updated build code 2023-11-05 12:45:01 +01:00
Mark Qvist
5ca3153eff Added periodic multicast lock check 2023-11-05 12:20:30 +01:00
Mark Qvist
8727334ba6 Updated build code 2023-11-05 03:28:11 +01:00
Mark Qvist
56b0c1664d Updated repository contents 2023-11-04 21:43:33 +01:00
Mark Qvist
8492944d95 Updated version 2023-11-04 21:10:30 +01:00
Mark Qvist
cba19e2b4a Cleanup 2023-11-04 19:42:53 +01:00
Mark Qvist
c0133407ed Fixed erroneous error display 2023-11-04 19:42:06 +01:00
Mark Qvist
61347e9451 Updated versions 2023-11-03 00:09:20 +01:00
Mark Qvist
dec30a3753 Updated version, dependencies and build code 2023-11-02 19:06:09 +01:00
Mark Qvist
6eb10b566e Added IPC retry 2023-11-02 18:39:42 +01:00
Mark Qvist
6767a707cd Updated build code 2023-11-01 18:47:19 +01:00
Mark Qvist
919e2f8f5f Cleanup 2023-11-01 17:58:25 +01:00
Mark Qvist
1fb6c38247 Cleanup 2023-11-01 17:29:16 +01:00
Mark Qvist
8731be2293 Cleanup 2023-11-01 16:34:24 +01:00
Mark Qvist
acb67dc9a2 Added app-wide color warning when requests from everywhere are allowed 2023-11-01 11:51:47 +01:00
Mark Qvist
85f295c0c6 Fixed object details transition 2023-11-01 11:51:08 +01:00
Mark Qvist
2ce9ea870e Cleanup 2023-11-01 02:40:16 +01:00
Mark Qvist
bf74698058 Added error handling to config reload 2023-11-01 02:38:23 +01:00
Mark Qvist
10273d3e85 Fixed map zoom 2023-11-01 02:08:27 +01:00
Mark Qvist
6d15dd2940 Cleanup 2023-11-01 01:17:25 +01:00
Mark Qvist
8fe92da00a Updated dependencies 2023-11-01 01:17:19 +01:00
Mark Qvist
554302a783 Updated build code 2023-10-31 23:43:37 +01:00
Mark Qvist
f2abea9e61 Set transition 2023-10-31 23:43:29 +01:00
Mark Qvist
6b12bc7982 Tweaked signature warning display 2023-10-31 22:29:07 +01:00
Mark Qvist
5f74ac590c Don't enable keyboard shortcuts until start is complete 2023-10-31 22:28:17 +01:00
Mark Qvist
5398afcefe Cleanup 2023-10-31 21:41:30 +01:00
Mark Qvist
ef7dd1e2f2 Added lazy-loader for complex views 2023-10-31 21:41:15 +01:00
Mark Qvist
d870585178 Fixed message input field not always deleting 2023-10-31 19:22:33 +01:00
Mark Qvist
d312eac0d6 Fixed reference 2023-10-31 19:22:17 +01:00
Mark Qvist
fd7f8dfd76 Added improved copy/paste behaviour for fields 2023-10-31 19:09:04 +01:00
Mark Qvist
bab181ae76 Removed SDL2 focus workaround for Android 2023-10-31 17:53:57 +01:00
Mark Qvist
b5c7ac3f0d Cleanup 2023-10-31 17:50:58 +01:00
Mark Qvist
294570afc1 Cleanup 2023-10-31 17:49:16 +01:00
Mark Qvist
82e054e840 Cleanup 2023-10-31 17:48:17 +01:00
Mark Qvist
dec98f26f8 Cleanup 2023-10-31 17:46:57 +01:00
Mark Qvist
271b8783af Fixed signal report SNR output 2023-10-31 12:44:32 +01:00
Mark Qvist
9481938d41 Added appearance sync to bulk telemetry transfers 2023-10-30 23:24:10 +01:00
Mark Qvist
e2e55237ed Fixed user feedback 2023-10-30 22:49:29 +01:00
Mark Qvist
26ebc80a22 Implemented bulk telemetry transfers 2023-10-30 22:26:20 +01:00
Mark Qvist
08e112f538 Fixed telemeter rendering 2023-10-30 20:16:33 +01:00
Mark Qvist
45822e5aec Fixed telemeter rendering 2023-10-30 20:04:43 +01:00
Mark Qvist
66243b3bfb Added option to show display styles in conversation list 2023-10-30 16:55:55 +01:00
Mark Qvist
b015fd19f6 Only embed telemetry on timebase changes 2023-10-30 14:09:41 +01:00
Mark Qvist
ab15093ec8 Implemented advanced telemetry configuration 2023-10-30 13:45:58 +01:00
Mark Qvist
a78a773886 Cleanup 2023-10-30 03:19:41 +01:00
Mark Qvist
8f5a980bf1 Implemented telemetry collector requests and responses 2023-10-30 03:09:57 +01:00
Mark Qvist
7076fae5cc Added command handling and sending 2023-10-30 02:28:35 +01:00
Mark Qvist
c1b5b776d7 Implemented telemetry requests 2023-10-30 00:32:52 +01:00
Mark Qvist
a0f1f5774a Cleanup 2023-10-29 23:54:34 +01:00
Mark Qvist
aa99ef058a Implemented automated and manual telemetry updates to collector 2023-10-29 23:03:51 +01:00
Mark Qvist
92d8b4305b Implemented telemetry update sending 2023-10-29 20:59:27 +01:00
Mark Qvist
0b2a86a394 Added telemetry setting 2023-10-29 17:55:42 +01:00
Mark Qvist
468d4145b7 Added daemon mode 2023-10-29 16:54:12 +01:00
Mark Qvist
1e6b6298e5 Added copy to clipboard 2023-10-29 16:12:42 +01:00
Mark Qvist
cb27a0d774 Added UI components for telemetry fetching and sending 2023-10-29 16:01:28 +01:00
Mark Qvist
ad2dd3cba5 Improved slider behaviour 2023-10-29 14:07:03 +01:00
Mark Qvist
833040221e Removed scroll effect 2023-10-29 14:06:51 +01:00
Mark Qvist
16a2025a87 Cleanup 2023-10-29 11:05:14 +01:00
Mark Qvist
c39a87a5f3 Refactored telemetry screen 2023-10-29 10:43:34 +01:00
Mark Qvist
93a0b5fb55 Added exception handler 2023-10-28 22:59:52 +02:00
Mark Qvist
54e5256ea4 Implemented UI flows for telemetry, own telemetry, maps and conversations. 2023-10-28 22:27:56 +02:00
Mark Qvist
3acf67fc39 Added numeric keyboard shortcuts for conversations screen 2023-10-28 20:35:02 +02:00
Mark Qvist
3cecf5e259 Improved message detail rendering 2023-10-28 20:13:39 +02:00
Mark Qvist
69378e7dd4 Added keyboard navigation on map 2023-10-28 20:13:25 +02:00
Mark Qvist
6bb38d2f51 Improved error handling 2023-10-28 15:54:29 +02:00
Mark Qvist
11439dcabd Improved LXMF sync feedback 2023-10-27 20:28:33 +02:00
Mark Qvist
e59e087475 Added vertical distance 2023-10-27 01:03:59 +02:00
Mark Qvist
10d7e18264 Updater version code 2023-10-26 21:47:29 +02:00
Mark Qvist
c7dcf6f3ce Flipped az/alt source and dest 2023-10-26 21:45:17 +02:00
Mark Qvist
d599437ea3 UI cleanup 2023-10-26 21:44:26 +02:00
Mark Qvist
fbd2452c64 Cleanup 2023-10-26 21:44:11 +02:00
Mark Qvist
776c413bee Cleanup 2023-10-26 20:54:35 +02:00
Mark Qvist
d4b458745b Updated keyboard shortcuts 2023-10-26 20:49:58 +02:00
Mark Qvist
a1aa0544b3 Added map cache control 2023-10-26 20:38:19 +02:00
Mark Qvist
5110ef3b37 Use internal map cache dir 2023-10-26 19:59:30 +02:00
Mark Qvist
a373af2b0f Fixed mapview caching bugs 2023-10-26 19:42:18 +02:00
Mark Qvist
3fecb368e5 Added hotkeys 2023-10-26 18:57:35 +02:00
Mark Qvist
86e053cdb9 Added map settings and layer switching 2023-10-26 18:54:46 +02:00
Mark Qvist
0a2a87775e Added ability to use quad-key sources in mapview 2023-10-26 18:54:34 +02:00
Mark Qvist
fe8db4b950 Cleanup 2023-10-26 15:31:17 +02:00
Mark Qvist
82fc8c06f0 Cleanup 2023-10-26 15:23:25 +02:00
Mark Qvist
b076c0b7c5 Added option to disable propagation on direct delivery failure. Updated keyboard shortcuts. 2023-10-26 13:44:03 +02:00
Mark Qvist
8ed721445e Added option to disable propagation on direct delivery failure. Updated keyboard shortcuts. 2023-10-26 13:43:53 +02:00
Mark Qvist
4a1a5a7038 Added option to disable propagation on direct delivery failure. Updated keyboard shortcuts. 2023-10-26 13:43:28 +02:00
Mark Qvist
d87a58a51b Squelch excessive kivy/jnius logging on Android. Live toggle debug logging for RNS and Sideband. 2023-10-26 13:21:49 +02:00
Mark Qvist
f531b2ecaa Squelch excessive logging 2023-10-26 12:53:18 +02:00
Mark Qvist
cf6d88f17e Improved telemetry display and handling 2023-10-26 11:53:42 +02:00
Mark Qvist
b2958517a4 Cleanup 2023-10-26 02:30:48 +02:00
Mark Qvist
f6e07f58b3 Map loading from mbtiles and storage permissions 2023-10-26 02:28:41 +02:00
Mark Qvist
abe736cbee Updated layouts 2023-10-26 02:28:19 +02:00
Mark Qvist
10b1944e23 Added storage permission 2023-10-26 02:26:16 +02:00
Mark Qvist
e3b857256f Added received distance to message display, added custom info and receiver metrics to object display 2023-10-25 23:21:06 +02:00
Mark Qvist
6921a12f59 Added custom info and receiver metrics to telemeter 2023-10-25 23:19:24 +02:00
Mark Qvist
761fb86033 Added horizon metrics, radio coverage, azimuth, altitude and calculated deltas to telemetry rendering 2023-10-25 18:51:39 +02:00
Mark Qvist
07202396ae Added a true radio horizon calculator to geodesy functions 2023-10-25 18:50:27 +02:00
Mark Qvist
e6be975e6e Update on fixed location telemetry settings change 2023-10-25 18:49:30 +02:00
Mark Qvist
ea6ed3407a Fixed object details scroll behaviour 2023-10-25 14:19:02 +02:00
Mark Qvist
34ec42fc89 Fixed plyer bug 2023-10-25 03:40:08 +02:00
Mark Qvist
7da64a10cf Improved object detail rendering 2023-10-25 02:58:58 +02:00
Mark Qvist
feddcfc639 Added missing error log 2023-10-25 02:58:36 +02:00
Mark Qvist
9fe7632e8f Added angle-to-horizon and radio horizon calculations 2023-10-25 02:57:28 +02:00
Mark Qvist
ecb5f0c38b Added angle-to-horizon calculation 2023-10-25 02:56:59 +02:00
Mark Qvist
ec5814f906 Added geodesic and euclidian distances, az/alt and relative deltas to sensor display 2023-10-25 01:49:51 +02:00
Mark Qvist
23a4e5b312 Added relative rendering to telemeter 2023-10-25 01:49:00 +02:00
Mark Qvist
e664850c7e Cleanup 2023-10-25 01:48:35 +02:00
Mark Qvist
628c93e1f1 Added az/alt calculator to geodesy functions, fixed error in euclidian distance calculation 2023-10-25 01:35:46 +02:00
Mark Qvist
815f85adeb Added geodesy functions 2023-10-24 21:05:21 +02:00
Mark Qvist
fc200348f5 Added geodesy functions 2023-10-24 21:04:45 +02:00
Mark Qvist
f79059e6da Fixed callback init 2023-10-24 01:34:49 +02:00
Mark Qvist
338f608382 Fixed button race 2023-10-24 01:28:49 +02:00
Mark Qvist
8fee0bae58 Implemented object details view 2023-10-24 01:14:59 +02:00
Mark Qvist
3b0f75e9bc Implemented telemeter rendering 2023-10-24 01:12:32 +02:00
Mark Qvist
bbcb4409e6 Improved mapview behaviour and rendering 2023-10-24 01:11:50 +02:00
Mark Qvist
1aa2131d17 Trusted-only display mode, object view skeleton 2023-10-23 01:26:44 +02:00
Mark Qvist
77b6509059 Updated version 2023-10-22 23:14:19 +02:00
Mark Qvist
3e0e5436d1 Round pressure sensor output 2023-10-22 23:14:09 +02:00
Mark Qvist
b340711526 Updated marker handling 2023-10-22 23:13:51 +02:00
Mark Qvist
c77fb4ce20 Re-init AutoInterface periodically if no suitable PHY IFs exist at start 2023-10-22 21:44:57 +02:00
Mark Qvist
a0a6745b35 Fixed marker init 2023-10-22 21:18:37 +02:00
Mark Qvist
f5d1dc6e05 Cleanup 2023-10-22 21:05:47 +02:00
Mark Qvist
174b021a70 Optimise timings 2023-10-22 21:04:28 +02:00
Mark Qvist
876aff9c69 Fixed backend UI state retrievals 2023-10-22 20:47:14 +02:00
Mark Qvist
a091389fa1 Run IPC over multiprocessing lib instead of db 2023-10-22 20:16:41 +02:00
Mark Qvist
013c999152 Cleanup 2023-10-22 18:14:20 +02:00
Mark Qvist
20aa3cff1b Refactored views 2023-10-22 18:08:28 +02:00
Mark Qvist
86c8a19cde Refactored views 2023-10-22 17:44:44 +02:00
Mark Qvist
8416805f41 Refactored views 2023-10-22 17:14:32 +02:00
Mark Qvist
666af3fffa Fixed colorpicker bug 2023-10-22 16:02:39 +02:00
Mark Qvist
336b527b0e Refactored views, improved color pickers 2023-10-22 15:49:00 +02:00
Mark Qvist
a0628b61c9 Cleanup 2023-10-22 14:01:31 +02:00
Mark Qvist
cb572dd4f0 Added object details view 2023-10-22 14:01:11 +02:00
Mark Qvist
3025ea7a5b Implemented available sensors 2023-10-22 13:16:43 +02:00
Mark Qvist
10a1f32057 Cleanup 2023-10-22 10:43:31 +02:00
Mark Qvist
e37214f46d Updated label 2023-10-22 01:19:06 +02:00
Mark Qvist
2532b44197 Cleanup 2023-10-22 01:13:54 +02:00
Mark Qvist
314499109c Added telemetry system, location sharing and map view for shared locations 2023-10-22 01:12:55 +02:00
Mark Qvist
a9160b558b Display RF link stats in messages view 2023-10-22 01:12:13 +02:00
Mark Qvist
f9e3649dbc Added linux battery status support 2023-10-22 01:11:31 +02:00
Mark Qvist
e710a8d10a Added physical link stats to telemetry manager 2023-10-21 22:28:33 +02:00
Mark Qvist
d7a1c8c507 Fixed kivy mapview bugs 2023-10-21 22:27:09 +02:00
Mark Qvist
14e3b20f31 Added marker icons 2023-10-21 22:26:10 +02:00
Mark Qvist
5a1eb23b0a Fixed return on non-init 2023-10-21 11:59:18 +02:00
Mark Qvist
a0b97bf4a3 Add map marker for own device 2023-10-21 01:02:43 +02:00
Mark Qvist
71234d9b9d Map marker drawing 2023-10-20 23:40:51 +02:00
Mark Qvist
179ebe7cec Map marker drawing 2023-10-20 23:38:28 +02:00
Mark Qvist
8dad802f53 Added ability to discern telemetry changes 2023-10-20 17:27:15 +02:00
Mark Qvist
779cfc8662 Updated telemetry manager 2023-10-20 15:09:48 +02:00
Mark Qvist
f93c338adf Updated telemetry config and controls 2023-10-20 13:00:54 +02:00
Mark Qvist
beeee51b0b Request location permission when location telemetry is enabled 2023-10-20 13:00:29 +02:00
Mark Qvist
1b4754bca8 Updated telemetry manager 2023-10-20 12:58:55 +02:00
Mark Qvist
601164f58c Updated permissions 2023-10-20 12:58:17 +02:00
Mark Qvist
eaa4315857 Added sorting by trusted status 2023-10-20 03:02:14 +02:00
Mark Qvist
01f5d33be4 Updated gitignore 2023-10-20 02:41:37 +02:00
Mark Qvist
a7c84660a0 Added map view and telemetry configuration 2023-10-20 02:41:05 +02:00
Mark Qvist
f0fa742339 Implemented basic telemetry manager 2023-10-20 02:39:23 +02:00
Mark Qvist
79c5aacc6f Fixed plyer sensors 2023-10-20 02:37:27 +02:00
Mark Qvist
3ea7a9bbe4 Adjusted logging 2023-10-20 02:36:31 +02:00
Mark Qvist
3a06e74e4c Updated permissions 2023-10-20 02:33:35 +02:00
Mark Qvist
404649f805 Added mapview module 2023-10-19 15:01:17 +02:00
Mark Qvist
4a6dfa4a47 Added retry option on failed messages 2023-10-16 22:21:38 +02:00
Mark Qvist
bab5bd014e Updated makefile 2023-10-16 20:21:57 +02:00
Mark Qvist
a80c646a24 Updated build code 2023-10-16 20:16:42 +02:00
Mark Qvist
0d6de5bb91 Updated dependencies and version 2023-10-16 20:07:11 +02:00
Mark Qvist
ceeec1fd41 Added USB device filter 2023-10-15 01:10:10 +02:00
Mark Qvist
a68a882fca Fixed missing connectivity init 2023-10-07 17:36:12 +02:00
Mark Qvist
25fafc5058 Updated build code 2023-10-07 17:14:54 +02:00
Mark Qvist
11288d8a1c Updated info text 2023-10-07 17:12:31 +02:00
Mark Qvist
c853ad3d75 Updated version 2023-10-07 16:57:00 +02:00
Mark Qvist
5e8ed17bb3 Added e-ink display mode 2023-10-07 16:54:38 +02:00
Mark Qvist
a4ecfb12b9 Added ability to export RPC keys for use with other instances, primarily on Termux/Android. 2023-10-07 12:59:59 +02:00
Mark Qvist
9d0ba490c7 Updated version code 2023-10-02 18:02:16 +02:00
Mark Qvist
a09c7f07dd Removed inadverdent character limit on print command field 2023-09-25 16:48:48 +02:00
Mark Qvist
2b1da8b6b2 Updated build number 2023-09-22 11:57:14 +02:00
Mark Qvist
dcabec0582 Updated readme 2023-09-21 02:38:35 +02:00
Mark Qvist
21ae433be7 Updated readme 2023-09-21 02:25:01 +02:00
Mark Qvist
5a9c128beb Updated readme 2023-09-21 02:11:04 +02:00
Mark Qvist
51b8fff517 Fixed missing config key init 2023-09-21 01:59:37 +02:00
Mark Qvist
78e9ba4bdd Updated dependencies 2023-09-21 01:59:17 +02:00
Mark Qvist
857a6aa83b Fixed conversation edit name display 2023-09-21 01:59:06 +02:00
Mark Qvist
96cbca2684 Fixed content-type header on APK file downloads 2023-09-21 00:05:21 +02:00
Mark Qvist
5ca59cdf3b Updated version 2023-09-20 21:42:20 +02:00
Mark Qvist
458ba51445 Added better conversation list sorting 2023-09-20 21:41:26 +02:00
Mark Qvist
ce9f9f42d7 Added ability to ignore unknown senders 2023-09-20 20:26:19 +02:00
Mark Qvist
26aa9dc1bf Added repository server and APK sharing 2023-09-20 20:12:47 +02:00
Mark Qvist
9c802e0b70 Updated gitignore 2023-09-20 20:11:48 +02:00
Mark Qvist
4ae073d13c Added repository server assets 2023-09-20 20:10:38 +02:00
Mark Qvist
579c30e558 Added RNode airtime controls 2023-09-13 21:14:30 +02:00
Mark Qvist
306228fb3f Updated version code 2023-08-15 14:04:42 +02:00
Mark Qvist
3212f41625 Keyboard settings 2023-08-15 13:36:44 +02:00
Mark Qvist
f482d72447 Updated readme 2023-08-15 12:49:16 +02:00
Mark Qvist
7cadad6776 Updated install section 2023-08-15 12:47:54 +02:00
Mark Qvist
5626342cbf Increased MDSwitch hit zone 2023-08-15 12:45:41 +02:00
Mark Qvist
14cd17c54e Updated version 2023-08-15 11:38:43 +02:00
Mark Qvist
fb89cab76e Updated dependencies 2023-08-15 11:30:02 +02:00
Mark Qvist
3349d1f93b Updated install section 2023-08-15 11:24:54 +02:00
Mark Qvist
221e62b811 Updated layouts 2023-07-10 20:06:17 +02:00
Mark Qvist
2e1e81f265 Cleanup 2023-07-10 19:29:34 +02:00
Mark Qvist
c24278b837 Cleanup 2023-07-10 19:24:12 +02:00
Mark Qvist
31adf20d65 Cleanup 2023-07-10 19:20:24 +02:00
Mark Qvist
6650b1e03c Cleanup 2023-07-10 18:41:29 +02:00
Mark Qvist
4ffb593ea0 Updated build spec 2023-07-10 03:01:14 +02:00
Mark Qvist
67a8f61af8 Updated build system for Kivy 2.2.1 2023-07-10 02:49:58 +02:00
Mark Qvist
23e6b6e0c6 Updated version code 2023-02-04 21:22:45 +01:00
Mark Qvist
d1a586cd82 Cleanup 2023-02-04 20:59:59 +01:00
Mark Qvist
632465d78b Updated gitignore 2023-02-04 20:56:32 +01:00
Mark Qvist
1d2f785e70 Revert qrcode to fix invalid import. Update FileProvider class. 2023-02-04 20:56:10 +01:00
Mark Qvist
0bd99d3505 Updated build spec 2023-02-03 20:32:35 +01:00
Mark Qvist
0cafdff745 Updated version and dependencies 2022-12-24 00:00:23 +01:00
Mark Qvist
3d26735efd Updated version and dependencies 2022-12-24 00:00:04 +01:00
Mark Qvist
930363f9a3 Fixed missing check for empty app data in announce handler 2022-12-23 23:23:17 +01:00
Mark Qvist
d4f8d8e30d Updated service timeout 2022-12-22 21:36:37 +01:00
Mark Qvist
bb28584091 Updated RNS dependency 2022-12-22 21:34:37 +01:00
Mark Qvist
dd97dba7df Retake multicast lock on WiFi carrier change 2022-12-22 18:21:38 +01:00
Mark Qvist
ee3ed7a017 Updated version 2022-12-22 15:34:57 +01:00
Mark Qvist
693993f52e Improved roaming between different interface types 2022-12-22 14:53:24 +01:00
Mark Qvist
581ec4f0fd Fixed double announce at startup 2022-12-22 11:47:05 +01:00
Mark Qvist
c1acf96d11 Updated default option 2022-12-21 00:55:51 +01:00
Mark Qvist
11a38e20a5 Cleanup 2022-12-21 00:43:10 +01:00
Mark Qvist
0f04612e6c Updated version and dependencies 2022-12-21 00:30:19 +01:00
Mark Qvist
3750770a29 Improved auto announce logic 2022-12-20 20:39:30 +01:00
Mark Qvist
c3b9172233 Improved RNode bluetooth hotplug 2022-12-20 16:02:25 +01:00
Mark Qvist
990cfb024a Change RNode bluetooth usage at runtime 2022-12-20 12:53:50 +01:00
Mark Qvist
bd53bef16e Changed button order 2022-12-20 12:35:07 +01:00
Mark Qvist
3a2ff472ef Updated readme 2022-12-19 23:32:42 +01:00
Mark Qvist
e35c0e0be7 Send debug output to console only for now 2022-12-19 02:09:43 +01:00
Mark Qvist
0abf26d60c Added option to enable debug logging 2022-12-19 02:06:41 +01:00
Mark Qvist
3e0d2bee8b Updated version 2022-12-19 01:53:00 +01:00
Mark Qvist
0980dc7ee0 Increased service heartbeat timeout 2022-12-16 23:57:07 +01:00
Mark Qvist
ac3412e50a Updated version 2022-12-15 17:32:27 +01:00
Mark Qvist
b7c829ac16 Merge branch 'main' of https://git.unsigned.io/markqvist/Sideband 2022-12-15 17:01:43 +01:00
Mark Qvist
b3e403de40 Added error message on service error or crash. Added error message on USB control connection errors. 2022-12-15 17:01:34 +01:00
Mark Qvist
49a55b7094 Added error message on service error or crash. Added error message on USB control connection errors. 2022-12-15 17:01:10 +01:00
Mark Qvist
7d443807f5 Fixed missing config value initialisation 2022-12-15 14:15:23 +01:00
Mark Qvist
324cff2baa Updated readme 2022-11-27 18:09:23 +01:00
Mark Qvist
a1e9504e90 Updated readme 2022-11-28 12:12:11 +01:00
Mark Qvist
34525544ee Fixed QR output path on Darwin. Set message load to 5 instead of 2. 2022-11-24 21:09:33 +01:00
Mark Qvist
77c519f19c Updated versions and dependencies 2022-11-24 19:01:59 +01:00
Mark Qvist
585ad81102 Updated menu layouts 2022-11-23 22:00:12 +01:00
Mark Qvist
7232e6a9ed Updated Bluetooth text 2022-11-23 21:48:32 +01:00
Mark Qvist
982439cc2e Added ability to control bluetooth settings on RNode devices that were connected over USB after Sideband was started 2022-11-23 21:19:31 +01:00
Mark Qvist
c499706daf Cleanup 2022-11-23 20:47:38 +01:00
Mark Qvist
5739b33f06 Fixed bluetooth permissions on API levels < 30 2022-11-23 20:42:56 +01:00
Mark Qvist
1f1cb5ca17 Fixed conversation scroll sometimes being incorrect on loading 2022-11-23 19:15:24 +01:00
Mark Qvist
018b958ded Cleanup 2022-11-23 19:00:16 +01:00
Mark Qvist
75edbf94b9 Mitigated performance issues related to SQLite3 randomly hanging for a second on Android 2022-11-23 18:57:53 +01:00
Mark Qvist
4982e37231 Work on message screen partial loading 2022-11-23 13:28:26 +01:00
Mark Qvist
5cc047c758 Improved settings saving 2022-11-23 11:28:02 +01:00
Mark Qvist
b716855d61 Disabled multi-touch emulation on desktop 2022-11-23 10:41:45 +01:00
Mark Qvist
475dfb4447 Improved conversation list performance. Improved connectivity status formatting. 2022-11-23 10:38:56 +01:00
Mark Qvist
44c864d3eb Rearranged buttons 2022-11-23 08:32:15 +01:00
Mark Qvist
b4b3849d1c Added Android file provider support library 2022-11-22 19:51:26 +01:00
Mark Qvist
6923c7e9b5 Added paper message sharing on Android 2022-11-22 19:47:13 +01:00
Mark Qvist
db2ad8a7a7 Added file provider configuration 2022-11-22 19:46:14 +01:00
Mark Qvist
22b54b3853 Merge branch 'main' of https://git.unsigned.io/markqvist/Sideband 2022-11-22 14:26:13 +01:00
Mark Qvist
0226cbd5c6 Added paper message support 2022-11-22 14:25:56 +01:00
Mark Qvist
933792b5d6 Added intent filters for paper message ingestion 2022-11-22 14:25:21 +01:00
Mark Qvist
6396690009 Updated makefile and buildozer config 2022-11-22 14:25:01 +01:00
Mark Qvist
ac7fda42e2 Updated dependencies 2022-11-22 14:23:56 +01:00
Mark Qvist
10a455cffe Updated readme 2022-11-17 13:46:34 +01:00
Mark Qvist
65206dc820 Updated version code 2022-11-03 23:29:31 +01:00
Mark Qvist
e767dc01aa Updated links 2022-11-03 23:04:28 +01:00
Mark Qvist
cb79716fc2 Close sub-hardware screens on swipe back 2022-11-03 23:00:34 +01:00
Mark Qvist
00ae5e9e81 Update connectivity dialog while open 2022-11-03 22:55:35 +01:00
Mark Qvist
ecb5c6ea40 Added preferred RNode setting for Bluetooth connectivity 2022-11-03 20:22:16 +01:00
Mark Qvist
433adb0c48 Updated dependencies 2022-11-03 19:53:12 +01:00
Mark Qvist
a1091aa30f Added better I2P status to connectivity status dialog. Restructured Connectivity page to work around KivyMD rendering bug. 2022-11-03 19:52:27 +01:00
Mark Qvist
2765185830 Added ability to connect to RNodes over Bluetooth. Added Bluetooth settings for RNode hardware. 2022-11-02 22:31:46 +01:00
Mark Qvist
dbb26780fb Updated version code 2022-11-02 22:30:22 +01:00
Mark Qvist
81c28b35b2 Added ability to control Bluetooth settings of connected RNodes 2022-11-02 22:29:13 +01:00
Mark Qvist
afca31f198 Added Bluetooth settings to UI 2022-11-02 22:28:01 +01:00
Mark Qvist
99dfde4f03 Added bluetooth permissions to manifest 2022-11-02 22:27:30 +01:00
markqvist
eb489370ff
Update README.md 2022-11-01 23:33:50 +01:00
Mark Qvist
76545fec4d Added hardware error communication to UI and improved RNode cleanup on teardown 2022-10-29 16:39:54 +02:00
Mark Qvist
2cdc2bfb58 Added dialog displaying RNode hardware errors on startup 2022-10-29 16:37:40 +02:00
Mark Qvist
04f26343db Updated versioncode 2022-10-29 16:36:34 +02:00
Mark Qvist
2a6a0d568a Added sideband logo for RNode framebuffer 2022-10-29 14:30:08 +02:00
Mark Qvist
7bdafa3797 Fixed missing settings field update 2022-10-25 20:11:16 +02:00
Mark Qvist
7da53ad6a7 Added identity hash display to preferences screen 2022-10-25 16:23:47 +02:00
Mark Qvist
2c0d249eaf Merge branch 'main' of github.com:markqvist/Sideband 2022-10-25 15:59:30 +02:00
Mark Qvist
1e48be1abf Fixed missing OS check for Android-specific code 2022-10-25 15:59:19 +02:00
markqvist
7a0ed6ce06
Update README.md 2022-10-25 14:52:41 +02:00
markqvist
6ccd4e90c1
Update LICENSE 2022-10-25 14:43:36 +02:00
Mark Qvist
623bfd31eb Updated version 2022-10-20 21:34:00 +02:00
Mark Qvist
f76cb9f994 Updated dependency 2022-10-20 21:33:05 +02:00
Mark Qvist
ce4d1967e8 Experimental support for armeabi-v7a and API level 24 2022-10-20 21:32:40 +02:00
Mark Qvist
41774a5629 Disable notifications on Android API levels less than 26 2022-10-20 15:36:29 +02:00
Mark Qvist
c3ac63db6d Updated dependencies 2022-10-20 15:07:43 +02:00
Mark Qvist
4b412aaddd Updated dependencies 2022-10-20 14:58:49 +02:00
Mark Qvist
3383ac39cc Fix orientation lock not being obeyed on Android 2022-10-19 23:14:57 +02:00
Mark Qvist
7039c0330f Improved mitigation for Kivy textfield focus bug 2022-10-19 22:59:42 +02:00
Mark Qvist
645c2790a9 Fixed graphics path 2022-10-19 22:25:20 +02:00
Mark Qvist
bcf756d0ca Updated version code 2022-10-19 20:00:15 +02:00
Mark Qvist
b88aededdf Added graphics 2022-10-19 19:57:28 +02:00
Mark Qvist
b1ba730abb Updated info view 2022-10-19 19:56:39 +02:00
Mark Qvist
f6edbb6bb6 Improved screen switching perfomance 2022-10-19 18:59:04 +02:00
Mark Qvist
98a6ca706c Improved announce stream display 2022-10-19 18:35:23 +02:00
Mark Qvist
b432646c30 Improved exit behaviour on Android. Closes #8. 2022-10-19 17:53:26 +02:00
Mark Qvist
21b35eb606 Improved message formatting for small screen devices 2022-10-19 12:31:09 +02:00
Mark Qvist
88f2808ac8 Added utilised network device info to local interface connectivity stats 2022-10-19 11:58:54 +02:00
Mark Qvist
443662b559 Fixed scrolling behaviour 2022-10-18 19:17:55 +02:00
Mark Qvist
30b888e086 Added interface mode selection 2022-10-18 15:44:36 +02:00
Mark Qvist
4593286589 Added interface mode settings when transport is active 2022-10-18 15:06:25 +02:00
Mark Qvist
a55143d2c8 Gateway all interfaces when transport instance is active. This is a bit of a hack, and needs to be made configurable in the UI, but it will do for now. 2022-10-16 00:25:07 +02:00
Mark Qvist
8dcae9fa7a Updated version code 2022-10-16 00:23:28 +02:00
Mark Qvist
d1b0456660 Cleanup 2022-10-15 23:16:44 +02:00
Mark Qvist
dfa68194f7 Fixed invalid config key 2022-10-15 20:22:45 +02:00
Mark Qvist
4a90c7dcd5 Updated path in service loader 2022-10-15 20:11:47 +02:00
448 changed files with 93865 additions and 13094 deletions

11
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View file

@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: ✨ Feature Request or Idea
url: https://github.com/markqvist/Reticulum/discussions/new?category=ideas
about: Propose and discuss features and ideas
- name: 💬 Questions, Help & Discussion
about: Ask anything, or get help
url: https://github.com/markqvist/Reticulum/discussions/new/choose
- name: 📖 Read the Reticulum Manual
url: https://markqvist.github.io/Reticulum/manual/
about: The complete documentation for Reticulum

View file

@ -0,0 +1,39 @@
---
name: "\U0001F41B Bug Report"
about: Report a reproducible bug
title: ''
labels: ''
assignees: ''
---
**Read the Contribution Guidelines**
Before creating a bug report on this issue tracker, you **must** read the [Contribution Guidelines](https://github.com/markqvist/Reticulum/blob/master/Contributing.md). Issues that do not follow the contribution guidelines **will be deleted without comment**.
- The issue tracker is used by developers of this project. **Do not use it to ask general questions, or for support requests**.
- Ideas and feature requests can be made on the [Discussions](https://github.com/markqvist/Reticulum/discussions). **Only** feature requests accepted by maintainers and developers are tracked and included on the issue tracker. **Do not post feature requests here**.
- After reading the [Contribution Guidelines](https://github.com/markqvist/Reticulum/blob/master/Contributing.md), **delete this section only** (*"Read the Contribution Guidelines"*) from your bug report, **and fill in all the other sections**.
**Describe the Bug**
First of all: Is this really a bug? Is it reproducible?
If this is a request for help because something is not working as you expected, stop right here, and go to the [discussions](https://github.com/markqvist/Reticulum/discussions) instead, where you can post your questions and get help from other users.
If this really is a bug or issue with the software, remove this section of the template, and provide **a clear and concise description of what the bug is**.
**To Reproduce**
Describe in detail how to reproduce the bug.
**Expected Behavior**
A clear and concise description of what you expected to happen.
**Logs & Screenshots**
Please include any relevant log output. If applicable, also add screenshots to help explain your problem. In most cases, without any relevant log output, we will not be able to determine the cause of the bug, or reproduce it.
**System Information**
- OS and version
- Python version
- Program version
**Additional context**
Add any other context about the problem here.

15
.gitignore vendored
View file

@ -1,3 +1,4 @@
sbapp/kivymd_working
sbapp/.buildozer
sbapp/requirements.txt
sbapp/venv
@ -5,6 +6,7 @@ sbapp/bin
sbapp/app_storage
sbapp/RNS
sbapp/LXMF
sbapp/LXST
sbapp/precompiled
sbapp/*.DS_Store
sbapp/*.pyc
@ -13,9 +15,10 @@ sbapp/dist
sbapp/docs/build
sbapp/sideband*.egg-info
sbapp/sbapp*.egg-info
.buildozer
sbapp/share/mirrors/*
sbapp/share/pkg/*
cache
.buildozer*
requirements.txt
venv
bin
@ -29,4 +32,8 @@ build
dist
docs/build
sideband*.egg-info
sbapp*.egg-info
sbapp*.egg-info
LXST
environment
archived_build_tools
.gradle

67
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,67 @@
# Contributing to Reticulum
Welcome, and thank you for your interest in contributing to Reticulum!
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
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.
In order to keep the discourse navigable and useful, the following types of posts and inquiries will be deleted and ignored:
- 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.
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.
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.
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.
## Reporting Bugs
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.
## Writing Code
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).

3
FUNDING.yml Normal file
View file

@ -0,0 +1,3 @@
liberapay: Reticulum
ko_fi: markqvist
custom: "https://unsigned.io/donate"

1111
LICENSE

File diff suppressed because it is too large Load diff

6
MANIFEST.in Normal file
View file

@ -0,0 +1,6 @@
prune sbapp/patches
prune sbapp/dist
prune recipes
prune docs
prune libs
prune .github

33
MIRROR.md Normal file
View 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.
---
असतो मा सद्गमय
तमसो मा ज्योतिर्गमय
मृत्योर्मा अमृतं गमय

View file

@ -1,3 +1,5 @@
include environment
devapk:
make -C sbapp devapk
@ -24,12 +26,65 @@ cleanbuildozer:
cleanall: clean cleanbuildozer
remove_symlinks:
@echo Removing symlinks for build...
-rm ./RNS
-rm ./LXST
-rm ./LXMF
create_symlinks:
@echo Creating symlinks...
-ln -s ../Reticulum/RNS ./RNS
-ln -s ../LXST/LXST ./LXST
-ln -s ../LXMF/LXMF ./LXMF
preparewheel:
pyclean .
$(MAKE) -C sbapp cleanrns
build_wheel:
python3 setup.py sdist bdist_wheel
compile_wheel:
python3 setup.py bdist_wheel
compile_sourcepkg:
python3 setup.py sdist
update_share:
$(MAKE) -C sbapp fetchshare
build_wheel: remove_symlinks update_share compile_wheel create_symlinks
build_spkg: remove_symlinks update_share compile_sourcepkg create_symlinks
prepare_win_pkg: clean build_spkg
-rm -r build/winpkg
mkdir -p build/winpkg
LC_ALL=C $(MAKE) -C ../Reticulum clean build_spkg
cp ../Reticulum/dist/rns-*.*.*.tar.gz build/winpkg
cd build/winpkg; tar -zxf rns-*.*.*.tar.gz
mv build/winpkg/rns-*.*.*/RNS build/winpkg; rm -r build/winpkg/rns-*.*.*
LC_ALL=C $(MAKE) -C ../LXMF clean build_spkg
cp ../LXMF/dist/lxmf-*.*.*.tar.gz build/winpkg
cd build/winpkg; tar -zxf lxmf-*.*.*.tar.gz
mv build/winpkg/lxmf-*.*.*/LXMF build/winpkg; rm -r build/winpkg/lxmf-*.*.*
LC_ALL=C $(MAKE) -C ../LXST clean build_spkg
cp ../LXST/dist/lxst-*.*.*.tar.gz build/winpkg
cd build/winpkg; tar -zxf lxst-*.*.*.tar.gz
mv build/winpkg/lxst-*.*.*/LXST build/winpkg; rm -r build/winpkg/lxst-*.*.*
rm build/winpkg/LXST/filterlib*.so
cp dist/sbapp-*.*.*.tar.gz build/winpkg
cd build/winpkg; tar -zxf sbapp-*.*.*.tar.gz
mv build/winpkg/sbapp-*.*.*/* build/winpkg; rm -r build/winpkg/sbapp-*.*.*
rm build/winpkg/LXST/Codecs/libs/pyogg/libs/macos -r
rm build/winpkg/sbapp/Makefile
rm build/winpkg/sbapp/buildozer.spec
cp winbuild.bat build/
mv build/winpkg build/sideband_sources
chmod -R a+rw build/sideband_sources
cd build; zip -r winbuild.zip sideband_sources winbuild.bat
mv build/winbuild.zip dist/winbuild.zip
build_winexe: prepare_win_pkg
cp dist/winbuild.zip $(WINDOWS_BUILD_TARGET)
release: build_wheel apk fetchapk
@ -37,4 +92,4 @@ upload:
@echo Ready to publish release, hit enter to continue
@read VOID
@echo Uploading to PyPi...
twine upload dist/sbapp-*
twine upload dist/sbapp-*

412
README.md
View file

@ -1,6 +1,30 @@
# Sideband
Sideband <img align="right" src="https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg"/>
=========
Sideband is an LXMF client for Android, Linux and macOS. It allows you to communicate with other people or LXMF-compatible systems over Reticulum networks using LoRa, Packet Radio, WiFi, I2P, or anything else Reticulum supports.
> [!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.
![Screenshot](https://github.com/markqvist/Sideband/raw/main/docs/screenshots/devices_small.webp)
@ -8,49 +32,399 @@ Sideband is completely free, end-to-end encrypted, permission-less, anonymous an
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. Please read the Guide section included in the program, to get an understanding of how Sideband differs from other messaging systems.
The program currently includes basic functionality for secure and independent communication, and many useful features are planned for implementation. Sideband is currently released as a beta version. Please help make all the functionality a reality by supporting the development with donations.
# Functionality & Features
Sideband works well with the terminal-based LXMF client [Nomad Network](https://github.com/markqvist/nomadnet), which allows you to easily host Propagation Nodes for your LXMF network, and more.
Sideband provides many useful and interesting functions, such as:
If you want to help develop this program, get in touch.
- **Secure** and **self-sovereign** messaging and voice calls using the LXMF and LXST protocols over Reticulum.
- **Image** and **file transfers** over all supported mediums.
- **Audio messages** that work even over **LoRa** and **radio links**, thanks to [Codec2](https://github.com/drowe67/codec2/) and [Opus](https://github.com/xiph/opus) encoding.
- Secure and direct P2P **telemetry and location sharing**. No third parties or servers ever have your data.
- The telemetry system is **completely extensible** via [simple plugins](#creating-plugins).
- Situation display on both online and **locally stored offline maps**.
- Geospatial awareness calculations.
- Exchanging messages through **encrypted QR-codes on paper**, or through messages embedded directly in **lxm://** links.
- Using **Android devices as impromptu Reticulum routers** (*Transport Instances*), for setting up or extending networks easily.
- Remote **command execution and response engine**, with built-in commands, such as `ping`, `signal` reports and `echo`, and **full plugin expandability**.
- 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.
## Installation
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.
For your Android devices, download an [APK on the latest release](https://github.com/markqvist/Sideband/releases/latest) page. If you prefer to install via F-Droid, you can add the [IzzyOnDroid Repository](https://android.izzysoft.de/repo/info) to your F-Droid client, which includes Sideband.
# Installation
A DMG file containing a macOS app bundle is also available on the [latest release](https://github.com/markqvist/Sideband/releases/latest) page.
Sideband can run on most computing devices, but installation methods vary by device type and operating system. For installation instructions, please find the relevant section below.
Aditionally, you can install Sideband with ``pip`` on Linux and macOS:
- [Android](#on-android)
- [Linux](#on-linux)
- [Raspberry Pi](#on-raspberry-pi)
- [MacOS](#on-macos)
- [Windows](#on-windows)
## On Android
For your Android devices, you can download an [APK on the latest release page](https://github.com/markqvist/Sideband/releases/latest).
After the application is installed on your Android device, it is also possible to pull updates directly through the **Repository** section of the application.
The Sideband APK file is always signed with a consistent signing certificate directly at build time. Before installing it for the first time, you can verify that the APK has not been modified, by checking that the APK file's signing certificate matches these hashes:
```text
SHA-256 digest: 1c65f01f586a2b73ac4eb8bf48730b3899d046447185fd9d005685a4af20cdea
SHA-1 digest: 4ab9269c320c72f4e4057ec7ea5acade320c2a48
MD5 digest: 09afff8c505089a544ad2bf371c29422
```
Sideband will never be released on app store platforms that does not support complete control of the APK signing directly from the developer. If you download Sideband from any other source than this repository, and the certificate hashes do not match, **do not install it**.
The Android version of Sideband has been carefully set up to **not** use any Android APIs or functionality that are dependent on Google (or other vendor-specific) components or libraries. It uses only raw Android OS APIs, and accesses them directly, instead of through "compatibility", "support" or "helper" libraries, which can often hijack application data flow into privacy-compromising pipelines controlled by Google or other vendors.
This also means that Sideband is designed to be fully compatible with custom (and more privacy-friendly) Android versions and ROMs, such as GrapheneOS, de-googled devices and other custom ROMs.
## On Linux
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
# Install Sideband and dependencies on Linux
# 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.
#### Basic Installation
You will first need to install a few dependencies for voice calls, audio messaging and Codec2 support to work:
```bash
# For Debian 13+, Ubuntu 24.04+ and derivatives
sudo apt install python3-pip python3-pyaudio libopusfile0 codec2 xclip xsel
# For Debian 12+, Ubuntu 22.04+ and derivatives
sudo apt install python3-pip python3-pyaudio python3-dev build-essential libopusfile0 portaudio19-dev codec2 xclip xsel
# For Manjaro and derivatives
pamac install python-pyaudio opusfile codec2 xclip xsel
# For Arch and derivatives
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:
```bash
# Finally, install Sideband using pip:
pip install sbapp --break-system-packages
# If Sideband does not show up in your application menu
# or as an executable command in your terminal, reboot
# your computer.
sudo reboot
```
After installation, you can now run Sideband in a number of different ways:
```bash
# The first time you run Sideband, you will need to do it
# from the terminal, for the application launcher item to
# show up. On some distros you may also need to log out
# and back in again, or simply reboot the machine for the
# application entry to show up in your menu.
sideband
# At the first launch, it will add an application icon
# to your launcher or apps menu. You may need to log out
# of your session, and back in for the application to
# show up in your launcher, depending on your distro.
# You can also run Sideband in headless daemon
# mode, for example as a telemetry collector:
sideband --daemon
# You can also run Sideband with more verbose
# log output enabled:
sideband -v
```
If you do not already have Reticulum connectivity set up on your computer or local network, you will probably want to edit the Reticulum configuration file at `~/.reticulum/config` and [add any interfaces](https://reticulum.network/manual/interfaces.html) you need for connectivity.
#### Advanced Installation
You can also install Sideband in various alternative ways:
```bash
# Install Sideband via pipx instead of pip:
pipx install sbapp
# Or, if you intend to run Sideband in headless
# daemon or console mode, you can also install
# it without any of the normal UI dependencies:
pip install sbapp --no-dependencies
# In the case of using --no-dependencies, you
# will still need to manually install the RNS
# and LXMF dependencies:
pip install rns lxmf
# Dependencies can vary slightly on older OS
# versions, due to different package names.
# Install Sideband on Debian 11 and derivatives:
sudo apt install python3-pip python3-pyaudio python3-dev build-essential libopusfile0 portaudio19-dev codec2 xclip xsel
pip install sbapp
# Install Sideband and dependencies on macOS
pip install "sbapp[macos]"
# On Debian 11, run Sideband manually via the
# terminal once to install desktop integration:
python3 -m sbapp.main
```
# Run it
## On Raspberry Pi
The easiest way to install Sideband on Raspberry Pi is to simply download and run the `aarch64` AppImage. On some versions of Raspberry Pi OS, you *may* also need to install additional libraries for full voice and clipboard functionality with `sudo apt install libopusfile0 xclip xsel`.
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.
To install Sideband on Raspberry Pi with full support for voice calls, audio messages and Codec2, follow these steps:
```bash
# First of all, install the dependencies required
# for audio processing and voice calls.
#
# On Raspberry Pi OS "Trixie" (based on Debian 13)
# or newer, install these packages:
sudo apt install python3-pyaudio codec2 xclip xsel
# You can now install Sideband
pip install sbapp --break-system-packages
# Restart your Raspberry Pi to ensure the program
# is available in your PATH and application menus:
sudo reboot
# Everything is ready! You can now run Sideband
# from the terminal, or from the application menu:
sideband
```
If you're using an older version of Raspberry Pi OS, you will need to install these dependencies instead, before installing Sideband:
```bash
# Package dependencies for Raspberry Pi OS based
# on Debian 12 Bookworm
sudo apt install python3-pip python3-pyaudio python3-dev python3-cryptography build-essential libopusfile0 libsdl2-dev libavcodec-dev libavdevice-dev libavfilter-dev portaudio19-dev codec2 libcodec2-1.0 xclip xsel
```
If you do not already have Reticulum connectivity set up on your computer or local network, you will probably want to edit the Reticulum configuration file at `~/.reticulum/config` and [add any interfaces](https://reticulum.network/manual/interfaces.html) you need for connectivity.
## On macOS
To install Sideband on macOS, you have two options available:
1. An easy to install pre-built disk image package
2. A source package install for more advanced setups
#### Prebuilt Executable
You can download a disk image with Sideband for macOS (ARM and Intel) from the [latest release page](https://github.com/markqvist/Sideband/releases/latest). Simply mount the downloaded disk image, drag `Sideband` to your applications folder, and run it.
**Please note!** If you have application install restrictions enabled on your macOS install, or have restricted your system to only allow installation of application from the Apple App Store, you will need to create an exception for Sideband. The Sideband application will *never* be distributed with an Apple-controlled digital signature, as this will allow Apple to simply disable Sideband from running on your system if they decide to do so, or are forced to by authorities or other circumstances.
If you install Sideband from the DMG file, it is still recommended to install the `rns` package via the `pip` or `pipx` package manager, so you can use the RNS utility programs, like `rnstatus` to see interface and connectivity status from the terminal. If you already have Python and `pip` installed on your system, simply open a terminal window and use one of the following commands:
```bash
# Install Reticulum and utilities with pip:
pip3 install rns --user
# On some versions, you may need to use the
# flag --break-system-packages to install:
pip3 install rns --user --break-system-packages
```
If you do not have Python and `pip` available, [download and install it](https://www.python.org/downloads/) first.
If you do not already have Reticulum connectivity set up on your computer or local network, you will probably want to edit the Reticulum configuration file at `~/.reticulum/config` and [add any interfaces](https://reticulum.network/manual/interfaces.html) you need for connectivity.
#### Source Package Install
For more advanced setups, including the ability to run Sideband in headless daemon mode, enable debug logging output, configuration import and export and more, you may want to install it from the source package via `pip` instead.
To install Sideband via `pip`, follow these instructions:
```bash
# Install Sideband and dependencies on macOS using pip:
pip3 install sbapp --user
# Or, if your Python environment is externally managed:
pip3 install sbapp --user --break-system-packages
# Important note! On some macOS versions, programs that
# were installed with pip does not get added to your
# PATH environment variable. If this is the case, pip
# will print out a warning about it during installation.
# In that case, you will have to manually add the path
# shown in the installation warning to your PATH, before
# you can run commands such as "sideband" or "rnstatus"
# from your shell.
# Run Sideband from the terminal:
#################################
sideband
# or
python3 -m sbapp.main
# Enable debug logging:
#################################
sideband -v
# or
python3 -m sbapp.main -v
# Start Sideband in daemon mode:
#################################
sideband -d
# or
python3 -m sbapp.main -d
# If Python and pip was installed correctly,
# you can simply use the "sideband" command
# directly. Otherwise, you will manually
# need to add the pip binaries directory to
# your PATH environment variable, or start
# Sideband via the "python3 -m sbapp.main"
# syntax.
```
## Support Sideband Development
## On Windows
To install Sideband on Windows, you have two options available:
1. An easy to install pre-built executable package
2. A source package install for more advanced setups
#### Prebuilt Executable
Simply download the packaged Windows ZIP file from the [latest release page](https://github.com/markqvist/Sideband/releases/latest), unzip the file, and run `Sideband.exe` from the unzipped directory. You can create desktop or start menu shortcuts from this executable if needed.
When running Sideband for the first time, a default Reticulum configuration file will be created, if you don't already have one. If you don't have any existing Reticulum connectivity available locally, you may want to edit the file, located at `C:\Users\USERNAME\.reticulum\config` and manually add an interface that provides connectivity to a wider network. If you just want to connect over the Internet, you can add one of the public hubs on the [Reticulum Testnet](https://reticulum.network/connect.html).
#### Installing Reticulum Utilities
Though the ZIP file contains everything necessary to run Sideband, it is also recommended to install the Reticulum command line utilities separately, so that you can use commands like `rnstatus` and `rnsd` from the command line. This will make it easier to manage Reticulum connectivity on your system. If you do not already have Python installed on your system, [download and install it](https://www.python.org/downloads/) first.
**Important!** When asked by the installer, make sure to add the Python program to your `PATH` environment variables. If you don't do this, you will not be able to use the `pip` installer, or run any of the installed commands. When Python has been installed, you can open a command prompt and install the Reticulum package via `pip`:
```bash
pip install rns
```
#### Source Package Install
For more advanced setups, including the ability to run Sideband in headless daemon mode, enable debug logging output, configuration import and export and more, you may want to install it from the source package via `pip` instead.
In this case, you will need to [download and install the latest supported version of Python](https://www.python.org/downloads/release/python-3127/) (currently Python 3.12.7), since very latest Python release, Python 3.13 is currently **not** compatible with the Kivy framework, that Sideband uses to render its user interface. The binary package already includes a compatible Python version, so if you are running Sideband from that, there is no need to install a specific version of Python.
When Python has been installed, you can open a command prompt and install Sideband via `pip`:
```bash
pip install sbapp
```
The Sideband application can now be launched by running the command `sideband` in the command prompt. If needed, you can create a shortcut for Sideband on your desktop or in the start menu.
Since this installation method automatically installs the `rns` and `lxmf` packages as well, you will also have access to using all the included RNS and LXMF utilities like `rnstatus`, `rnsd` and `lxmd` on your system.
# Creating Plugins
Sideband features a flexible and extensible plugin system, that allows you to hook all kinds of control, status reporting, command execution and telemetry collection into the LXMF messaging system. Plugins can be created as either *Telemetry*, *Command* or *Service* plugins, for different use-cases.
To create plugins for Sideband, you can find a variety of [code examples](https://github.com/markqvist/Sideband/tree/main/docs/example_plugins) in this repository, that you can use as a basis for writing your own plugins. The example plugins include:
- [Custom telemetry](https://github.com/markqvist/Sideband/blob/main/docs/example_plugins/telemetry.py)
- [Getting BME280 temperature, humidity and pressure](https://github.com/markqvist/Sideband/blob/main/docs/example_plugins/bme280_telemetry.py)
- [Basic commands](https://github.com/markqvist/Sideband/blob/main/docs/example_plugins/basic.py)
- [Location telemetry from GPSd on Linux](https://github.com/markqvist/Sideband/blob/main/docs/example_plugins/gpsd_location.py)
- [Location telemetry from Windows Location Provider](https://github.com/markqvist/Sideband/blob/main/docs/example_plugins/windows_location.py)
- [Getting statistics from your LXMF propagation node](https://github.com/markqvist/Sideband/blob/main/docs/example_plugins/lxmd_telemetry.py)
- [Viewing cameras and streams](https://github.com/markqvist/Sideband/blob/main/docs/example_plugins/view.py)
- [Fetching an XKCD comic](https://github.com/markqvist/Sideband/blob/main/docs/example_plugins/comic.py)
- [Creating a service plugin](https://github.com/markqvist/Sideband/blob/main/docs/example_plugins/service.py)
For creating telemetry plugins, Sideband includes 20+ built-in sensor types to chose from, for representing all kinds telemetry data. If none of those fit your needs, there is a `Custom` sensor type, that can include any kind of data.
Command plugins allow you to define any kind of action or command to be run when receiving command messages from other LXMF clients. In the example directory, you will find various command plugin templates, for example for viewing security cameras or webcams through Sideband.
Service plugins allow you to integrate any kind of service, bridge or other system into Sideband, and have that react to events or state changes in Sideband itself.
# Paper Messaging Example
You can try out the paper messaging functionality by using the following QR-code. It is a paper message sent to the LXMF address `6b3362bd2c1dbf87b66a85f79a8d8c75`. To be able to decrypt and read the message, you will need to import the following base32-encoded Reticulum Identity into the app:
`3BPTDTQCRZPKJT3TXAJCMQFMOYWIM3OCLKPWMG4HCF2T4CH3YZHVNHNRDU6QAZWV2KBHMWBNT2C62TQEVC5GLFM4MN25VLZFSK3ADRQ=`
You can import the identity into Sideband in the **Encryption Keys** part of the program. After the you have imported the identity, you can scan the following QR-code and open it in the app, where it will be decrypted and added to your messages.
<p align="center"><img width="50%" src="https://raw.githubusercontent.com/markqvist/LXMF/master/docs/paper_msg_test.png"/></p>
You can also find the entire message in <a href="lxm://azNivSwdv4e2aoX3mo2MdTAozuI7BlzrLlHULmnVgpz3dNT9CMPVwgywzCJP8FVogj5j_kU7j7ywuvBNcr45kRTrd19c3iHenmnSDe4VEd6FuGsAiT0Khzl7T81YZHPTDhRNp0FdhDE9AJ7uphw7zKMyqhHHxOxqrYeBeKF66gpPxDceqjsOApvsSwggjcuHBx9OxOBy05XmnJxA1unCKgvNfOFYc1T47luxoY3c0dLOJnJPwZuFRytx2TXlQNZzOJ28yTEygIfkDqEO9mZi5lgev7XZJ0DvgioQxMIyoCm7lBUzfq66zW3SQj6vHHph7bhr36dLOCFgk4fZA6yia2MlTT9KV66Tn2l8mPNDlvuSAJhwDA_xx2PN9zKadCjo9sItkAp8r-Ss1CzoUWZUAyT1oDw7ly6RrzGBG-e3eM3CL6u1juIeFiHby7_3cON-6VTUuk4xR5nwKlFTu5vsYMVXe5H3VahiDSS4Q1aqX7I">this link</a>:
`lxm://azNivSwdv4e2aoX3mo2MdTAozuI7BlzrLlHULmnVgpz3dNT9CMPVwgywzCJP8FVogj5j_kU7j7ywuvBNcr45kRTrd19c3iHenmnSDe4VEd6FuGsAiT0Khzl7T81YZHPTDhRNp0FdhDE9AJ7uphw7zKMyqhHHxOxqrYeBeKF66gpPxDceqjsOApvsSwggjcuHBx9OxOBy05XmnJxA1unCKgvNfOFYc1T47luxoY3c0dLOJnJPwZuFRytx2TXlQNZzOJ28yTEygIfkDqEO9mZi5lgev7XZJ0DvgioQxMIyoCm7lBUzfq66zW3SQj6vHHph7bhr36dLOCFgk4fZA6yia2MlTT9KV66Tn2l8mPNDlvuSAJhwDA_xx2PN9zKadCjo9sItkAp8r-Ss1CzoUWZUAyT1oDw7ly6RrzGBG-e3eM3CL6u1juIeFiHby7_3cON-6VTUuk4xR5nwKlFTu5vsYMVXe5H3VahiDSS4Q1aqX7I`
On operating systems that allow for registering custom URI-handlers, you can click the link, and it will be decoded directly in your LXMF client. This works with Sideband on Android.
# Support Sideband Development
You can help support the continued development of open, free and private communications systems by donating via one of the following channels:
- Monero:
```
84FpY1QbxHcgdseePYNmhTHcrgMX4nFfBYtz2GKYToqHVVhJp8Eaw1Z1EedRnKD19b3B8NiLCGVxzKV17UMmmeEsCrPyA5w
```
- Ethereum
```
0x81F7B979fEa6134bA9FD5c701b3501A2e61E897a
```
- Bitcoin
```
3CPmacGm34qYvR6XWLVEJmi2aNe3PZqUuq
bc1p4a6axuvl7n9hpapfj8sv5reqj8kz6uxa67d5en70vzrttj0fmcusgxsfk5
```
- Ethereum
```
0xae89F3B94fC4AD6563F0864a55F9a697a90261ff
```
- Liberapay: https://liberapay.com/Reticulum/
- Ko-Fi: https://ko-fi.com/markqvist
<br/>
# License
Unless otherwise noted, this work is licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License][cc-by-nc-sa].
Permission is hereby granted to use Sideband in binary form, for any and all purposes, and to freely distribute binary copies of the program, so long as no payment or compensation is charged or received for such distribution or use.
<img src="https://licensebuttons.net/l/by-nc-sa/4.0/88x31.png" align="right">
[cc-by-nc-sa]: http://creativecommons.org/licenses/by-nc-sa/4.0/
[cc-by-nc-sa-image]: https://licensebuttons.net/l/by-nc-sa/4.0/88x31.png
[cc-by-nc-sa-shield]: https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg
*Device screenshots generated with [deviceframes](https://deviceframes.com). Thanks!*

415
Zen of Reticulum.md Normal file
View 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*

View file

@ -0,0 +1,45 @@
# This is a bare-minimum command plugin
# example that you can build upon to
# implement your own command plugins.
import RNS
class BasicCommandPlugin(SidebandCommandPlugin):
command_name = "basic_example"
def start(self):
# Do any initialisation work here
RNS.log("Basic command plugin example starting...")
# And finally call start on superclass
super().start()
def stop(self):
# Do any teardown work here
pass
# And finally call stop on superclass
super().stop()
def handle_command(self, arguments, lxm):
response_content = "Hello "+RNS.prettyhexrep(lxm.source_hash)+". "
response_content += "This is a response from the basic command example. It doesn't do much, but here is a list of the arguments you included:\n"
for argument in arguments:
response_content += "\n"+str(argument)
# Let the Sideband core send a reply.
self.get_sideband().send_message(
response_content,
lxm.source_hash,
False, # Don't use propagation by default, try direct first
skip_fields = True, # Don't include any additional fields automatically
no_display = True, # Don't display this message in the message stream
attachment = None, # Don't add any attachment field to this message
image = None, # Don't add any image field to this message
audio = None, # Don't add any audio field to this message
)
# Finally, tell Sideband what class in this
# file is the actual plugin class.
plugin_class = BasicCommandPlugin

View file

@ -0,0 +1,67 @@
# This plugin provides temperature, humidity
# and pressure data via a BME280 sensor
# connected over I2C. The plugin requires
# the "smbus2" and "RPi.bme280" modules to
# be available on your system. These can be
# installed with:
#
# pip install smbus2 RPi.bme280
import os
import RNS
from importlib.util import find_spec
class BME280Plugin(SidebandTelemetryPlugin):
plugin_name = "telemetry_bme280"
I2C_ADDRESS = 0x76
I2C_BUS = 1
# If your BME280 has an offset from the true
# temperature, you can compensate for this
# by modifying this parameter.
TEMPERATURE_CORRECTION = 0.0
def start(self):
RNS.log("BME280 telemetry plugin starting...")
if find_spec("smbus2"): import smbus2
else: raise OSError(f"No smbus2 module available, cannot start BME280 telemetry plugin")
if find_spec("bme280"): import bme280
else: raise OSError(f"No bme280 module available, cannot start BME280 telemetry plugin")
self.sensor_connected = False
try:
self.bme280 = bme280
self.address = self.I2C_ADDRESS
self.bus = smbus2.SMBus(self.I2C_BUS)
self.calibration = self.bme280.load_calibration_params(self.bus, self.address)
self.sensor_connected = True
self.tc = self.TEMPERATURE_CORRECTION
except Exception as e:
RNS.log(f"Could not connect to I2C device while starting BME280 telemetry plugin", RNS.LOG_ERROR)
RNS.log(f"The contained exception was: {e}", RNS.LOG_ERROR)
super().start()
def stop(self):
self.bus.close()
super().stop()
def update_telemetry(self, telemeter):
if telemeter != None:
if self.sensor_connected:
try:
sample = self.bme280.sample(self.bus, self.address, self.calibration); ts = telemeter.sensors
telemeter.synthesize("temperature"); ts["temperature"].data = {"c": round(sample.temperature+self.tc,1)}
telemeter.synthesize("humidity"); ts["humidity"].data = {"percent_relative": round(sample.humidity,1)}
telemeter.synthesize("pressure"); ts["pressure"].data = {"mbar": round(sample.pressure,1)}
except Exception as e:
RNS.log("An error occurred while updating BME280 sensor data", RNS.LOG_ERROR)
RNS.log(f"The contained exception was: {e}", RNS.LOG_ERROR)
plugin_class = BME280Plugin

View file

@ -0,0 +1,74 @@
# This plugin example fetches an XKCD comic
# from an external URL and returns it as an
# embedded image in an LXMF message.
import io
import RNS
import requests
from PIL import Image as PilImage
class ComicCommandPlugin(SidebandCommandPlugin):
command_name = "comic"
def start(self):
# Do any initialisation work here
RNS.log("Comic command plugin example starting...")
# And finally call start on superclass
super().start()
def stop(self):
# Do any teardown work here
pass
# And finally call stop on superclass
super().stop()
def handle_command(self, arguments, lxm):
comic_source = "https://imgs.xkcd.com/comics/tsp_vs_tbsp.png"
response_content = f"The source for this comic is:\n{comic_source}"
try:
image_request = requests.get(comic_source, stream=True)
if image_request.status_code == 200:
max_size = 320, 320
with PilImage.open(io.BytesIO(image_request.content)) as im:
im.thumbnail(max_size)
buf = io.BytesIO()
im.save(buf, format="webp", quality=22)
image_field = ["webp", buf.getvalue()]
# Send the fetched comic as a message
self.get_sideband().send_message(
response_content,
lxm.source_hash,
False, # Don't use propagation by default, try direct first
skip_fields = True, # Don't include any additional fields automatically
no_display = True, # Don't display this message in the message stream
image = image_field, # Add the scaled and compressed image
)
else:
# Send an error message
self.get_sideband().send_message(
"The specified comic could not be downloaded",
lxm.source_hash,
False, # Don't use propagation by default, try direct first
skip_fields = True, # Don't include any additional fields automatically
no_display = True, # Don't display this message in the message stream
)
except Exception as e:
# Send an error message
self.get_sideband().send_message(
"An error occurred while trying to fetch the specified comic:\n\n"+str(e),
lxm.source_hash,
False, # Don't use propagation by default, try direct first
skip_fields = True, # Don't include any additional fields automatically
no_display = True, # Don't display this message in the message stream
)
# Finally, tell Sideband what class in this
# file is the actual plugin class.
plugin_class = ComicCommandPlugin

View file

@ -0,0 +1,113 @@
# This plugin allows using GPSd as a location
# telemetry provider on Linux systems.
# This plugin requires the "gpsdclient" pip
# package to be installed on your system.
# Install it with: pip install gpsdclient
import RNS
import time
import threading
from gpsdclient import GPSDClient
class GpsdLocationPlugin(SidebandTelemetryPlugin):
plugin_name = "gpsd_location"
def __init__(self, sideband_core):
self.connect_timeout = 5.0
self.client = None
self.client_connected = False
self.should_run = False
self.latitude = None
self.longitude = None
self.altitude = None
self.speed = None
self.bearing = None
self.accuracy = None
self.last_update = None
super().__init__(sideband_core)
def start(self):
RNS.log("Starting Linux GPSd Location provider plugin...")
self.should_run = True
update_thread = threading.Thread(target=self.update_job, daemon=True)
update_thread.start()
super().start()
def stop(self):
self.should_run = False
super().stop()
def update_job(self):
while self.should_run:
RNS.log("Connecting to local GPSd...", RNS.LOG_DEBUG)
self.client_connected = False
try:
self.client = GPSDClient(timeout=self.connect_timeout)
for result in self.client.dict_stream(convert_datetime=True, filter=["TPV"]):
if not self.client_connected:
RNS.log("Connected, streaming GPSd data", RNS.LOG_DEBUG)
self.client_connected = True
gpsd_latitude = result.get("lat", None)
gpsd_longitude = result.get("lon", None)
gpsd_altitude = result.get("altHAE", None)
gpsd_speed = result.get("speed", None)
gpsd_bearing = result.get("track", None)
gpsd_required = [gpsd_latitude, gpsd_longitude, gpsd_altitude, gpsd_speed, gpsd_bearing]
if not None in gpsd_required:
self.last_update = time.time()
self.latitude = gpsd_latitude
self.longitude = gpsd_longitude
self.altitude = gpsd_altitude
self.speed = gpsd_speed*3.6 # Convert from m/s to km/h
self.bearing = gpsd_bearing
epx = result.get("epx", None); epy = result.get("epy", None)
epv = result.get("epv", None)
if epx != None and epy != None and epv != None:
self.accuracy = max(epx, epy, epv)
else:
self.accuracy = None
except Exception as e:
RNS.log("Could not connect to local GPSd, retrying later", RNS.LOG_ERROR)
time.sleep(5)
def has_location(self):
lat = self.latitude != None; lon = self.longitude != None
alt = self.altitude != None; spd = self.speed != None
brg = self.bearing != None; acc = self.accuracy != None
return lat and lon and alt and spd and brg and acc
def update_telemetry(self, telemeter):
if self.is_running() and telemeter != None:
if self.has_location():
RNS.log("Updating location from gpsd", RNS.LOG_DEBUG)
if not "location" in telemeter.sensors:
telemeter.synthesize("location")
telemeter.sensors["location"].latitude = self.latitude
telemeter.sensors["location"].longitude = self.longitude
telemeter.sensors["location"].altitude = self.altitude
telemeter.sensors["location"].speed = self.speed
telemeter.sensors["location"].bearing = self.bearing
telemeter.sensors["location"].accuracy = self.accuracy
telemeter.sensors["location"].stale_time = 5
telemeter.sensors["location"].set_update_time(self.last_update)
else:
RNS.log("No location from GPSd yet", RNS.LOG_DEBUG)
# Finally, tell Sideband what class in this
# file is the actual plugin class.
plugin_class = GpsdLocationPlugin

View file

@ -0,0 +1,41 @@
# This is an LXMd telemetry plugin that
# queries a running LXMF Propagation Node
# for status and statistics.
import RNS
class LXMdTelemetryPlugin(SidebandTelemetryPlugin):
plugin_name = "lxmd_telemetry"
def start(self):
# Do any initialisation work here
RNS.log("LXMd telemetry plugin starting...")
# And finally call start on superclass
super().start()
def stop(self):
# Do any teardown work here
pass
# And finally call stop on superclass
super().stop()
def update_telemetry(self, telemeter):
if telemeter != None:
if not "lxmf_propagation" in telemeter.sensors:
# Create lxmd status sensor if it is not already
# enabled in the running telemeter instance
telemeter.enable("lxmf_propagation")
# Set the identity file used to communicate with
# the running LXMd instance.
telemeter.sensors["lxmf_propagation"].set_identity("~/.lxmd/identity")
# You can also get LXMF Propagation Node stats
# from an LXMd instance running inside nomadnet
# telemeter.sensors["lxmf_propagation"].set_identity("~/.nomadnetwork/storage/identity")
# Finally, tell Sideband what class in this
# file is the actual plugin class.
plugin_class = LXMdTelemetryPlugin

View 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

View 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

View file

@ -0,0 +1,38 @@
# This is a bare-minimum service plugin
# example that you can build upon to
# implement your own service plugins.
import RNS
import time
import threading
class BasicServicePlugin(SidebandServicePlugin):
service_name = "service_example"
def service_jobs(self):
while self.should_run:
time.sleep(5)
RNS.log("Service ping from "+str(self))
RNS.log("Jobs stopped running for "+str(self))
def start(self):
# Do any initialisation work here
RNS.log("Basic service plugin example starting...")
self.should_run = True
self.service_thread = threading.Thread(target=self.service_jobs, daemon=True)
self.service_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()
# Finally, tell Sideband what class in this
# file is the actual plugin class.
plugin_class = BasicServicePlugin

View file

@ -0,0 +1,67 @@
# This is a basic telemetry plugin
# example that you can build upon to
# implement your own telemetry plugins.
import RNS
class BasicTelemetryPlugin(SidebandTelemetryPlugin):
plugin_name = "telemetry_example"
def start(self):
# Do any initialisation work here
RNS.log("Basic telemetry plugin example starting...")
# And finally call start on superclass
super().start()
def stop(self):
# Do any teardown work here
pass
# And finally call stop on superclass
super().stop()
def update_telemetry(self, telemeter):
if telemeter != None:
# Create power consumption sensors
telemeter.synthesize("power_consumption")
telemeter.sensors["power_consumption"].update_consumer(2163.15, type_label="Heater consumption")
telemeter.sensors["power_consumption"].update_consumer(12.7/1e6, type_label="Receiver consumption")
telemeter.sensors["power_consumption"].update_consumer(0.055, type_label="LED consumption", custom_icon="led-on")
telemeter.sensors["power_consumption"].update_consumer(982.22*1e9, type_label="Smelter consumption")
# Create power production sensor
telemeter.synthesize("power_production")
telemeter.sensors["power_production"].update_producer(5732.15, type_label="Solar production", custom_icon="solar-power-variant")
# Create storage sensor
telemeter.synthesize("nvm")
telemeter.sensors["nvm"].update_entry(capacity=256e9, used=38.48e9, type_label="SSD")
# Create RAM sensors
telemeter.synthesize("ram")
telemeter.sensors["ram"].update_entry(capacity=8e9, used=3.48e9, type_label="RAM")
telemeter.sensors["ram"].update_entry(capacity=16e9, used=0.72e9, type_label="Swap")
# Create CPU sensor
telemeter.synthesize("processor")
telemeter.sensors["processor"].update_entry(current_load=0.42, clock=2.45e9, load_avgs=[0.27, 0.43, 0.49], type_label="CPU")
# Create custom sensor
telemeter.synthesize("custom")
telemeter.sensors["custom"].update_entry("311 seconds", type_label="Specific impulse is", custom_icon="rocket-launch")
telemeter.sensors["custom"].update_entry("a lie", type_label="The cake is", custom_icon="cake-variant")
# Create tank sensors
telemeter.synthesize("tank")
telemeter.sensors["tank"].update_entry(capacity=1500, level=728, type_label="Fresh water", custom_icon="cup-water")
telemeter.sensors["tank"].update_entry(capacity=2000, level=122, unit="L", type_label="Waste tank")
# Create fuel sensor
telemeter.synthesize("fuel")
telemeter.sensors["fuel"].update_entry(capacity=75, level=61, type_label="Main")
telemeter.sensors["fuel"].update_entry(capacity=15, level=15, type_label="Reserve")
# Finally, tell Sideband what class in this
# file is the actual plugin class.
plugin_class = BasicTelemetryPlugin

View file

@ -0,0 +1,328 @@
# This plugin lets you remotely query and view a
# number of different image sources in Sideband,
# including remote or local webcams, video sources
# or images stored in a filesystem.
#
# This plugin requires the "pillow" pip package.
#
# For HTTP and local file sources, no extras are
# required, but for fetching images from connected
# video sources, you need "opencv-python" from pip.
import io
import os
import RNS
import time
import queue
import requests
import threading
import importlib
from PIL import Image as PilImage
if importlib.util.find_spec("cv2") != None:
import cv2
# Add view sources to the plugin
def register_view_sources():
ViewCommandPlugin.add_source("xkcd", HttpSource("https://imgs.xkcd.com/comics/tsp_vs_tbsp.png"))
ViewCommandPlugin.add_source("camera", CameraSource(camera_index=0))
ViewCommandPlugin.add_source("rocks", FileSource("~/Downloads/rocks.jpg"))
ViewCommandPlugin.add_source("osaka", StreamSource("http://honjin1.miemasu.net/nphMotionJpeg?Resolution=640x480&Quality=Standard"))
ViewCommandPlugin.add_source("factory", StreamSource("http://takemotopiano.aa1.netvolante.jp:8190/nphMotionJpeg?Resolution=640x480&Quality=Standard&Framerate=1"))
quality_presets = {
"lora": {"max": 160, "quality": 18},
"low": {"max": 256, "quality": 25},
"default": {"max": 320, "quality": 33},
"medium": {"max": 480, "quality": 50},
"high": {"max": 960, "quality": 65},
"hd": {"max": 1920, "quality": 75},
"4k": {"max": 3840, "quality": 65},
}
if not "default" in quality_presets:
raise ValueError("No default quality preset defined, please define one and reload the plugin")
class ViewSource():
DEFAULT_STALE_TIME = 3.14159
def __init__(self):
self.source_data = None
self.last_update = 0
self.stale_time = ViewSource.DEFAULT_STALE_TIME
def is_stale(self):
return time.time() > self.last_update + self.stale_time
def update(self):
raise NotImplementedError()
def scaled_image(self, max_dimension, quality):
with PilImage.open(io.BytesIO(self.source_data)) as im:
im.thumbnail((max_dimension, max_dimension))
buf = io.BytesIO()
im.save(buf, format="webp", quality=quality)
return buf.getvalue()
def get_image_field(self, preset="default"):
if not preset in quality_presets:
preset = "default"
try:
if self.is_stale():
self.update()
if self.source_data != None:
max_dimension = quality_presets[preset]["max"]
quality = quality_presets[preset]["quality"]
return ["webp", self.scaled_image(max_dimension, quality)]
except Exception as e:
RNS.log(f"Could not create image field for {self}. The contained exception was: {e}", RNS.LOG_ERROR)
RNS.trace_exception(e)
return None
class HttpSource(ViewSource):
def __init__(self, url):
self.url = url
super().__init__()
def update(self):
image_request = requests.get(self.url, stream=True)
if image_request.status_code == 200:
self.source_data = image_request.content
self.last_update = time.time()
else:
self.source_data = None
class CameraSource(ViewSource):
def __init__(self, camera_index=0, camera_width=1280, camera_height=720):
self.camera_index = camera_index
self.camera_width = camera_width
self.camera_height = camera_height
self.camera_ready = False
self.frame_queue = queue.Queue()
super().__init__()
self.start_reading()
def start_reading(self):
self.camera = cv2.VideoCapture(self.camera_index)
self.camera.set(cv2.CAP_PROP_FRAME_WIDTH, self.camera_width)
self.camera.set(cv2.CAP_PROP_FRAME_HEIGHT, self.camera_height)
threading.Thread(target=self.read_frames, daemon=True).start()
def read_frames(self):
try:
while True:
ret, frame = self.camera.read()
self.camera_ready = True
if not ret:
self.camera_ready = False
break
if not self.frame_queue.empty():
try:
self.frame_queue.get_nowait()
except queue.Empty:
pass
self.frame_queue.put(frame)
except Exception as e:
RNS.log("An error occurred while reading frames from the camera: "+str(e), RNS.LOG_ERROR)
self.release_camera()
def update(self):
if not self.camera:
self.start_reading()
while not self.camera_ready:
time.sleep(0.2)
retval, frame = self.camera.read()
if not retval:
self.source_data = None
else:
retval, buffer = cv2.imencode(".png", frame)
self.source_data = io.BytesIO(buffer).getvalue()
self.last_update = time.time()
def release_camera(self):
try:
self.camera.release()
except:
pass
self.camera = None
self.camera_ready = False
class StreamSource(ViewSource):
DEFAULT_IDLE_TIMEOUT = 10
def __init__(self, url=None):
self.url = url
self.stream_ready = False
self.frame_queue = queue.Queue()
self.stream = None
self.started = 0
self.idle_timeout = StreamSource.DEFAULT_IDLE_TIMEOUT
super().__init__()
self.start_reading()
def start_reading(self):
self.stream = cv2.VideoCapture(self.url)
self.started = time.time()
threading.Thread(target=self.read_frames, daemon=True).start()
def read_frames(self):
try:
while max(self.last_update, self.started)+self.idle_timeout > time.time():
ret, frame = self.stream.read()
if not ret:
self.stream_ready = False
else:
self.stream_ready = True
if not self.frame_queue.empty():
if self.frame_queue.qsize() > 1:
try:
self.frame_queue.get_nowait()
except queue.Empty:
pass
self.frame_queue.put(frame)
RNS.log(str(self)+" idled", RNS.LOG_DEBUG)
except Exception as e:
RNS.log("An error occurred while reading frames from the stream: "+str(e), RNS.LOG_ERROR)
self.release_stream()
def update(self):
if not self.stream:
self.start_reading()
while not self.stream_ready:
time.sleep(0.2)
if self.stream == None:
self.source_data = None
return
frame = self.frame_queue.get()
retval, buffer = cv2.imencode(".png", frame)
self.source_data = io.BytesIO(buffer).getvalue()
self.last_update = time.time()
def release_stream(self):
try:
self.stream.release()
except:
pass
self.stream = None
self.stream_ready = False
class FileSource(ViewSource):
def __init__(self, path):
self.path = os.path.expanduser(path)
super().__init__()
def update(self):
try:
with open(self.path, "rb") as image_file:
self.source_data = image_file.read()
except Exception as e:
RNS.log("Could not read image at \"{self.path}\": "+str(e), RNS.LOG_ERROR)
self.source_data = None
class ViewCommandPlugin(SidebandCommandPlugin):
command_name = "view"
sources = {}
stamptimefmt = "%Y-%m-%d %H:%M:%S"
def start(self):
RNS.log("View command plugin starting...")
super().start()
def stop(self):
super().stop()
@staticmethod
def add_source(name, source):
ViewCommandPlugin.sources[name] = source
def message_response(self, message, destination):
self.get_sideband().send_message(
message,
destination,
False, # Don't use propagation by default, try direct first
skip_fields = True, # Don't include any additional fields automatically
no_display = True, # Don't display this message in the message stream
)
def image_response(self, message, image_field, destination):
self.get_sideband().send_message(
message,
destination,
False, # Don't use propagation by default, try direct first
skip_fields = True, # Don't include any additional fields automatically
no_display = True, # Don't display this message in the message stream
image = image_field, # Add the scaled and compressed image
)
def timestamp_str(self, time_s):
timestamp = time.localtime(time_s)
return time.strftime(self.stamptimefmt, timestamp)
def handle_command(self, arguments, lxm):
requestor = lxm.source_hash
if len(arguments) == 0:
self.message_response("No view source was specified", requestor)
return
if arguments[0] == "--list" or arguments[0] == "-l":
if len(self.sources) == 0:
response = "No sources available on this system"
else:
response = "Available Sources:\n"
for source in self.sources:
response += "\n - "+str(source)
self.message_response(response, requestor)
return
try:
source = arguments[0]
if len(arguments) > 1:
quality_preset = arguments[1]
else:
quality_preset = "default"
if not source in self.sources:
self.message_response("The specified view source does not exist on this system", requestor)
else:
image_field = self.sources[source].get_image_field(quality_preset)
image_timestamp = self.timestamp_str(self.sources[source].last_update)
message = "#!md\n" # Tell sideband to format this message
message += f"Source [b]{source}[/b] at [b]{image_timestamp}[/b]"
if image_field != None:
self.image_response(message, image_field, requestor)
else:
self.message_response("The image source could not be retrieved or prepared", requestor)
except Exception as e:
self.message_response(f"An error occurred:\n\n{e}", requestor)
register_view_sources()
# Finally, tell Sideband what class in this
# file is the actual plugin class.
plugin_class = ViewCommandPlugin

View file

@ -0,0 +1,88 @@
# Windows Location Provider plugin example, provided by @haplo-dev
import RNS
import time
import threading
import asyncio
from winsdk.windows.devices import geolocation
class WindowsLocationPlugin(SidebandTelemetryPlugin):
plugin_name = "windows_location"
def __init__(self, sideband_core):
self.update_interval = 5.0
self.should_run = False
self.latitude = None
self.longitude = None
self.altitude = None
self.speed = None
self.bearing = None
self.accuracy = None
self.last_update = None
super().__init__(sideband_core)
def start(self):
RNS.log("Starting Windows Location provider plugin...")
self.should_run = True
update_thread = threading.Thread(target=self.update_job, daemon=True)
update_thread.start()
super().start()
def stop(self):
self.should_run = False
super().stop()
def update_job(self):
while self.should_run:
RNS.log("Updating location from Windows Geolocation...", RNS.LOG_DEBUG)
try:
asyncio.run(self.get_location())
except Exception as e:
RNS.log(f"Error getting location: {str(e)}", RNS.LOG_ERROR)
time.sleep(self.update_interval)
async def get_location(self):
geolocator = geolocation.Geolocator()
position = await geolocator.get_geoposition_async()
self.last_update = time.time()
self.latitude = position.coordinate.latitude
self.longitude = position.coordinate.longitude
self.altitude = position.coordinate.altitude
self.accuracy = position.coordinate.accuracy
# Note: Windows Geolocation doesn't provide speed and bearing directly
# You might need to calculate these from successive position updates
self.speed = None
self.bearing = None
def has_location(self):
return all([self.latitude, self.longitude, self.altitude, self.accuracy]) is not None
def update_telemetry(self, telemeter):
if self.is_running() and telemeter is not None:
if self.has_location():
RNS.log("Updating location from Windows Geolocation", RNS.LOG_DEBUG)
if "location" not in telemeter.sensors:
telemeter.synthesize("location")
telemeter.sensors["location"].latitude = self.latitude
telemeter.sensors["location"].longitude = self.longitude
telemeter.sensors["location"].altitude = self.altitude
telemeter.sensors["location"].speed = self.speed
telemeter.sensors["location"].bearing = self.bearing
telemeter.sensors["location"].accuracy = self.accuracy
telemeter.sensors["location"].stale_time = 5
telemeter.sensors["location"].set_update_time(self.last_update)
else:
RNS.log("No location from Windows Geolocation yet", RNS.LOG_DEBUG)
# Finally, tell Sideband what class in this
# file is the actual plugin class.
plugin_class = WindowsLocationPlugin

16
libs/able/.gitignore vendored Normal file
View file

@ -0,0 +1,16 @@
.buildozer/
bin/
docs/_build/
*~
*.swp
*.sublime-workspace
*.pyo
*.pyc
*.so
build/
dist/
sdist/
wheels/
*.egg-info

103
libs/able/CHANGELOG.rst Normal file
View file

@ -0,0 +1,103 @@
Changelog
=========
1.0.16
------
* Added `autoconnect` parameter to connection methods
`#45 <https://github.com/b3b/able/issues/45>`_
1.0.15
------
* Changing the wheel name to avoid installing a package from cache
`#40 <https://github.com/b3b/able/issues/40>`_
1.0.14
------
* Added event handler for bluetooth adapter state change
`#39 <https://github.com/b3b/able/pull/39>`_ by `robgar2001 <https://github.com/robgar2001>`_
* Removal of deprecated `convert_path` from setup script
1.0.13
------
* Fixed build failure when pip isolated environment is used `#38 <https://github.com/b3b/able/issues/38>`_
1.0.12
------
* Fixed crash on API level 31 (Android 12) `#37 <https://github.com/b3b/able/issues/37>`_
* Added new optional `BluetoothDispatcher` parameter to specifiy required permissions: `runtime_permissions`.
Runtime permissions that are required by by default:
ACCESS_FINE_LOCATION, BLUETOOTH_SCAN, BLUETOOTH_CONNECT, BLUETOOTH_ADVERTISE
* Changed `able.require_bluetooth_enabled` behavior: first asks for runtime permissions
and if permissions are granted then offers to enable the adapter
* `require_runtime_permissions` decorator deprecated
1.0.11
------
* Improved logging of reconnection management
`#33 <https://github.com/b3b/able/pull/33>`_ by `robgar2001 <https://github.com/robgar2001>`_
1.0.10
------
* Fixed build failure after AAB support was added to python-for-android
1.0.9
-----
* Switched from deprecated scanning method `BluetoothAdapter.startLeScan` to `BluetoothLeScanner.startScan`
* Added support for BLE scanning settings: `able.scan_settings` module
* Added support for BLE scanning filters: `able.filters` module
1.0.8
-----
* Added support to use `able` in Android services
* Added decorators:
- `able.require_bluetooth_enabled`: to call `BluetoothDispatcher` method when bluetooth adapter becomes ready
- `able.require_runtime_permissions`: to call `BluetoothDispatcher` method when location runtime permission is granted
1.0.7
-----
* Added `able.advertising`: module to perform BLE advertise operations
* Added property to get and set Bluetoth adapter name
1.0.6
-----
* Fixed `TypeError` exception on `BluetoothDispatcher.enable_notifications`
1.0.5
-----
* Added `BluetoothDispatcher.bonded_devices` property: list of paired BLE devices
1.0.4
-----
* Fixed sending string data with `write_characteristic` function
1.0.3
-----
* Changed package version generation:
- Version is set during the build, from the git tag
- Development (git master) version is always "0.0.0"
* Added ATT MTU changing method and callback
* Added MTU changing example
* Fixed:
- set `BluetoothDispatcher.gatt` attribute in GATT connection handler,
to avoid possible `on_connection_state_change()` call before the `gatt` attribute is set

22
libs/able/LICENSE Normal file
View file

@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2017 b3b
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

4
libs/able/MANIFEST.in Normal file
View file

@ -0,0 +1,4 @@
include LICENSE
include README.rst
include CHANGELOG.rst
include able/src/org/able/*.java

View file

@ -0,0 +1,84 @@
from enum import IntEnum
from able.structures import Advertisement, Services
from able.version import __version__ # noqa
from kivy.utils import platform
__all__ = (
"Advertisement",
"BluetoothDispatcher",
"Services",
)
# constants
GATT_SUCCESS = 0 #: GATT operation completed successfully
STATE_CONNECTED = 2 #: The profile is in connected state
STATE_DISCONNECTED = 0 #: The profile is in disconnected state
class AdapterState(IntEnum):
"""Bluetooth adapter state constants.
https://developer.android.com/reference/android/bluetooth/BluetoothAdapter#STATE_OFF
"""
OFF = 10 #: Adapter is off
TURNING_ON = 11 #: Adapter is turning on
ON = 12 #: Adapter is on
TURNING_OFF = 13 #: Adapter is turning off
class WriteType(IntEnum):
"""GATT characteristic write types constants."""
DEFAULT = (
2 #: Write characteristic, requesting acknowledgement by the remote device
)
NO_RESPONSE = (
1 #: Write characteristic without requiring a response by the remote device
)
SIGNED = 4 #: Write characteristic including authentication signature
if platform == "android":
from able.android.dispatcher import BluetoothDispatcher
else:
# mock android and PyJNIus modules usage
import sys
from unittest.mock import Mock
sys.modules["android"] = Mock()
sys.modules["android.permissions"] = Mock()
jnius = Mock()
class mocked_autoclass(Mock):
def __call__(self, *args, **kwargs):
mock = Mock()
mock.__repr__ = lambda s: f"jnius.autoclass('{args[0]}')"
mock.SDK_INT = 255
return mock
jnius.autoclass = mocked_autoclass()
sys.modules["jnius"] = jnius
from able.dispatcher import BluetoothDispatcherBase
class BluetoothDispatcher(BluetoothDispatcherBase):
"""Bluetooth Low Energy interface
:param queue_timeout: BLE operations queue timeout
:param enable_ble_code: request code to identify activity that alows
user to turn on Bluetooth adapter
:param runtime_permissions: overridden list of
:py:mod:`permissions <able.permissions>`
to be requested on runtime.
"""
from able.adapter import require_bluetooth_enabled
from able.permissions import Permission
def require_runtime_permissions(method):
"""Deprecated decorator, left for backwards compatibility."""
return method

179
libs/able/able/adapter.py Normal file
View file

@ -0,0 +1,179 @@
from dataclasses import dataclass, field
from functools import partial, wraps
from typing import Optional
from android import activity
from android.permissions import (
check_permission,
request_permissions,
)
from jnius import autoclass
from kivy.logger import Logger
Activity = autoclass("android.app.Activity")
def require_bluetooth_enabled(method):
"""Decorator to call `BluetoothDispatcher` method
when runtime permissions are granted
and Bluetooth adapter becomes ready.
Decorator launches system activities that allows the user
to grant runtime permissions and turn on Bluetooth,
if Bluetooth is not enabled.
"""
@wraps(method)
def wrapper(self, *args, **kwargs):
manager = AdapterManager.get_attached_manager(self)
if manager:
return manager.execute(partial(method, self, *args, **kwargs))
return None
return wrapper
def set_adapter_failure_rollback(handler):
"""Decorator to launch handler
if permissions are not granted or adapter is not enabled."""
def inner(func):
@wraps(func)
def wrapper(self, *args, **kwargs):
manager = AdapterManager.get_attached_manager(self)
if manager:
manager.rollback_handlers.append(partial(handler, self))
return func(self, *args, **kwargs)
return None
return wrapper
return inner
@dataclass
class AdapterManager:
"""
Class for managing the execution of operations
that require the BLE adapter.
Operations are deferred until runtime permissions are granted
and the BLE adapter is enabled.
"""
ble: "org.able.BLE"
enable_ble_code: str
runtime_permissions: list
operations: list = field(default_factory=list)
rollback_handlers: list = field(default_factory=list)
is_permissions_granted: bool = False
is_permissions_requested: bool = False
is_adapter_requested: bool = False
@property
def adapter(self) -> Optional["android.bluetooth.BluetoothAdapter"]:
if self.has_permissions:
adapter = self.ble.mBluetoothAdapter
if adapter and adapter.isEnabled():
return adapter
return None
@property
def has_permissions(self):
if not self.is_permissions_granted:
self.is_permissions_granted = self.check_permissions()
return self.is_permissions_granted
@property
def is_service_context(self):
return not activity._activity
def __post_init__(self):
if self.is_service_context:
self.is_permissions_granted = True
else:
activity.bind(on_activity_result=self.on_activity_result)
@classmethod
def get_attached_manager(cls, instance):
manager = getattr(instance, "_adapter_manager", None)
if not manager:
Logger.error("BLE adapter manager is not installed")
return manager
def install(self, instance):
setattr(instance, "_adapter_manager", self)
def check_permissions(self):
return all(
[check_permission(permission) for permission in self.runtime_permissions]
)
def request_permissions(self):
if self.is_permissions_requested:
return
self.is_permissions_requested = True
if not self.is_service_context:
Logger.debug("Request runtime permissions")
request_permissions(
self.runtime_permissions,
self.on_runtime_permissions,
)
else:
Logger.error("Required permissions are not granted for service")
def request_adapter(self):
if self.is_adapter_requested:
return
self.is_adapter_requested = True
self.ble.getAdapter(self.enable_ble_code)
def rollback(self):
self._execute_operations(self.rollback_handlers)
def execute(self, operation):
if self.adapter:
# execute immediately, if adapter is enabled
return operation()
self.operations.append(operation)
self.execute_operations()
def execute_operations(self):
if self.has_permissions:
if self.adapter:
self._execute_operations(self.operations)
else:
self.request_adapter()
else:
self.request_permissions()
def _execute_operations(self, operations):
self.operations = []
self.rollback_handlers = []
for operation in operations:
try:
operation()
except Exception as exc:
Logger.exception(exc)
def on_runtime_permissions(self, permissions, grant_results):
granted = all(grant_results)
self.is_permissions_granted = granted
self.is_permissions_requested = False # allow future invocations
if granted:
Logger.debug("Required permissions are granted")
self.execute_operations()
else:
Logger.error("Required permissions are not granted")
self.rollback()
def on_activity_result(self, requestCode, resultCode, intent):
if requestCode == self.enable_ble_code:
enabled = resultCode == Activity.RESULT_OK
self.is_adapter_requested = False # allow future invocations
if enabled:
Logger.debug("BLE adapter is enabled")
self.execute_operations()
else:
Logger.error("BLE adapter is not enabled")
self.rollback()

View file

@ -0,0 +1,330 @@
"""BLE advertise operations."""
from abc import abstractmethod
from dataclasses import dataclass
from enum import IntEnum
from typing import List, Optional, Union
from jnius import JavaException, autoclass
from kivy.event import EventDispatcher
from able.android.dispatcher import BluetoothDispatcher
from able.android.jni import PythonBluetoothAdvertiser
from able.utils import force_convertible_to_java_array
AdvertiseDataBuilder = autoclass('android.bluetooth.le.AdvertiseData$Builder')
AdvertisingSet = autoclass('android.bluetooth.le.AdvertisingSet')
AdvertisingSetParametersBuilder = autoclass('android.bluetooth.le.AdvertisingSetParameters$Builder')
AndroidAdvertiseData = autoclass('android.bluetooth.le.AdvertiseData')
BluetoothLeAdvertiser = autoclass('android.bluetooth.le.BluetoothLeAdvertiser')
ParcelUuid = autoclass('android.os.ParcelUuid')
BLEAdvertiser = autoclass('org.able.BLEAdvertiser')
class Interval(IntEnum):
"""Advertising interval constants.
https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetParameters#INTERVAL_HIGH
"""
MIN = 160 #: Minimum value for advertising interval, around every 100ms
MEDIUM = 400 #: Advertise on medium frequency, around every 250ms
HIGH = 1600 #: Advertise on low frequency, around every 1000ms
MAX = 16777215 #: Maximum value for advertising interval
class TXPower(IntEnum):
"""Advertising transmission (TX) power level constants.
https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetParameters#TX_POWER_HIGH
"""
MIN = -127 #: Minimum value for TX power
ULTRA_LOW = -21 #: Advertise using the lowest TX power level
LOW = -15 #: Advertise using the low TX power level
MEDIUM = -7 #: Advertise using the medium TX power level
MAX = 1 #: Maximum value for TX power
class Status:
"""Advertising operation status constants.
https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetCallback#constants
"""
SUCCESS = 0
DATA_TOO_LARGE = 1
TOO_MANY_ADVERTISERS = 2
ALREADY_STARTED = 3
INTERNAL_ERROR = 4
FEATURE_UNSUPPORTED = 5
@dataclass
class ADStructure:
@abstractmethod
def add_payload(self, builder: AdvertiseDataBuilder):
pass
class DeviceName(ADStructure):
"""Include device name (complete local name) in advertise packet."""
def add_payload(self, builder):
builder.setIncludeDeviceName(True)
class TXPowerLevel(ADStructure):
"""Include transmission power level in the advertise packet."""
def add_payload(self, builder):
builder.setIncludeTxPowerLevel(True)
@dataclass
class ServiceUUID(ADStructure):
"""Service UUID to advertise.
:param uid: UUID to be advertised
"""
uid: str
def add_payload(self, builder):
builder.addServiceUuid(
ParcelUuid.fromString(self.uid)
)
@dataclass
class ServiceData(ADStructure):
"""Service data to advertise.
:param uid: UUID of the service the data is associated with
:param data: Service data
"""
uid: str
data: Union[list, tuple, bytes, bytearray]
def add_payload(self, builder):
builder.addServiceData(
ParcelUuid.fromString(self.uid),
force_convertible_to_java_array(self.data)
)
@dataclass
class ManufacturerData(ADStructure):
"""Manufacturer specific data to advertise.
:param id: Manufacturer ID
:param data: Manufacturer specific data
"""
id: int
data: Union[list, tuple, bytes, bytearray]
def add_payload(self, builder):
builder.addManufacturerData(
self.id,
force_convertible_to_java_array(self.data)
)
class AdvertiseData:
"""Builder for data payload to be advertised.
:param payload: List of AD structures to include in advertisement
>>> AdvertiseData(DeviceName(), ManufacturerData(10, b'specific data'))
[DeviceName(), ManufacturerData(id=10, data=b'specific data')]
"""
def __init__(self, *payload: List[ADStructure]):
self.payload = payload
self.data = self.build()
def __repr__(self):
sections = ", ".join(repr(ad) for ad in self.payload)
return f"[{sections}]"
def build(self) -> AndroidAdvertiseData:
builder = AdvertiseDataBuilder()
for ad in self.payload:
ad.add_payload(builder)
return builder.build()
class Advertiser(EventDispatcher):
"""Base class for BLE advertise operations.
:param ble: BLE interface instance
:param data: Advertisement data to be broadcasted
:param scan_data: Scan response associated with the advertisement data
:param interval: Advertising interval
`<https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetParameters.Builder#setInterval(int)>`_
:param tx_power: Transmission power level
`<https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetParameters.Builder#setTxPowerLevel(int)>`_
>>> Advertiser(
... ble=BluetoothDispatcher(),
... data=AdvertiseData(DeviceName()),
... scan_data=AdvertiseData(TXPowerLevel()),
... interval=Interval.MIN,
... tx_power=TXPower.MAX
... ) #doctest: +ELLIPSIS
<able.advertising.Advertiser object at 0x...>
"""
__events__ = (
'on_advertising_started',
'on_advertising_stopped',
'on_advertising_enabled',
'on_advertising_data_set',
'on_scan_response_data_set',
'on_advertising_parameters_updated',
'on_advertising_set_changed',
)
def __init__(
self,
ble: BluetoothDispatcher,
data: AdvertiseData = None,
scan_data: AdvertiseData = None,
interval: int = Interval.HIGH,
tx_power: int = TXPower.MEDIUM,
):
self._ble = ble
self._data = data
self._scan_data = scan_data
self._interval = interval
self._tx_power = tx_power
self._events_interface = PythonBluetoothAdvertiser(self)
self._advertiser = BLEAdvertiser(self._events_interface)
self._callback_set = self._advertiser.mCallbackSet
self._advertising_set = None
@property
def data(self):
"""
:setter: Update advertising data
:type: Optional[AdvertiseData]
"""
return self._data
@data.setter
def data(self, value):
self._data = value
self._update_advertising_set()
@property
def scan_data(self):
"""
:setter: Update the scan response
:type: Optional[AdvertiseData]
"""
return self._scan_data
@scan_data.setter
def scan_data(self, value):
self._scan_data = value
self._update_advertising_set()
@property
def interval(self):
"""
:setter: Update the advertising interval
:type: int
"""
return self._interval
@interval.setter
def interval(self, value):
self._interval = value
self._update_advertising_set()
@property
def tx_power(self):
"""
:setter: Update the transmission power level
:type: int
"""
return self._tx_power
@tx_power.setter
def tx_power(self, value):
self._tx_power = value
self._update_advertising_set()
@property
def bluetooth_le_advertiser(self) -> Optional[BluetoothLeAdvertiser]:
adapter = self._ble.adapter
return adapter and adapter.getBluetoothLeAdvertiser()
@property
def parameters(self) -> AdvertisingSetParametersBuilder:
builder = AdvertisingSetParametersBuilder()
builder.setLegacyMode(True) \
.setConnectable(False) \
.setScannable(True) \
.setInterval(self._interval) \
.setTxPowerLevel(self._tx_power)
return builder.build()
def start(self):
"""Start advertising.
Start a system activity that allows the user to turn on Bluetooth if Bluetooth is not enabled.
"""
if not self._advertising_set:
self._ble._start_advertising(self)
def stop(self):
"""Stop advertising."""
advertiser = self.bluetooth_le_advertiser
if advertiser:
advertiser.stopAdvertisingSet(self._callback_set)
def on_advertising_started(self, advertising_set: AdvertisingSet, tx_power: int, status: Status):
"""Handler for advertising start operation (onAdvertisingSetStarted).
"""
def on_advertising_stopped(self, advertising_set: AdvertisingSet):
"""Handler for advertising stop operation (onAdvertisingSetStopped)."""
def on_advertising_enabled(self, advertising_set: AdvertisingSet, enable: bool, status: Status):
"""Handler for advertising enable/disable operation (onAdvertisingEnabled)."""
def on_advertising_data_set(self, advertising_set: AdvertisingSet, status: Status):
"""Handler for data set operation (onAdvertisingDataSet)."""
def on_scan_response_data_set(self, advertising_set: AdvertisingSet, status: Status):
"""Handler for scan response data set operation (onScanResponseDataSet)."""
def on_advertising_parameters_updated(self, advertising_set: AdvertisingSet, tx_power: int, status: Status):
"""Handler for parameters set operation (onAdvertisingParametersUpdated)."""
def on_advertising_set_changed(self, advertising_set):
self._advertising_set = advertising_set
def _start(self):
advertiser = self.bluetooth_le_advertiser
if advertiser:
self._callback_set = self._advertiser.createCallback()
try:
advertiser.startAdvertisingSet(
self.parameters,
self._data and self._data.data,
self._scan_data and self._scan_data.data,
None, # periodicParameters
None, # periodicData
self._callback_set
)
except JavaException as exc:
if exc.classname == 'java.lang.IllegalArgumentException' and \
exc.innermessage.endswith('data too big'):
self.dispatch('on_advertising_started', None, 0, Status.DATA_TOO_LARGE)
raise
def _update_advertising_set(self):
advertising_set = self._advertising_set
if advertising_set:
advertising_set.setAdvertisingParameters(self.parameters)
advertising_set.setScanResponseData(self._scan_data and self._scan_data.data)
advertising_set.setAdvertisingData(self._data and self._data.data)

View file

@ -0,0 +1,105 @@
from jnius import JavaException, autoclass
from kivy.logger import Logger
from able.adapter import (
AdapterManager,
require_bluetooth_enabled,
set_adapter_failure_rollback,
)
from able.android.jni import PythonBluetooth
from able.dispatcher import BluetoothDispatcherBase
from able.scan_settings import ScanSettingsBuilder
ArrayList = autoclass("java.util.ArrayList")
try:
BLE = autoclass("org.able.BLE")
except:
Logger.error(
"able_recipe: Failed to load Java class org.able.BLE. Possible build error."
)
raise
else:
Logger.info("able_recipe: org.able.BLE Java class loaded")
BluetoothAdapter = autoclass("android.bluetooth.BluetoothAdapter")
BluetoothDevice = autoclass("android.bluetooth.BluetoothDevice")
BluetoothGattDescriptor = autoclass("android.bluetooth.BluetoothGattDescriptor")
ENABLE_NOTIFICATION_VALUE = BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE
ENABLE_INDICATION_VALUE = BluetoothGattDescriptor.ENABLE_INDICATION_VALUE
DISABLE_NOTIFICATION_VALUE = BluetoothGattDescriptor.DISABLE_NOTIFICATION_VALUE
class BluetoothDispatcher(BluetoothDispatcherBase):
@property
@require_bluetooth_enabled
def adapter(self):
return AdapterManager.get_attached_manager(self).adapter
@property
def bonded_devices(self):
ble_types = (BluetoothDevice.DEVICE_TYPE_LE, BluetoothDevice.DEVICE_TYPE_DUAL)
adapter = self.adapter
devices = adapter.getBondedDevices().toArray() if adapter else []
return [dev for dev in devices if dev.getType() in ble_types]
def _set_ble_interface(self):
self._events_interface = PythonBluetooth(self)
self._ble = BLE(self._events_interface)
@set_adapter_failure_rollback(
lambda self: self.dispatch("on_scan_started", success=False)
)
@require_bluetooth_enabled
def start_scan(self, filters=None, settings=None):
filters_array = ArrayList()
for f in filters or []:
filters_array.add(f.build())
if not settings:
settings = ScanSettingsBuilder()
try:
settings = settings.build()
except AttributeError:
pass
self._ble.startScan(self.enable_ble_code, filters_array, settings)
def stop_scan(self):
self._ble.stopScan()
@require_bluetooth_enabled
def connect_by_device_address(self, address: str, autoconnect: bool = False):
address = address.upper()
if not BluetoothAdapter.checkBluetoothAddress(address):
raise ValueError(f"{address} is not a valid Bluetooth address")
adapter = self.adapter
if adapter:
self.connect_gatt(adapter.getRemoteDevice(address), autoconnect)
@require_bluetooth_enabled
def enable_notifications(self, characteristic, enable=True, indication=False):
if not self.gatt.setCharacteristicNotification(characteristic, enable):
return False
if not enable:
# DISABLE_NOTIFICAITON_VALUE is for disabling
# both notifications and indications
descriptor_value = DISABLE_NOTIFICATION_VALUE
elif indication:
descriptor_value = ENABLE_INDICATION_VALUE
else:
descriptor_value = ENABLE_NOTIFICATION_VALUE
for descriptor in characteristic.getDescriptors().toArray():
self.write_descriptor(descriptor, descriptor_value)
return True
@require_bluetooth_enabled
def _start_advertising(self, advertiser):
advertiser._start()
@require_bluetooth_enabled
def _set_name(self, value):
adapter = self.adapter
if adapter:
self.adapter.setName(value)

View file

@ -0,0 +1,151 @@
from able import GATT_SUCCESS
from able.structures import Advertisement, Services
from jnius import PythonJavaClass, java_method
from kivy.logger import Logger
class PythonBluetooth(PythonJavaClass):
__javainterfaces__ = ['org.able.PythonBluetooth']
__javacontext__ = 'app'
def __init__(self, dispatcher):
super(PythonBluetooth, self).__init__()
self.dispatcher = dispatcher
@java_method('(Ljava/lang/String;)V')
def on_error(self, msg):
Logger.debug("on_error")
self.dispatcher.dispatch('on_error', msg)
@java_method('(Landroid/bluetooth/le/ScanResult;)V')
def on_scan_result(self, result):
device = result.getDevice() # type: android.bluetooth.BluetoothDevice
record = result.getScanRecord() # type: android.bluetooth.le.ScanRecord
if record:
self.dispatcher.dispatch(
'on_device',
device,
result.getRssi(),
Advertisement(record.getBytes())
)
else:
Logger.warning(
"Scan result for device without the scan record: %s",
device
)
@java_method('(Z)V')
def on_scan_started(self, success):
Logger.debug("on_scan_started")
self.dispatcher.dispatch('on_scan_started', success)
@java_method('()V')
def on_scan_completed(self):
Logger.debug("on_scan_completed")
self.dispatcher.dispatch('on_scan_completed')
@java_method('(II)V')
def on_connection_state_change(self, status, state):
Logger.debug("on_connection_state_change status={} state: {}".format(
status, state))
self.dispatcher.dispatch('on_connection_state_change', status, state)
@java_method('(I)V')
def on_bluetooth_adapter_state_change(self, state):
Logger.debug("on_bluetooth_adapter_state_change state: {}".format(state))
self.dispatcher.dispatch('on_bluetooth_adapter_state_change', state)
@java_method('(ILjava/util/List;)V')
def on_services(self, status, services):
services_dict = Services()
if status == GATT_SUCCESS:
for service in services.toArray():
service_uuid = service.getUuid().toString()
Logger.debug("Service discovered: {}".format(service_uuid))
services_dict[service_uuid] = {}
for c in service.getCharacteristics().toArray():
characteristic_uuid = c.getUuid().toString()
Logger.debug("Characteristic discovered: {}".format(
characteristic_uuid))
services_dict[service_uuid][characteristic_uuid] = c
self.dispatcher.dispatch('on_services', status, services_dict)
@java_method('(Landroid/bluetooth/BluetoothGattCharacteristic;)V')
def on_characteristic_changed(self, characteristic):
# uuid = characteristic.getUuid().toString()
self.dispatcher.dispatch('on_characteristic_changed', characteristic)
@java_method('(Landroid/bluetooth/BluetoothGattCharacteristic;I)V')
def on_characteristic_read(self, characteristic, status):
self.dispatcher.dispatch('on_gatt_release')
# uuid = characteristic.getUuid().toString()
self.dispatcher.dispatch('on_characteristic_read',
characteristic,
status)
@java_method('(Landroid/bluetooth/BluetoothGattCharacteristic;I)V')
def on_characteristic_write(self, characteristic, status):
self.dispatcher.dispatch('on_gatt_release')
# uuid = characteristic.getUuid().toString()
self.dispatcher.dispatch('on_characteristic_write',
characteristic,
status)
@java_method('(Landroid/bluetooth/BluetoothGattDescriptor;I)V')
def on_descriptor_read(self, descriptor, status):
self.dispatcher.dispatch('on_gatt_release')
# characteristic = descriptor.getCharacteristic()
# uuid = characteristic.getUuid().toString()
self.dispatcher.dispatch('on_descriptor_read', descriptor, status)
@java_method('(Landroid/bluetooth/BluetoothGattDescriptor;I)V')
def on_descriptor_write(self, descriptor, status):
self.dispatcher.dispatch('on_gatt_release')
# characteristic = descriptor.getCharacteristic()
# uuid = characteristic.getUuid().toString()
self.dispatcher.dispatch('on_descriptor_write', descriptor, status)
@java_method('(II)V')
def on_rssi_updated(self, rssi, status):
self.dispatcher.dispatch('on_gatt_release')
self.dispatcher.dispatch('on_rssi_updated', rssi, status)
@java_method('(II)V')
def on_mtu_changed(self, mtu, status):
self.dispatcher.dispatch('on_gatt_release')
self.dispatcher.dispatch('on_mtu_changed', mtu, status)
class PythonBluetoothAdvertiser(PythonJavaClass):
__javainterfaces__ = ['org.able.PythonBluetoothAdvertiser']
__javacontext__ = 'app'
def __init__(self, dispatcher):
super().__init__()
self.dispatcher = dispatcher
@java_method('(Landroid/bluetooth/le/AdvertisingSet;II)V')
def on_advertising_started(self, advertising_set, tx_power, status):
self.dispatcher.dispatch('on_advertising_set_changed', advertising_set)
self.dispatcher.dispatch('on_advertising_started', advertising_set, tx_power, status)
@java_method('(Landroid/bluetooth/le/AdvertisingSet;)V')
def on_advertising_stopped(self, advertising_set):
self.dispatcher.dispatch('on_advertising_set_changed', None)
self.dispatcher.dispatch('on_advertising_stopped', advertising_set)
@java_method('(Landroid/bluetooth/le/AdvertisingSet;BI)V')
def on_advertising_enabled(self, advertising_set, enable, status):
self.dispatcher.dispatch('on_advertising_enabled', advertising_set, enable, status)
@java_method('(Landroid/bluetooth/le/AdvertisingSet;I)V')
def on_advertising_data_set(self, advertising_set, status):
self.dispatcher.dispatch('on_advertising_data_set', advertising_set, status)
@java_method('(Landroid/bluetooth/le/AdvertisingSet;I)V')
def on_scan_response_data_set(self, advertising_set, status):
self.dispatcher.dispatch('on_scan_response_data_set', advertising_set, status)
@java_method('(Landroid/bluetooth/le/AdvertisingSet;II)V')
def on_advertising_parameters_updated(self, advertising_set, tx_power, status):
self.dispatcher.dispatch('on_advertising_parameters_updated', advertising_set, tx_power, status)

View file

@ -0,0 +1,371 @@
from typing import List, Optional
from kivy.event import EventDispatcher
from kivy.logger import Logger
from able import WriteType
from able.adapter import AdapterManager
from able.filters import Filter
from able.permissions import DEFAULT_RUNTIME_PERMISSIONS
from able.queue import BLEQueue, ble_task, ble_task_done
from able.scan_settings import ScanSettingsBuilder
from able.utils import force_convertible_to_java_array
class BLEError:
"""Raise Exception on attribute access"""
def __init__(self, msg):
self.msg = msg
def __getattr__(self, name):
raise Exception(self.msg)
class BluetoothDispatcherBase(EventDispatcher):
__events__ = (
"on_device",
"on_scan_started",
"on_scan_completed",
"on_services",
"on_connection_state_change",
"on_bluetooth_adapter_state_change",
"on_characteristic_changed",
"on_characteristic_read",
"on_characteristic_write",
"on_descriptor_read",
"on_descriptor_write",
"on_gatt_release",
"on_error",
"on_rssi_updated",
"on_mtu_changed",
)
queue_class = BLEQueue
def __init__(
self,
queue_timeout: float = 0.5,
enable_ble_code: int = 0xAB1E,
runtime_permissions: Optional[list[str]] = None, # DEFAULT_RUNTIME_PERMISSIONS
):
super(BluetoothDispatcherBase, self).__init__()
self.queue_timeout = queue_timeout
self.enable_ble_code = enable_ble_code
self.runtime_permissions = [
str(permission)
for permission in (
runtime_permissions
if runtime_permissions is not None
else DEFAULT_RUNTIME_PERMISSIONS
)
]
self._remote_device_address = None
self._set_ble_interface()
self._set_queue()
self._set_adapter_manager()
def _set_ble_interface(self):
self._ble = BLEError("BLE is not implemented for platform")
def _set_queue(self):
self.queue = self.queue_class(timeout=self.queue_timeout)
def _set_adapter_manager(self):
AdapterManager(
ble=self._ble,
enable_ble_code=self.enable_ble_code,
runtime_permissions=self.runtime_permissions,
).install(self)
def _check_runtime_permissions(self):
return True
def _request_runtime_permissions(self):
pass
@property
def adapter(self) -> Optional["android.bluetooth.BluetoothAdapter"]:
"""Local device Bluetooth adapter.
Could be `None` if adapter is not enabled or access to the adapter is not granted yet.
:type: `BluetoothAdapter <https://developer.android.com/reference/android/bluetooth/BluetoothAdapter>`_
`Java object <https://pyjnius.readthedocs.io/en/stable/api.html#jnius.JavaClass>`_
"""
@property
def gatt(self):
"""GATT profile of the connected device
:type: BluetoothGatt Java object
"""
return self._ble.getGatt()
@property
def bonded_devices(self):
"""List of Java `android.bluetooth.BluetoothDevice` objects of paired BLE devices.
:type: List[BluetoothDevice]
"""
return []
@property
def name(self):
"""Name of the Bluetooth adapter.
:setter: Set name of the Bluetooth adapter
:type: Optional[str]
"""
adapter = self.adapter
return adapter and adapter.getName()
@name.setter
def name(self, value):
self._set_name(value)
def _set_name(self, value):
pass
def set_queue_timeout(self, timeout):
"""Change the BLE operations queue timeout"""
self.queue_timeout = timeout
self.queue.set_timeout(timeout)
def start_scan(
self,
filters: Optional[List[Filter]] = None,
settings: Optional[ScanSettingsBuilder] = None,
):
"""Start a scan for devices.
The status of the scan start are reported with
:func:`scan_started <on_scan_started>` event.
:param filters: list of filters to restrict scan results.
Advertising record is considered matching the filters
if it matches any of the :class:`able.filters.Filter` in the list.
:param settings: scan settings
"""
pass
def stop_scan(self):
"""Stop the ongoing scan for devices."""
pass
def connect_by_device_address(self, address: str, autoconnect: bool = False):
"""Connect to GATT Server of the device with a given Bluetooth hardware address, without scanning.
:param address: Bluetooth hardware address string in "XX:XX:XX:XX:XX:XX" format
:param autoconnect: If True, automatically reconnects when available.
False = direct connect (default).
:raises:
ValueError: if `address` is not a valid Bluetooth address
"""
pass
def connect_gatt(self, device, autoconnect: bool = False):
"""Connect to GATT Server hosted by device
:param device: BluetoothDevice Java object
:param autoconnect: If True, automatically reconnects when available.
False = direct connect (default).
"""
self._ble.connectGatt(device, autoconnect)
def close_gatt(self):
"""Close current GATT client"""
self._ble.closeGatt()
def discover_services(self):
"""Discovers services offered by a remote device.
The status of the discovery reported with
:func:`services <on_services>` event.
:return: true, if the remote services discovery has been started
"""
return self.gatt.discoverServices()
def enable_notifications(self, characteristic, enable=True, indication=False):
"""Enable/disable notifications or indications for a given characteristic
:param characteristic: BluetoothGattCharacteristic Java object
:param enable: enable notifications if True, else disable notifications
:param indication: handle indications instead of notifications
:return: True, if the operation was initiated successfully
"""
return True
@ble_task
def write_descriptor(self, descriptor, value):
"""Set and write the value of a given descriptor to the associated
remote device
:param descriptor: BluetoothGattDescriptor Java object
:param value: value to write
"""
if not descriptor.setValue(force_convertible_to_java_array(value)):
Logger.error("Error on set descriptor value")
return
if not self.gatt.writeDescriptor(descriptor):
Logger.error("Error on descriptor write")
@ble_task
def write_characteristic(
self, characteristic, value, write_type: Optional[WriteType] = None
):
"""Write a given characteristic value to the associated remote device
:param characteristic: BluetoothGattCharacteristic Java object
:param value: value to write
:param write_type: specific write type to set for the characteristic
"""
self._ble.writeCharacteristic(
characteristic, force_convertible_to_java_array(value), int(write_type or 0)
)
@ble_task
def read_characteristic(self, characteristic):
"""Read a given characteristic from the associated remote device
:param characteristic: BluetoothGattCharacteristic Java object
"""
self._ble.readCharacteristic(characteristic)
@ble_task
def update_rssi(self):
"""Triggers an update for the RSSI from the associated remote device"""
self._ble.readRemoteRssi()
@ble_task
def request_mtu(self, mtu: int):
"""Request to change the ATT Maximum Transmission Unit value
:param value: new MTU size
"""
self.gatt.requestMtu(mtu)
def on_error(self, msg):
"""Error handler
:param msg: error message
"""
self._ble = BLEError(msg) # Exception for calls from another threads
raise Exception(msg)
@ble_task_done
def on_gatt_release(self):
"""`gatt_release` event handler.
Event is dispatched at every read/write completed operation
"""
pass
def on_scan_started(self, success):
"""`scan_started` event handler
:param success: true, if scan was started successfully
"""
pass
def on_scan_completed(self):
"""`scan_completed` event handler"""
pass
def on_device(self, device, rssi, advertisement):
"""`device` event handler.
Event is dispatched when device is found during a scan.
:param device: BluetoothDevice Java object
:param rssi: the RSSI value for the remote device
:param advertisement: :class:`Advertisement` data record
"""
pass
def on_connection_state_change(self, status, state):
"""`connection_state_change` event handler
:param status: status of the operation,
`GATT_SUCCESS` if the operation succeeds
:param state: STATE_CONNECTED or STATE_DISCONNECTED
"""
pass
def on_bluetooth_adapter_state_change(self, state):
"""`bluetooth_adapter_state_change` event handler
Allows the user to detect when bluetooth adapter is turned on/off.
:param state: STATE_OFF, STATE_TURNING_OFF, STATE_ON, STATE_TURNING_ON
"""
def on_services(self, services, status):
"""`services` event handler
:param services: :class:`Services` dict filled with discovered
characteristics
(BluetoothGattCharacteristic Java objects)
:param status: status of the operation,
`GATT_SUCCESS` if the operation succeeds
"""
pass
def on_characteristic_changed(self, characteristic):
"""`characteristic_changed` event handler
:param characteristic: BluetoothGattCharacteristic Java object
"""
pass
def on_characteristic_read(self, characteristic, status):
"""`characteristic_read` event handler
:param characteristic: BluetoothGattCharacteristic Java object
:param status: status of the operation,
`GATT_SUCCESS` if the operation succeeds
"""
pass
def on_characteristic_write(self, characteristic, status):
"""`characteristic_write` event handler
:param characteristic: BluetoothGattCharacteristic Java object
:param status: status of the operation,
`GATT_SUCCESS` if the operation succeeds
"""
pass
def on_descriptor_read(self, descriptor, status):
"""`descriptor_read` event handler
:param descriptor: BluetoothGattDescriptor Java object
:param status: status of the operation,
`GATT_SUCCESS` if the operation succeeds
"""
pass
def on_descriptor_write(self, descriptor, status):
"""`descriptor_write` event handler
:param descriptor: BluetoothGattDescriptor Java object
:param status: status of the operation,
`GATT_SUCCESS` if the operation succeeds
"""
pass
def on_rssi_updated(self, rssi, status):
"""`onReadRemoteRssi` event handler.
Event is dispatched at every RSSI update completed operation,
reporting a RSSI value for a remote device connection.
:param rssi: integer containing RSSI value in dBm
:param status: status of the operation,
`GATT_SUCCESS` if the operation succeeds
"""
pass
def on_mtu_changed(self, mtu, status):
"""`onMtuChanged` event handler
Event is dispatched when MTU for a remote device has changed,
reporting a new MTU size.
:param mtu: integer containing the new MTU size
:param status: status of the operation,
`GATT_SUCCESS` if the MTU has been changed successfully
"""
pass

237
libs/able/able/filters.py Normal file
View file

@ -0,0 +1,237 @@
"""BLE scanning filters,
wrappers for Java class `android.bluetooth.le.ScanFilter.Builder`
https://developer.android.com/reference/android/bluetooth/le/ScanFilter.Builder
"""
from abc import abstractmethod
from dataclasses import dataclass, field
from typing import List, Union
import uuid
from jnius import autoclass
ParcelUuid = autoclass('android.os.ParcelUuid')
BluetoothAdapter = autoclass('android.bluetooth.BluetoothAdapter')
ScanFilter = autoclass('android.bluetooth.le.ScanFilter')
ScanFilterBuilder = autoclass('android.bluetooth.le.ScanFilter$Builder')
@dataclass
class Filter:
"""Base class for BLE scanning fiters.
>>> # Filters of different kinds could be ANDed to set multiple conditions.
>>> # Both device name and address required:
>>> combined_filter = DeviceNameFilter("Example") & DeviceAddressFilter("01:02:03:AB:CD:EF")
>>> DeviceNameFilter("Example1") & DeviceNameFilter("Example2")
Traceback (most recent call last):
ValueError: cannot combine filters of the same type
"""
def __post_init__(self):
self.filters = [self]
def __and__(self, other):
if type(self) in (type(f) for f in other.filters):
raise ValueError('cannot combine filters of the same type')
self.filters.extend(other.filters)
return self
def build(self):
builder = ScanFilterBuilder()
for scan_filter in self.filters:
scan_filter.filter(builder)
return builder.build()
@abstractmethod
def filter(self, builder):
pass
class EmptyFilter(Filter):
"""Filter with no restrictions."""
def filter(self, builder):
pass
@dataclass
class DeviceAddressFilter(Filter):
"""Set filter on device address.
Uses Java method `ScanFilter.Builder.setDeviceAddress`.
:param address: Address in the format of "01:02:03:AB:CD:EF"
>>> DeviceAddressFilter("01:02:03:AB:CD:EF")
DeviceAddressFilter(address='01:02:03:AB:CD:EF')
"""
address: str
def __post_init__(self):
super().__post_init__()
if not BluetoothAdapter.checkBluetoothAddress(str(self.address)):
raise ValueError(f"{self.address} is not a valid Bluetooth address")
def filter(self, builder):
builder.setDeviceAddress(str(self.address))
@dataclass
class DeviceNameFilter(Filter):
"""Set filter on device name.
Uses Java method `ScanFilter.Builder.setDeviceName`.
:param name: Device name
"""
name: str
def filter(self, builder):
builder.setDeviceName(str(self.name))
@dataclass
class ManufacturerDataFilter(Filter):
"""Set filter on manufacture data.
Uses Java method `ScanFilter.Builder.setManufacturerData`.
:param id: Manufacturer ID
:param data: Manufacturer specific data
:param mask: bit mask for partial filtration of the `data`. For any bit in the mask,
set it to 1 if it needs to match the one in manufacturer data,
otherwise set it to 0 to ignore that bit.
>>> # Filter by just ID, ignoring the data:
>>> ManufacturerDataFilter(0x0AD0, [])
ManufacturerDataFilter(id=2768, data=[], mask=None)
>>> ManufacturerDataFilter(0x0AD0, [0x2, 0x15, 0x8d])
ManufacturerDataFilter(id=2768, data=[2, 21, 141], mask=None)
>>> # With mask set to ignore the second data byte:
>>> ManufacturerDataFilter(0x0AD0, [0x2, 0, 0x8d], [0xff, 0, 0xff])
ManufacturerDataFilter(id=2768, data=[2, 0, 141], mask=[255, 0, 255])
>>> ManufacturerDataFilter(0x0AD0, [0x2, 21, 0x8d], [0xff])
Traceback (most recent call last):
ValueError: mask is shorter than the data
"""
id: int
data: Union[list, tuple, bytes, bytearray]
mask: List[int] = field(default_factory=lambda: None)
def __post_init__(self):
super().__post_init__()
if self.mask and len(self.mask) < len(self.data):
raise ValueError('mask is shorter than the data')
def filter(self, builder):
if self.mask:
builder.setManufacturerData(self.id, self.data, self.mask)
else:
builder.setManufacturerData(self.id, self.data)
@dataclass
class ServiceDataFilter(Filter):
"""Set filter on service data.
Uses Java method `ScanFilter.Builder.setServiceData`.
:param uid: UUID of the service in the format of
"0000180f-0000-1000-8000-00805f9b34fb"
:param data: service data
:param mask: bit mask for partial filtration of the `data`. For any bit in the mask,
set it to 1 if it needs to match the one in service data,
otherwise set it to 0 to ignore that bit.
>>> ServiceDataFilter("0000180f-0000-1000-8000-00805f9b34fb", [])
ServiceDataFilter(uid='0000180f-0000-1000-8000-00805f9b34fb', data=[], mask=None)
>>> # With mask set to ignore the first data byte:
>>> ServiceDataFilter("0000180f-0000-1000-8000-00805f9b34fb", [0, 0x11], [0, 0xff])
ServiceDataFilter(uid='0000180f-0000-1000-8000-00805f9b34fb', data=[0, 17], mask=[0, 255])
>>> ServiceDataFilter("0000180f", [])
Traceback (most recent call last):
ValueError: badly formed hexadecimal UUID string
>>> ServiceDataFilter("0000180f-0000-1000-8000-00805f9b34fb", [0x12, 0x34], [0xff])
Traceback (most recent call last):
ValueError: mask is shorter than the data
"""
uid: str
data: Union[list, tuple, bytes, bytearray]
mask: List[int] = field(default_factory=lambda: None)
def __post_init__(self):
super().__post_init__()
# validate UUID value
uuid.UUID(self.uid)
if self.mask and len(self.mask) < len(self.data):
raise ValueError('mask is shorter than the data')
def filter(self, builder):
uid = ParcelUuid.fromString(self.uid)
if self.mask:
builder.setServiceData(uid, self.data, self.mask)
else:
builder.setServiceData(uid, self.data)
@dataclass
class ServiceSolicitationFilter(Filter):
"""Set filter on service solicitation uuid.
Uses Java method `ScanFilter.Builder.setServiceSolicitation`.
:param uid: UUID of the service in the format of
"0000180f-0000-1000-8000-00805f9b34fb"
"""
uid: str
def filter(self, builder):
uid = ParcelUuid.fromString(self.uid)
builder.setServiceSolicitation(uid)
@dataclass
class ServiceUUIDFilter(Filter):
"""Set filter on service uuid.
Uses Java method `ScanFilter.Builder.setServiceUuid`.
:param uid: UUID of the service in the format of
"0000180f-0000-1000-8000-00805f9b34fb"
:mask: bit mask for partial filtration of the UUID, in the format of
"ffffffff-0000-0000-0000-ffffffffffff". Set any bit in the mask
to 1 to indicate a match is needed for the bit in `uid`,
and 0 to ignore that bit.
>>> ServiceUUIDFilter('16fe0d00-c111-11e3-b8c8-0002a5d5c51b')
ServiceUUIDFilter(uid='16fe0d00-c111-11e3-b8c8-0002a5d5c51b', mask=None)
>>> ServiceUUIDFilter(
... '16fe0d00-c111-11e3-b8c8-0002a5d5c51b',
... 'ffffffff-0000-0000-0000-000000000000'
... ) #doctest: +ELLIPSIS
ServiceUUIDFilter(uid='16fe0d00-...', mask='ffffffff-...')
>>> ServiceUUIDFilter('123')
Traceback (most recent call last):
ValueError: badly formed hexadecimal UUID string
"""
uid: str
mask: str = None
def __post_init__(self):
super().__post_init__()
# validate UUID values
uuid.UUID(self.uid)
if self.mask:
uuid.UUID(self.mask)
def filter(self, builder):
uid = ParcelUuid.fromString(self.uid)
if self.mask:
mask = ParcelUuid.fromString(self.mask)
builder.setServiceUuid(uid, mask)
else:
builder.setServiceUuid(uid)

View file

@ -0,0 +1,53 @@
"""Before executing, all :class:`BluetoothDispatcher <able.BluetoothDispatcher>` methods that requires Bluetooth adapter
(`start_scan`, `connect_by_device_address`, `enable_notifications`, `adapter` property ...),
are asking the user to:
#. grant runtime permissions,
#. turn on Bluetooth adapter.
The list of requested runtime permissions varies depending on the level of the target Android API level:
* target API level <=30: ACCESS_FINE_LOCATION - to obtain BLE scan results
* target API level >= 31:
* BLUETOOTH_CONNECT - to enable adapter and to connect to devices
* BLUETOOTH_SCAN - to start the scan
* ACCESS_FINE_LOCATION - to detect beacons during the scan
* BLUETOOTH_ADVERTISE - to be able to advertise to nearby Bluetooth devices
Requested permissions list can be changed with the `BluetoothDispatcher.runtime_permissions` parameter.
"""
from jnius import autoclass
SDK_INT = int(autoclass("android.os.Build$VERSION").SDK_INT)
class Permission:
"""
String constants values for BLE-related permissions.
https://developer.android.com/reference/android/Manifest.permission
"""
ACCESS_BACKGROUND_LOCATION = "android.permission.ACCESS_BACKGROUND_LOCATION"
ACCESS_FINE_LOCATION = "android.permission.ACCESS_FINE_LOCATION"
BLUETOOTH_ADVERTISE = "android.permission.BLUETOOTH_ADVERTISE"
BLUETOOTH_CONNECT = "android.permission.BLUETOOTH_CONNECT"
BLUETOOTH_SCAN = "android.permission.BLUETOOTH_SCAN"
if SDK_INT >= 31:
# API level 31 (Android 12) introduces new permissions
DEFAULT_RUNTIME_PERMISSIONS = [
Permission.BLUETOOTH_ADVERTISE,
Permission.BLUETOOTH_CONNECT,
Permission.BLUETOOTH_SCAN,
# ACCESS_FINE_LOCATION is not mandatory for scan,
# but required to discover beacons
Permission.ACCESS_FINE_LOCATION,
]
else:
# For API levels 29-30,
# ACCESS_FINE_LOCATION permission is needed to obtain BLE scan results
DEFAULT_RUNTIME_PERMISSIONS = [
Permission.ACCESS_FINE_LOCATION,
]

90
libs/able/able/queue.py Normal file
View file

@ -0,0 +1,90 @@
import threading
from functools import wraps, partial
try:
from queue import Empty, Queue
except ImportError:
from Queue import Empty, Queue
from kivy.clock import Clock
from kivy.logger import Logger
def ble_task(method):
"""
Enque method
"""
@wraps(method)
def wrapper(obj, *args, **kwargs):
task = partial(method, obj, *args, **kwargs)
obj.queue.enque(task)
return wrapper
def ble_task_done(method):
@wraps(method)
def wrapper(obj, *args, **kwargs):
obj.queue.done(*args, **kwargs)
method(obj, *args, **kwargs)
return wrapper
def with_lock(method):
@wraps(method)
def wrapped(obj, *args, **kwargs):
locked = obj.lock.acquire(False)
if locked:
try:
return method(obj, *args, **kwargs)
finally:
obj.lock.release()
return wrapped
class BLEQueue(object):
def __init__(self, timeout=0):
self.lock = threading.Lock()
self.ready = True
self.queue = Queue()
self.set_timeout(timeout)
def set_timeout(self, timeout):
Logger.debug("set queue timeout to {}".format(timeout))
self.timeout = timeout
self.timeout_event = Clock.schedule_once(
self.on_timeout, self.timeout or 0)
self.timeout_event.cancel()
def enque(self, task):
queue = self.queue
if self.timeout == 0:
self.execute_task(task)
else:
queue.put_nowait(task)
self.execute_next()
@with_lock
def execute_next(self, ready=False):
if ready:
self.ready = True
elif not self.ready:
return
try:
task = self.queue.get_nowait()
except Empty:
return
self.ready = False
if task is not None:
self.execute_task(task)
def done(self, *args, **kwargs):
self.timeout_event.cancel()
self.ready = True
self.execute_next()
def on_timeout(self, *args, **kwargs):
self.done()
def execute_task(self, task):
if self.timeout and self.timeout_event:
self.timeout_event()
task()

View file

@ -0,0 +1,20 @@
"""BLE scanning settings.
"""
from jnius import autoclass
from kivy.utils import platform
if platform != 'android':
class ScanSettings:
"""PyJNIus wrapper for Java class `android.bluetooth.le.ScanSettings`.
https://developer.android.com/reference/android/bluetooth/le/ScanSettings
"""
class ScanSettingsBuilder:
"""PyJNIus wrapper for Java class `android.bluetooth.le.ScanSettings.Builder`.
https://developer.android.com/reference/android/bluetooth/le/ScanSettings.Builder
"""
else:
ScanSettings = autoclass('android.bluetooth.le.ScanSettings')
ScanSettingsBuilder = autoclass('android.bluetooth.le.ScanSettings$Builder')

View file

@ -0,0 +1,283 @@
package org.able;
import android.app.Activity;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.pm.PackageManager;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothManager;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothProfile;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCallback;
import android.bluetooth.BluetoothGattCharacteristic;
import android.bluetooth.BluetoothGattDescriptor;
import android.bluetooth.BluetoothGattService;
import android.bluetooth.le.BluetoothLeScanner;
import android.bluetooth.le.ScanCallback;
import android.bluetooth.le.ScanResult;
import android.bluetooth.le.ScanFilter;
import android.bluetooth.le.ScanSettings;
import android.os.Handler;
import android.util.Log;
import java.util.List;
import org.kivy.android.PythonActivity;
import org.kivy.android.PythonService;
import org.able.PythonBluetooth;
public class BLE {
private String TAG = "BLE-python";
private PythonBluetooth mPython;
private Context mContext;
private BluetoothAdapter mBluetoothAdapter;
private BluetoothLeScanner mBluetoothLeScanner;
private BluetoothGatt mBluetoothGatt;
private List<BluetoothGattService> mBluetoothGattServices;
private boolean mScanning;
private boolean mIsServiceContext = false;
public void showError(final String msg) {
Log.e(TAG, msg);
if (!mIsServiceContext) { PythonActivity.mActivity.toastError(TAG + " error. " + msg); }
mPython.on_error(msg);
}
public BLE(PythonBluetooth python) {
mPython = python;
mContext = (Context) PythonActivity.mActivity;
mBluetoothGatt = null;
if (mContext == null) {
Log.d(TAG, "Service context detected");
mIsServiceContext = true;
mContext = (Context) PythonService.mService;
}
if (!mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {
showError("Device does not support Bluetooth Low Energy.");
return;
}
final BluetoothManager bluetoothManager =
(BluetoothManager) mContext.getSystemService(Context.BLUETOOTH_SERVICE);
mBluetoothAdapter = bluetoothManager.getAdapter();
mContext.registerReceiver(mReceiver, new IntentFilter(BluetoothAdapter.ACTION_STATE_CHANGED));
}
public BluetoothAdapter getAdapter(int EnableBtCode) {
if (mBluetoothAdapter == null) {
showError("Device do not support Bluetooth Low Energy.");
return null;
}
if (!mBluetoothAdapter.isEnabled()) {
if (mIsServiceContext) {
showError("BLE adapter is not enabled");
} else {
Log.d(TAG, "BLE adapter is not enabled");
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
PythonActivity.mActivity.startActivityForResult(enableBtIntent, EnableBtCode);
}
return null;
}
return mBluetoothAdapter;
}
public BluetoothGatt getGatt() {
return mBluetoothGatt;
}
public void startScan(int EnableBtCode,
List<ScanFilter> filters,
ScanSettings settings) {
Log.d(TAG, "startScan");
BluetoothAdapter adapter = getAdapter(EnableBtCode);
if (adapter != null) {
Log.d(TAG, "BLE adapter is ready for scan");
if (mBluetoothLeScanner == null) {
mBluetoothLeScanner = adapter.getBluetoothLeScanner();
}
if (mBluetoothLeScanner != null) {
mScanning = false;
mBluetoothLeScanner.startScan(filters, settings, mScanCallback);
} else {
showError("Could not get BLE Scanner object.");
mPython.on_scan_started(false);
}
}
}
public void stopScan() {
if (mBluetoothLeScanner != null) {
Log.d(TAG, "stopScan");
mBluetoothLeScanner.stopScan(mScanCallback);
if (mScanning) {
mScanning = false;
mPython.on_scan_completed();
}
}
}
private final ScanCallback mScanCallback =
new ScanCallback() {
@Override
public void onScanResult(final int callbackType, final ScanResult result) {
if (!mScanning) {
mScanning = true;
Log.d(TAG, "BLE scan started successfully");
mPython.on_scan_started(true);
}
if (mIsServiceContext) {
mPython.on_scan_result(result);
return;
}
PythonActivity.mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
mPython.on_scan_result(result);
}
});
}
@Override
public void onBatchScanResults(List<ScanResult> results) {
Log.d(TAG, "onBatchScanResults");
}
@Override
public void onScanFailed(int errorCode) {
Log.e(TAG, "BLE Scan failed, error code:" + errorCode);
mPython.on_scan_started(false);
}
};
public void connectGatt(BluetoothDevice device) {
connectGatt(device, false);
}
public void connectGatt(BluetoothDevice device, boolean autoConnect) {
Log.d(TAG, "connectGatt");
if (mBluetoothGatt == null) {
mBluetoothGatt = device.connectGatt(mContext, autoConnect, mGattCallback, BluetoothDevice.TRANSPORT_LE);
} else {
Log.d(TAG, "BluetoothGatt object exists, use either closeGatt() to close Gatt or BluetoothGatt.connect() to re-connect");
}
}
public void closeGatt() {
Log.d(TAG, "closeGatt");
if (mBluetoothGatt != null) {
mBluetoothGatt.close();
mBluetoothGatt = null;
}
}
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (BluetoothAdapter.ACTION_STATE_CHANGED.equals(action)) {
Log.d(TAG, "onReceive - BluetoothAdapter state changed");
int state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, -1);
mPython.on_bluetooth_adapter_state_change(state);
}
}
};
private final BluetoothGattCallback mGattCallback =
new BluetoothGattCallback() {
@Override
public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) {
if (newState == BluetoothProfile.STATE_CONNECTED) {
Log.d(TAG, "Connected to GATT server, status:" + status);
} else if (newState == BluetoothProfile.STATE_DISCONNECTED) {
Log.d(TAG, "Disconnected from GATT server, status:" + status);
}
if (mBluetoothGatt == null) {
mBluetoothGatt = gatt;
}
mPython.on_connection_state_change(status, newState);
}
@Override
public void onServicesDiscovered(BluetoothGatt gatt, int status) {
if (status == BluetoothGatt.GATT_SUCCESS) {
Log.d(TAG, "onServicesDiscovered - success");
mBluetoothGattServices = mBluetoothGatt.getServices();
} else {
showError("onServicesDiscovered status:" + status);
mBluetoothGattServices = null;
}
mPython.on_services(status, mBluetoothGattServices);
}
@Override
public void onCharacteristicChanged(BluetoothGatt gatt,
BluetoothGattCharacteristic characteristic) {
mPython.on_characteristic_changed(characteristic);
}
@Override
public void onCharacteristicRead(BluetoothGatt gatt,
BluetoothGattCharacteristic characteristic,
int status) {
mPython.on_characteristic_read(characteristic, status);
}
@Override
public void onCharacteristicWrite(BluetoothGatt gatt,
BluetoothGattCharacteristic characteristic,
int status) {
mPython.on_characteristic_write(characteristic, status);
}
@Override
public void onDescriptorRead(BluetoothGatt gatt,
BluetoothGattDescriptor descriptor,
int status) {
mPython.on_descriptor_read(descriptor, status);
}
@Override
public void onDescriptorWrite(BluetoothGatt gatt,
BluetoothGattDescriptor descriptor,
int status) {
mPython.on_descriptor_write(descriptor, status);
}
@Override
public void onReadRemoteRssi(BluetoothGatt gatt,
int rssi, int status) {
mPython.on_rssi_updated(rssi, status);
}
@Override
public void onMtuChanged(BluetoothGatt gatt,
int mtu, int status) {
Log.d(TAG, String.format("onMtuChanged mtu=%d status=%d", mtu, status));
mPython.on_mtu_changed(mtu, status);
}
};
public boolean writeCharacteristic(BluetoothGattCharacteristic characteristic, byte[] data, int writeType) {
if (characteristic.setValue(data)) {
if (writeType != 0) {
characteristic.setWriteType(writeType);
}
return mBluetoothGatt.writeCharacteristic(characteristic);
}
return false;
}
public boolean readCharacteristic(BluetoothGattCharacteristic characteristic) {
return mBluetoothGatt.readCharacteristic(characteristic);
}
public boolean readRemoteRssi() {
return mBluetoothGatt.readRemoteRssi();
}
}

View file

@ -0,0 +1,61 @@
package org.able;
import android.bluetooth.le.AdvertisingSet;
import android.bluetooth.le.AdvertisingSetCallback;
import org.able.PythonBluetoothAdvertiser;
import android.util.Log;
public class BLEAdvertiser {
private String TAG = "BLE-python";
private PythonBluetoothAdvertiser mPython;
public AdvertisingSetCallback mCallbackSet;
public BLEAdvertiser(PythonBluetoothAdvertiser python) {
mPython = python;
}
public AdvertisingSetCallback createCallback() {
mCallbackSet = new AdvertisingSetCallback() {
@Override
public void onAdvertisingSetStarted(AdvertisingSet advertisingSet, int txPower, int status) {
Log.d(TAG, "onAdvertisingSetStarted, status:" + status);
mPython.on_advertising_started(advertisingSet, txPower, status);
}
@Override
public void onAdvertisingSetStopped(AdvertisingSet advertisingSet) {
Log.d(TAG, "onAdvertisingSetStopped");
mCallbackSet = null;
mPython.on_advertising_stopped(advertisingSet);
}
@Override
public void onAdvertisingEnabled(AdvertisingSet advertisingSet, boolean enable, int status) {
Log.d(TAG, "onAdvertisingEnabled, enable:" + enable + "status:" + status);
mPython.on_advertising_enabled(advertisingSet, enable, status);
}
@Override
public void onAdvertisingDataSet(AdvertisingSet advertisingSet, int status) {
Log.d(TAG, "onAdvertisingDataSet, status:" + status);
mPython.on_advertising_data_set(advertisingSet, status);
}
@Override
public void onScanResponseDataSet(AdvertisingSet advertisingSet, int status) {
Log.d(TAG, "onScanResponseDataSet, status:" + status);
mPython.on_scan_response_data_set(advertisingSet, status);
}
@Override
public void onAdvertisingParametersUpdated(AdvertisingSet advertisingSet, int txPower, int status) {
Log.d(TAG, "onAdvertisingParametersUpdated, status:" + status);
mPython.on_advertising_parameters_updated(advertisingSet, txPower, status);
}
};
return mCallbackSet;
}
}

View file

@ -0,0 +1,25 @@
package org.able;
import java.util.List;
import android.bluetooth.BluetoothGattService;
import android.bluetooth.BluetoothGattCharacteristic;
import android.bluetooth.BluetoothGattDescriptor;
import android.bluetooth.le.ScanResult;
interface PythonBluetooth
{
public void on_error(String msg);
public void on_scan_started(boolean success);
public void on_scan_result(ScanResult result);
public void on_scan_completed();
public void on_services(int status, List<BluetoothGattService> services);
public void on_characteristic_changed(BluetoothGattCharacteristic characteristic);
public void on_characteristic_read(BluetoothGattCharacteristic characteristic, int status);
public void on_characteristic_write(BluetoothGattCharacteristic characteristic, int status);
public void on_descriptor_read(BluetoothGattDescriptor descriptor, int status);
public void on_descriptor_write(BluetoothGattDescriptor descriptor, int status);
public void on_connection_state_change(int status, int state);
public void on_bluetooth_adapter_state_change(int state);
public void on_rssi_updated(int rssi, int status);
public void on_mtu_changed (int mtu, int status);
}

View file

@ -0,0 +1,13 @@
package org.able;
import android.bluetooth.le.AdvertisingSet;
interface PythonBluetoothAdvertiser
{
public void on_advertising_started(AdvertisingSet advertisingSet, int txPower, int status);
public void on_advertising_stopped(AdvertisingSet advertisingSet);
public void on_advertising_enabled(AdvertisingSet advertisingSet, boolean enable, int status);
public void on_advertising_data_set(AdvertisingSet advertisingSet, int status);
public void on_scan_response_data_set(AdvertisingSet advertisingSet, int status);
public void on_advertising_parameters_updated(AdvertisingSet advertisingSet, int txPower, int status);
}

View file

@ -0,0 +1,81 @@
import re
from collections import namedtuple
class Advertisement(object):
"""Advertisement data record parser
>>> ad = Advertisement([2, 1, 0x6, 6, 255, 82, 83, 95, 82, 48])
>>> for data in ad:
... data
AD(ad_type=1, data=bytearray(b'\\x06'))
AD(ad_type=255, data=bytearray(b'RS_R0'))
>>> list(ad)[0].ad_type == Advertisement.ad_types.flags
True
"""
AD = namedtuple("AD", ['ad_type', 'data'])
class ad_types:
"""
Assigned numbers for some of `advertisement data types
<https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile/>`_.
flags : "Flags" (0x01)
complete_local_name : "Complete Local Name" (0x09)
service_data : "Service Data" (0x16)
manufacturer_specific_data : "Manufacturer Specific Data" (0xff)
"""
flags = 0x01
complete_local_name = 0x09
service_data = 0x16
manufacturer_specific_data = 0xff
def __init__(self, data):
self.data = data
def __iter__(self):
return Advertisement.parse(self.data)
@classmethod
def parse(cls, data):
pos = 0
while pos < len(data):
length = data[pos]
if length < 2:
return
try:
ad_type = data[pos + 1]
except IndexError:
return
next_pos = pos + length + 1
if ad_type:
segment = slice(pos + 2, next_pos)
yield Advertisement.AD(ad_type, bytearray(data[segment]))
pos = next_pos
class Services(dict):
"""Services dict
>>> services = Services({'service0': {'c1-aa': 0, 'aa-c2-aa': 1},
... 'service1': {'bb-c3-bb': 2}})
>>> services.search('c3')
2
>>> services.search('c4')
"""
def search(self, pattern, flags=re.IGNORECASE):
"""Search for characteristic by pattern
:param pattern: regexp pattern
:param flags: regexp flags, re.IGNORECASE by default
"""
for characteristics in self.values():
for uuid, characteristic in characteristics.items():
if re.search(pattern, uuid, flags):
return characteristic

42
libs/able/able/utils.py Normal file
View file

@ -0,0 +1,42 @@
from typing import Any, Union
def force_convertible_to_java_array(
value: Any
) -> Union[list, tuple, bytes, bytearray]:
"""Construct a value that is convertible to a Java array.
>>> force_convertible_to_java_array([3, 1, 4])
[3, 1, 4]
>>> force_convertible_to_java_array(['314'])
['314']
>>> force_convertible_to_java_array('314')
b'314'
>>> force_convertible_to_java_array(314)
[314]
>>> force_convertible_to_java_array(0)
[0]
>>> force_convertible_to_java_array('')
[]
>>> force_convertible_to_java_array(None)
[]
>>> force_convertible_to_java_array({})
[]
"""
if isinstance(value, (list, tuple, bytes, bytearray)):
return value
try:
return value.encode() or []
except AttributeError:
pass
try:
return list(value)
except TypeError:
pass
if value is None:
return []
return [value]

View file

@ -0,0 +1,5 @@
"""Package version.
This file is filled with actual value during the PyPI package build.
Development version is always "0.0.0".
"""
__version__ = '0.0.0'

177
libs/able/docs/Makefile Normal file
View file

@ -0,0 +1,177 @@
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean:
rm -rf $(BUILDDIR)/*
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/ABLE.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/ABLE.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/ABLE"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/ABLE"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
latexpdfja:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
xml:
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."

154
libs/able/docs/api.rst Normal file
View file

@ -0,0 +1,154 @@
API
---
.. automodule:: able
Client
^^^^^^
BluetoothDispatcher
"""""""""""""""""""
.. autoclass:: BluetoothDispatcher
:members: adapter,
gatt,
bonded_devices,
name,
set_queue_timeout,
start_scan,
stop_scan,
connect_by_device_address,
connect_gatt,
close_gatt,
discover_services,
enable_notifications,
write_descriptor,
write_characteristic,
read_characteristic,
update_rssi,
request_mtu,
on_error,
on_gatt_release,
on_scan_started,
on_scan_completed,
on_device,
on_bluetooth_adapter_state_changeable,
on_connection_state_change,
on_services,
on_characteristic_changed,
on_characteristic_read,
on_characteristic_write,
on_descriptor_read,
on_descriptor_write,
on_rssi_updated,
on_mtu_changed,
Decorators
""""""""""
.. autofunction:: require_bluetooth_enabled
Advertisement
"""""""""""""
.. autoclass:: Advertisement
.. autoclass:: able::Advertisement.ad_types
Services
""""""""
.. autoclass:: Services
:members:
Constants
"""""""""
.. autodata:: GATT_SUCCESS
.. autodata:: STATE_CONNECTED
.. autodata:: STATE_DISCONNECTED
.. autoclass:: AdapterState
:members:
:member-order: bysource
.. autoclass:: WriteType
:members:
Permissions
^^^^^^^^^^^
.. automodule:: able.permissions
.. automodule:: able
.. autoclass:: Permission
:members:
:undoc-members:
:member-order: bysource
Scan settings
^^^^^^^^^^^^^
.. automodule:: able.scan_settings
.. autoclass:: ScanSettingsBuilder
.. autoclass:: ScanSettings
>>> settings = ScanSettingsBuilder() \
... .setMatchMode(ScanSettings.MATCH_MODE_AGGRESSIVE) \
... .setCallbackType(
... ScanSettings.CALLBACK_TYPE_FIRST_MATCH |
... ScanSettings.CALLBACK_TYPE_MATCH_LOST
... )
Scan filters
^^^^^^^^^^^^
.. automodule:: able.filters
:members:
:member-order: bysource
:show-inheritance:
Advertising
^^^^^^^^^^^
.. automodule:: able.advertising
Advertiser
""""""""""
.. autoclass:: Advertiser
:members:
:member-order: bysource
Payload
"""""""
.. autoclass:: AdvertiseData
.. autoclass:: DeviceName
:show-inheritance:
.. autoclass:: TXPowerLevel
:show-inheritance:
.. autoclass:: ServiceUUID
:show-inheritance:
.. autoclass:: ServiceData
:show-inheritance:
.. autoclass:: ManufacturerData
:show-inheritance:
Constants
"""""""""
.. autoclass:: Interval
:members:
:member-order: bysource
.. autoclass:: TXPower
:members:
:member-order: bysource
.. autoclass:: Status
:members:
:undoc-members:
:member-order: bysource

295
libs/able/docs/conf.py Normal file
View file

@ -0,0 +1,295 @@
# -*- coding: utf-8 -*-
#
# ABLE documentation build configuration file, created by
# sphinx-quickstart on Sun Apr 16 23:19:55 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys
import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
# sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('..'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'ABLE'
copyright = u'2017, b3b'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.1'
# The full version, including alpha/beta/rc tags.
release = '0.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
#html_extra_path = []
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'ABLEdoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'ABLE.tex', u'ABLE Documentation',
u'b3b', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'able', u'ABLE Documentation',
[u'b3b'], 1)
]
# If true, show URL addresses after external links.
#man_show_urls = False
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'ABLE', u'ABLE Documentation',
u'b3b', 'ABLE', 'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
# If false, no module index is generated.
#texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False
# http://stackoverflow.com/questions/28366818/preserve-default-arguments-of-wrapped-decorated-python-function-in-sphinx-document
# Monkey-patch functools.wraps
import functools
def no_op_wraps(func):
"""Replaces functools.wraps in order to undo wrapping.
Can be used to preserve the decorated function's signature
in the documentation generated by Sphinx.
"""
def wrapper(decorator):
return func
return wrapper
functools.wraps = no_op_wraps
# http://docs.readthedocs.io/en/latest/faq.html#i-get-import-errors-on-libraries-that-depend-on-c-modules
# I get import errors on libraries that depend on C modules
from mock import MagicMock
class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return MagicMock()
MOCK_MODULES = ['kivy', 'kivy.utils', 'kivy.clock', 'kivy.logger',
'kivy.event']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
sys.modules['kivy.event'].EventDispatcher = object

192
libs/able/docs/example.rst Normal file
View file

@ -0,0 +1,192 @@
Usage Examples
==============
Alert
-----
.. literalinclude:: ./examples/alert.py
:language: python
Full example code: `alert <https://github.com/b3b/able/blob/master/examples/alert/>`_
Change MTU
----------
.. literalinclude:: ./examples/mtu.py
:language: python
Scan settings
-------------
.. code-block:: python
from able import BluetoothDispatcher
from able.scan_settings import ScanSettingsBuilder, ScanSettings
# Use faster detection (more power usage) mode
settings = ScanSettingsBuilder().setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
BluetoothDispatcher().start_scan(settings=settings)
Scan filters
------------
.. code-block:: python
from able import BluetoothDispatcher
from able.filters import (
DeviceAddressFilter,
DeviceNameFilter,
ManufacturerDataFilter,
ServiceDataFilter,
ServiceUUIDFilter
)
ble = BluetoothDispatcher()
# Start scanning with the condition that device has one of names: "Device1" or "Device2"
ble.start_scan(filters=[DeviceNameFilter("Device1"), DeviceNameFilter("Device2")])
ble.stop_scan()
# Start scanning with the condition that
# device advertises "180f" service and one of names: "Device1" or "Device2"
ble.start_scan(filters=[
ServiceUUIDFilter('0000180f-0000-1000-8000-00805f9b34fb') & DeviceNameFilter("Device1"),
ServiceUUIDFilter('0000180f-0000-1000-8000-00805f9b34fb') & DeviceNameFilter("Device2")
])
Adapter state
-------------
.. literalinclude:: ./examples/adapter_state_change.py
:language: python
Advertising
-----------
Advertise with data and additional (scannable) data
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: python
from able import BluetoothDispatcher
from able.advertising import (
Advertiser,
AdvertiseData,
ManufacturerData,
Interval,
ServiceUUID,
ServiceData,
TXPower,
)
advertiser = Advertiser(
ble=BluetoothDispatcher(),
data=AdvertiseData(ServiceUUID("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa")),
scan_data=AdvertiseData(ManufacturerData(id=0xAABB, data=b"some data")),
interval=Interval.MEDIUM,
tx_power=TXPower.MEDIUM,
)
advertiser.start()
Set and advertise device name
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: python
from able import BluetoothDispatcher
from able.advertising import Advertiser, AdvertiseData, DeviceName
ble = BluetoothDispatcher()
ble.name = "New test device name"
# There must be a wait and check, it takes time for new name to take effect
print(f"New device name is set: {ble.name}")
Advertiser(
ble=ble,
data=AdvertiseData(DeviceName())
)
Battery service data
^^^^^^^^^^^^^^^^^^^^
.. literalinclude:: ./examples/advertising_battery.py
:language: python
Use iBeacon advertising format
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: python
import uuid
from able import BluetoothDispatcher
from able.advertising import Advertiser, AdvertiseData, ManufacturerData
data = AdvertiseData(
ManufacturerData(
0x4C, # Apple Manufacturer ID
bytes([
0x2, # SubType: Custom Manufacturer Data
0x15 # Subtype lenth
]) +
uuid.uuid4().bytes + # UUID of beacon
bytes([
0, 15, # Major value
0, 1, # Minor value
10 # RSSI, dBm at 1m
]))
)
Advertiser(BluetoothDispatcher(), data).start()
Android Services
----------------
BLE devices scanning service
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
**main.py**
.. literalinclude:: ./examples/service_scan_main.py
:language: python
**service.py**
.. literalinclude:: ./examples/service_scan_service.py
:language: python
Full example code: `service_scan <https://github.com/b3b/able/blob/master/examples/service_scan/>`_
Advertising service
^^^^^^^^^^^^^^^^^^^
**main.py**
.. literalinclude:: ./examples/service_advertise_main.py
:language: python
**service.py**
.. literalinclude:: ./examples/service_advertise_service.py
:language: python
Full example code: `service_advertise <https://github.com/b3b/able/blob/master/examples/service_advertise/>`_
Connect to multiple devices
---------------------------
.. literalinclude:: ./examples/multi_devices/main.py
:language: python
Full example code: `multi_devices <https://github.com/b3b/able/blob/master/examples/multi_devices/>`_

3
libs/able/docs/index.rst Normal file
View file

@ -0,0 +1,3 @@
.. include:: ../README.rst
.. include:: api.rst
.. include:: example.rst

View file

@ -0,0 +1,27 @@
"""Detect and log Bluetooth adapter state change."""
from typing import Optional
from kivy.logger import Logger
from kivy.uix.widget import Widget
from able import AdapterState, BluetoothDispatcher
class Dispatcher(BluetoothDispatcher):
def on_bluetooth_adapter_state_change(self, state: int):
Logger.info(
f"Bluetoth adapter state changed to {state} ('{AdapterState(state).name}')."
)
if state == AdapterState.OFF:
Logger.info("Adapter state changed to OFF.")
class StateChangeApp(App):
def build(self):
Dispatcher()
return Widget()
if __name__ == "__main__":
StateChangeApp.run()

View file

@ -0,0 +1,71 @@
"""Advertise battery level, that degrades every second."""
from kivy.app import App
from kivy.clock import Clock
from kivy.uix.label import Label
from able import BluetoothDispatcher
from able import advertising
# Standard fully-qualified UUID for the Battery Service
BATTERY_SERVICE_UUID = "0000180f-0000-1000-8000-00805f9b34fb"
class BatteryAdvertiser(advertising.Advertiser):
def on_advertising_started(self, advertising_set, tx_power, status):
if status == advertising.Status.SUCCESS:
print("Advertising is started successfully")
else:
print(f"Advertising start error status: {status}")
def on_advertising_stopped(self, advertising_set):
print("Advertising stopped")
class BatteryLabel(Label):
"""Widget to control advertiser and show current battery level."""
def __init__(self):
self._level = 0
super().__init__(text="Waiting for advertising to start...")
self.advertiser = BatteryAdvertiser(
ble=BluetoothDispatcher(),
data=self.construct_data(level=100),
interval=advertising.Interval.MIN
)
self.advertiser.bind(on_advertising_started=self.on_started) # bind to start of advertising
self.advertiser.start()
def on_started(self, advertiser, advertising_set, tx_power, status):
if status == advertising.Status.SUCCESS:
# Advertising is started - update battery level every second
self.clock = Clock.schedule_interval(self.update_level, 1)
def update_level(self, dt):
level = self._level = (self._level - 1) % 101
self.text = str(level)
if level > 0:
# Set new advertising data
self.advertiser.data = self.construct_data(level)
else:
self.clock.cancel()
# Stop advertising
self.advertiser.stop()
def construct_data(self, level):
return advertising.AdvertiseData(
advertising.DeviceName(),
advertising.TXPowerLevel(),
advertising.ServiceData(BATTERY_SERVICE_UUID, [level])
)
class BatteryApp(App):
def build(self):
return BatteryLabel()
if __name__ == "__main__":
BatteryApp().run()

View file

@ -0,0 +1,27 @@
[app]
title = Alert Mi
version = 1.1
package.name = alert_mi
package.domain = org.kivy
source.dir = .
source.include_exts = py,png,jpg,kv,atlas
requirements = python3,kivy,android,able_recipe
android.accept_sdk_license = True
android.permissions =
BLUETOOTH,
BLUETOOTH_ADMIN,
BLUETOOTH_SCAN,
BLUETOOTH_CONNECT,
BLUETOOTH_ADVERTISE,
ACCESS_FINE_LOCATION
# android.api = 31
# android.minapi = 31
[buildozer]
warn_on_root = 1
# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output))
log_level = 2

View file

@ -0,0 +1,21 @@
<ErrorMessage>:
BoxLayout:
orientation: 'vertical'
padding: 10
spacing: 20
Label:
size_hint_y: None
font_size: '18sp'
height: '24sp'
text: 'Application has crashed, details: '
ScrollView:
size_hint: 1, 1
TextInput:
text: root.message
size_hint: 1, None
height: self.minimum_height
Button:
size_hint_y: None
height: '40sp'
text: 'OK, terminate'
on_press: root.dismiss()

View file

@ -0,0 +1,39 @@
import os
import traceback
from kivy.base import (
ExceptionHandler,
ExceptionManager,
stopTouchApp,
)
from kivy.properties import StringProperty
from kivy.uix.popup import Popup
from kivy.lang import Builder
from kivy.logger import Logger
Builder.load_file(os.path.join(os.path.dirname(__file__), 'error_message.kv'))
class ErrorMessageOnException(ExceptionHandler):
def handle_exception(self, exception):
Logger.exception('Unhandled Exception catched')
message = ErrorMessage(message=traceback.format_exc())
def raise_exception(*ar2gs, **kwargs):
stopTouchApp()
raise Exception("Exit due to errors")
message.bind(on_dismiss=raise_exception)
message.open()
return ExceptionManager.PASS
class ErrorMessage(Popup):
title = StringProperty('Bang!')
message = StringProperty('')
def install_exception_handler():
ExceptionManager.add_handler(ErrorMessageOnException())

View file

@ -0,0 +1,64 @@
"""Turn the alert on Mi Band device
"""
from kivy.app import App
from kivy.uix.button import Button
from able import BluetoothDispatcher, GATT_SUCCESS
from error_message import install_exception_handler
class BLE(BluetoothDispatcher):
device = alert_characteristic = None
def start_alert(self, *args, **kwargs):
if self.alert_characteristic: # alert service is already discovered
self.alert(self.alert_characteristic)
elif self.device: # device is already founded during the scan
self.connect_gatt(self.device) # reconnect
else:
self.stop_scan() # stop previous scan
self.start_scan() # start a scan for devices
def on_device(self, device, rssi, advertisement):
# some device is found during the scan
name = device.getName()
if name and name.startswith('MI'): # is a Mi Band device
self.device = device
self.stop_scan()
def on_scan_completed(self):
if self.device:
self.connect_gatt(self.device) # connect to device
def on_connection_state_change(self, status, state):
if status == GATT_SUCCESS and state: # connection established
self.discover_services() # discover what services a device offer
else: # disconnection or error
self.alert_characteristic = None
self.close_gatt() # close current connection
def on_services(self, status, services):
# 0x2a06 is a standard code for "Alert Level" characteristic
# https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.alert_level.xml
self.alert_characteristic = services.search('2a06')
self.alert(self.alert_characteristic)
def alert(self, characteristic):
self.write_characteristic(characteristic, [2]) # 2 is for "High Alert"
class AlertApp(App):
def build(self):
self.ble = None
return Button(text='Press to Alert Mi', on_press=self.start_alert)
def start_alert(self, *args, **kwargs):
if not self.ble:
self.ble = BLE()
self.ble.start_alert()
if __name__ == '__main__':
install_exception_handler()
AlertApp().run()

52
libs/able/examples/mtu.py Normal file
View file

@ -0,0 +1,52 @@
"""Request MTU change, and write 100 bytes to a characteristic."""
from kivy.app import App
from kivy.clock import Clock
from kivy.logger import Logger
from kivy.uix.widget import Widget
from able import BluetoothDispatcher, GATT_SUCCESS
class BLESender(BluetoothDispatcher):
def __init__(self):
super().__init__()
self.characteristic_to_write = None
Clock.schedule_once(self.connect, 0)
def connect(self, _):
self.connect_by_device_address("FF:FF:FF:FF:FF:FF")
def on_connection_state_change(self, status, state):
if status == GATT_SUCCESS and state:
self.discover_services()
def on_services(self, status, services):
if status == GATT_SUCCESS:
self.characteristic_to_write = services.search("0d03")
# Need to request 100 + 3 extra bytes for ATT packet header
self.request_mtu(103)
def on_mtu_changed(self, mtu, status):
if status == GATT_SUCCESS and mtu == 103:
Logger.info("MTU changed: now it is possible to send 100 bytes at once")
self.write_characteristic(self.characteristic_to_write, range(100))
else:
Logger.error("MTU not changed: mtu=%d, status=%d", mtu, status)
def on_characteristic_write(self, characteristic, status):
if status == GATT_SUCCESS:
Logger.info("Characteristic write succeed")
else:
Logger.error("Write status: %d", status)
class MTUApp(App):
def build(self):
BLESender()
return Widget()
if __name__ == '__main__':
MTUApp().run()

View file

@ -0,0 +1,27 @@
[app]
title = Multiple BLE devices
version = 1.0
package.name = multidevs
package.domain = test.able
source.dir = .
source.include_exts = py,png,jpg,kv,atlas
requirements = python3,kivy,android,able_recipe
android.accept_sdk_license = True
android.permissions =
BLUETOOTH,
BLUETOOTH_ADMIN,
BLUETOOTH_SCAN,
BLUETOOTH_CONNECT,
BLUETOOTH_ADVERTISE,
ACCESS_FINE_LOCATION
# android.api = 31
# android.minapi = 31
[buildozer]
warn_on_root = 1
# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output))
log_level = 2

View file

@ -0,0 +1,96 @@
"""Scan for devices with name "KivyBLETest",
connect and periodically read connected devices RSSI.
Multiple `BluetoothDispatcher` objects are used:
one for the scanning process and one for every connected device.
"""
from able import GATT_SUCCESS, BluetoothDispatcher
from able.filters import DeviceNameFilter
from kivy.app import App
from kivy.clock import Clock
from kivy.logger import Logger
from kivy.uix.label import Label
class DeviceDispatcher(BluetoothDispatcher):
"""Dispatcher to control a single BLE device."""
def __init__(self, device: "BluetoothDevice"):
super().__init__()
self._device = device
self._address: str = device.getAddress()
self._name: str = device.getName() or ""
@property
def title(self) -> str:
return f"<{self._address}><{self._name}>"
def on_connection_state_change(self, status: int, state: int):
if status == GATT_SUCCESS and state:
Logger.info(f"Device: {self.title} connected")
else:
Logger.info(f"Device: {self.title} disconnected. {status=}, {state=}")
self.close_gatt()
Clock.schedule_once(callback=lambda dt: self.reconnect(), timeout=15)
def on_rssi_updated(self, rssi: int, status: int):
Logger.info(f"Device: {self.title} RSSI: {rssi}")
def periodically_update_rssi(self):
"""
Clock callback to read
the signal strength indicator for a connected device.
"""
if self.gatt: # if device is connected
self.update_rssi()
def reconnect(self):
Logger.info(f"Device: {self.title} try to reconnect ...")
self.connect_gatt(self._device)
def start(self):
"""Start connection to device."""
if not self.gatt:
self.connect_gatt(self._device)
Clock.schedule_interval(
callback=lambda dt: self.periodically_update_rssi(), timeout=5
)
class ScannerDispatcher(BluetoothDispatcher):
"""Dispatcher to control the scanning process."""
def __init__(self):
super().__init__()
# Stores connected devices addresses
self._devices: dict[str, DeviceDispatcher] = {}
def on_scan_started(self, success: bool):
if success:
Logger.info("Scan: started")
else:
Logger.error("Scan: error on start")
def on_scan_completed(self):
Logger.info("Scan: completed")
def on_device(self, device, rssi, advertisement):
address = device.getAddress()
if address not in self._devices:
# Create dispatcher instance for a new device
dispatcher = DeviceDispatcher(device)
# Remember address,
# to avoid multiple dispatchers creation for this device
self._devices[address] = dispatcher
Logger.info(f"Scan: device <{address}> added")
dispatcher.start()
class MultiDevicesApp(App):
def build(self):
ScannerDispatcher().start_scan(filters=[DeviceNameFilter("KivyBLETest")])
return Label(text=self.name)
if __name__ == "__main__":
MultiDevicesApp().run()

View file

@ -0,0 +1,27 @@
[app]
title = BLE advertising service
version = 1.1
package.name = advservice
package.domain = test.able
source.dir = .
source.include_exts = py,png,jpg,kv,atlas
android.permissions =
FOREGROUND_SERVICE,
BLUETOOTH,
BLUETOOTH_ADMIN,
BLUETOOTH_CONNECT,
BLUETOOTH_ADVERTISE
requirements = kivy==2.1.0,python3,able_recipe
services = Able:service.py:foreground
android.accept_sdk_license = True
# android.api = 31
# android.minapi = 31
[buildozer]
warn_on_root = 1
# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output))
log_level = 2

View file

@ -0,0 +1,56 @@
"""Start advertising service."""
from able import BluetoothDispatcher, Permission, require_bluetooth_enabled
from jnius import autoclass
from kivy.app import App
from kivy.lang import Builder
kv = """
BoxLayout:
Button:
text: 'Start service'
on_press: app.ble_dispatcher.start_service()
Button:
text: 'Stop service'
on_press: app.ble_dispatcher.stop_service()
"""
class Dispatcher(BluetoothDispatcher):
@property
def service(self):
return autoclass("test.able.advservice.ServiceAble")
@property
def activity(self):
return autoclass("org.kivy.android.PythonActivity").mActivity
# Need to turn on the adapter, before service is started
@require_bluetooth_enabled
def start_service(self):
self.service.start(
self.activity,
# Pass UUID to advertise
"bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb",
)
App.get_running_app().stop() # Can close the app, service will continue running
def stop_service(self):
self.service.stop(self.activity)
class ServiceApp(App):
def build(self):
self.ble_dispatcher = Dispatcher(
# This app does not use device scanning,
# so the list of required permissions can be reduced
runtime_permissions=[
Permission.BLUETOOTH_CONNECT,
Permission.BLUETOOTH_ADVERTISE,
]
)
return Builder.load_string(kv)
if __name__ == "__main__":
ServiceApp().run()

View file

@ -0,0 +1,28 @@
"""Service to advertise data, while not stopped."""
import time
from os import environ
from able import BluetoothDispatcher
from able.advertising import (
Advertiser,
AdvertiseData,
ServiceUUID,
)
def main():
uuid = environ.get(
"PYTHON_SERVICE_ARGUMENT",
"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
)
advertiser = Advertiser(
ble=BluetoothDispatcher(),
data=AdvertiseData(ServiceUUID(uuid)),
)
advertiser.start()
while True:
time.sleep(0xDEAD)
if __name__ == "__main__":
main()

View file

@ -0,0 +1,29 @@
[app]
title = BLE scan dev service
version = 1.1
package.name = scanservice
package.domain = test.able
source.dir = .
source.include_exts = py,png,jpg,kv,atlas
android.permissions =
FOREGROUND_SERVICE,
BLUETOOTH,
BLUETOOTH_ADMIN,
BLUETOOTH_SCAN,
BLUETOOTH_CONNECT,
BLUETOOTH_ADVERTISE,
ACCESS_FINE_LOCATION
requirements = kivy==2.1.0,python3,able_recipe
services = Able:service.py:foreground
android.accept_sdk_license = True
# android.api = 31
# android.minapi = 31
[buildozer]
warn_on_root = 1
# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output))
log_level = 2

View file

@ -0,0 +1,48 @@
"""Start BLE devices scaning service."""
from able import (
BluetoothDispatcher,
require_bluetooth_enabled,
)
from jnius import autoclass
from kivy.app import App
from kivy.lang import Builder
kv = """
BoxLayout:
Button:
text: 'Start service'
on_press: app.ble_dispatcher.start_service()
Button:
text: 'Stop service'
on_press: app.ble_dispatcher.stop_service()
"""
class Dispatcher(BluetoothDispatcher):
@property
def service(self):
return autoclass("test.able.scanservice.ServiceAble")
@property
def activity(self):
return autoclass("org.kivy.android.PythonActivity").mActivity
# Need to turn on the adapter and obtain permissions, before service is started
@require_bluetooth_enabled
def start_service(self):
self.service.start(self.activity, "")
App.get_running_app().stop() # Can close the app, service will continue to run
def stop_service(self):
self.service.stop(self.activity)
class ServiceApp(App):
def build(self):
self.ble_dispatcher = Dispatcher()
return Builder.load_string(kv)
if __name__ == "__main__":
ServiceApp().run()

View file

@ -0,0 +1,27 @@
"""Service to run BLE scan for 60 seconds,
and log each `on_device` event.
"""
import time
from able import BluetoothDispatcher
from kivy.logger import Logger
class BLE(BluetoothDispatcher):
def on_device(self, device, rssi, advertisement):
title = device.getName() or device.getAddress()
Logger.info("BLE Device found: %s", title)
def on_error(self, msg):
Logger.error("BLE Error %s", msg)
def main():
ble = BLE()
ble.start_scan()
time.sleep(60)
ble.stop_scan()
if __name__ == "__main__":
main()

View file

@ -0,0 +1,34 @@
"""
Android Bluetooth Low Energy
"""
from pythonforandroid.recipe import PythonRecipe
from pythonforandroid.toolchain import current_directory, info, shprint
import sh
from os.path import join
class AbleRecipe(PythonRecipe):
name = 'able_recipe'
depends = ['python3', 'setuptools', 'android']
call_hostpython_via_targetpython = False
install_in_hostpython = True
def prepare_build_dir(self, arch):
build_dir = self.get_build_dir(arch)
assert build_dir.endswith(self.name)
shprint(sh.rm, '-rf', build_dir)
shprint(sh.mkdir, build_dir)
for filename in ('../../able', 'setup.py'):
shprint(sh.cp, '-a', join(self.get_recipe_dir(), filename),
build_dir)
def postbuild_arch(self, arch):
super(AbleRecipe, self).postbuild_arch(arch)
info('Copying able java class to classes build dir')
with current_directory(self.get_build_dir(arch.arch)):
shprint(sh.cp, '-a', join('able', 'src', 'org'),
self.ctx.javaclass_dir)
recipe = AbleRecipe()

View file

@ -0,0 +1,9 @@
from setuptools import setup
setup(
name='able',
version='0.0.0',
packages=['able', 'able.android'],
description='Bluetooth Low Energy for Android',
license='MIT',
)

135
libs/able/setup.py Normal file
View file

@ -0,0 +1,135 @@
import os
import re
import shutil
from pathlib import Path
from setuptools import setup
from setuptools.command.install import install
main_ns = {}
with Path("able/version.py").open() as ver_file:
exec(ver_file.read(), main_ns)
with Path("README.rst").open() as readme_file:
long_description = readme_file.read()
class PathParser:
@property
def javaclass_dir(self):
path = self.build_dir / "javaclasses"
if not path.exists():
raise Exception(
"Java classes directory is not found. "
"Please report issue to: https://github.com/b3b/able/issues"
)
path = path / self.distribution_name
print(f"Java classes directory found: '{path}'.")
path.mkdir(parents=True, exist_ok=True)
return path
@property
def distribution_name(self):
path = self.python_path
while path.parent.name != "python-installs":
if len(path.parts) <= 1:
raise Exception(
"Distribution name is not found. "
"Please report issue to: https://github.com/b3b/able/issues"
)
path = path.parent
print(f"Distribution name found: '{path.name}'.")
return path.name
@property
def build_dir(self):
return self.python_installs_dir.parent
@property
def python_installs_dir(self):
path = self.python_path.parent
while path.name != "python-installs":
if len(path.parts) <= 1:
raise Exception(
"Python installs directory is not found. "
"Please report issue to: https://github.com/b3b/able/issues"
)
path = path.parent
return path
@property
def python_path(self):
cppflags = os.environ["CPPFLAGS"]
print(f"Searching for Python install directory in CPPFLAGS: '{cppflags}'")
match = re.search(r"-I(/[^\s]+/build/python-installs/[^/\s]+/)", cppflags)
if not match:
raise Exception("Can't find Python install directory.")
found_path = Path(match.group(1))
print("FOUND INSTALL DIRECTORY: "+found_path)
return found_path
class InstallRecipe(install):
"""Command to install `able` recipe,
copies Java files to distribution `javaclass` directory."""
def run(self):
if False and "ANDROIDAPI" not in os.environ:
raise Exception(
"This recipe should not be installed directly, "
"only with the buildozer tool."
)
# Find Java classes target directory from the environment
javaclass_dir = str(PathParser().javaclass_dir)
for java_file in (
"able/src/org/able/BLE.java",
"able/src/org/able/BLEAdvertiser.java",
"able/src/org/able/PythonBluetooth.java",
"able/src/org/able/PythonBluetoothAdvertiser.java",
):
shutil.copy(java_file, javaclass_dir)
install.run(self)
setup(
name="able_recipe",
version=main_ns["__version__"],
packages=["able", "able.android"],
description="Bluetooth Low Energy for Android",
long_description=long_description,
long_description_content_type="text/x-rst",
author="b3b",
author_email="ash.b3b@gmail.com",
install_requires=[],
url="https://github.com/b3b/able",
project_urls={
"Changelog": "https://github.com/b3b/able/blob/master/CHANGELOG.rst",
},
# https://pypi.org/classifiers/
classifiers=[
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: MIT License",
"Operating System :: Android",
"Topic :: System :: Networking",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
],
keywords="android ble bluetooth kivy",
license="MIT",
zip_safe=False,
cmdclass={
"install": InstallRecipe,
},
options={
"bdist_wheel": {
# Changing the wheel name
# to avoid installing a package from cache.
"plat_name": "unused-nocache",
},
},
)

1
libs/able/testapps/bletest/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
server

View file

@ -0,0 +1,193 @@
#:kivy 1.1.0
#: import Factory kivy.factory.Factory
#: import findall re.findall
<Caption@Label>:
padding_left: '4sp'
halign: 'left'
text_size: self.size
valign: 'middle'
<Value@Label>:
padding_left: '4sp'
halign: 'left'
text_size: self.size
valign: 'middle'
<ConnectByMACDialog@Popup>:
title: 'Connect by MAC address'
size_hint: None, None
size: '400sp', '120sp'
BoxLayout:
orientation: 'vertical'
pos: self.pos
size: root.size
TextInput:
size_hint_y: .5
hint_text: 'Device address'
input_filter: lambda value, _ : ''.join(findall('[0-9a-fA-F:]+', value)).upper()
multiline: False
text: app.device_address
on_text: app.device_address = self.text
BoxLayout:
orientation: 'horizontal'
size_hint_y: .5
Button:
text: 'Connect'
on_press: root.dismiss(), app.connect_by_mac_address()
Button:
text: 'Cancel'
on_press: root.dismiss()
<MainLayout>:
padding: '10sp'
BoxLayout:
orientation: 'horizontal'
GridLayout:
cols: 2
padding: '0sp'
spacing: '0sp'
orientation: 'lr-tb'
Caption:
text: 'Adapter:'
Value:
text: app.adapter_state
Caption:
text: 'State:'
Value:
text: app.state
halign: 'left'
valign: 'middle'
text_size: self.size
Caption:
text: 'Read test:'
Value:
text: app.test_string
Caption:
text: 'Notifications count:'
Value:
text: app.notification_value
Caption:
text: 'N packets sended:'
Value:
text: app.increment_count_value
Caption:
text: 'N packets delivered:'
Value:
text: app.counter_value
Caption:
text: 'Total transmission time:'
Value:
text: app.counter_total_time
BoxLayout:
spacing: '20sp'
orientation: 'vertical'
BoxLayout:
orientation: 'horizontal'
size_hint_y: .3
Button:
text: 'Scan and connect'
on_press: app.start_scan()
Button:
text: 'Connect by MAC address'
on_press: Factory.ConnectByMACDialog().open()
BoxLayout:
id: queue_box
orientation: 'vertical'
size_hint_y: .15
BoxLayout:
orientation: 'horizontal'
Caption:
text: 'Enable GATT autoconnect:'
CheckBox:
id: timeout_checkbox
active: app.autoconnect
on_active: app.autoconnect = self.active
BoxLayout:
orientation: 'horizontal'
size_hint_y: .2
spacing: 10
Button:
disabled: app.state != 'connected'
text: 'Read RSSI'
on_press: app.read_rssi()
Caption:
text: 'RSSI Value:'
Value:
text: app.rssi
ToggleButton:
disabled: app.state != 'connected'
text: "Enable notifications"
size_hint_y: .2
on_state: app.enable_notifications(self.state == 'down')
BoxLayout:
id: queue_box
orientation: 'vertical'
disabled: app.state != 'connected'
BoxLayout:
orientation: 'horizontal'
Caption:
text: 'Enable BLE queue timeout:'
CheckBox:
id: timeout_checkbox
active: app.queue_timeout_enabled
on_active: app.queue_timeout_enabled = self.active
BoxLayout:
orientation: 'horizontal'
Caption:
text: 'BLE queue timeout (ms):'
TextInput:
disabled: queue_box.disabled or not timeout_checkbox.active
input_filter: 'int'
multiline: False
text: app.queue_timeout
on_text: app.queue_timeout = self.text
BoxLayout:
Button:
text: 'Apply queue settings'
on_press: app.set_queue_settings()
BoxLayout:
disabled: app.state != 'connected'
orientation: 'vertical'
BoxLayout:
orientation: 'horizontal'
Caption:
text: 'Transmission interval (ms):'
TextInput:
input_filter: 'int'
multiline: False
text: app.incremental_interval
on_text: app.incremental_interval = self.text
BoxLayout:
orientation: 'horizontal'
Caption:
text: 'Packet count limit:'
TextInput:
input_filter: 'int'
multiline: False
text: app.counter_max
on_text: app.counter_max = self.text
padding_bottom: '100sp'
ToggleButton:
width: self.texture_size[0] + 50
text: "Enable transmission"
on_state: app.enable_counter(self.state == 'down')

View file

@ -0,0 +1,17 @@
[app]
title = BLE functions test
version = 1.0
package.name = kivy_ble_test
package.domain = org.kivy
source.dir = .
source.include_exts = py,png,jpg,kv,atlas
android.permissions = BLUETOOTH, BLUETOOTH_ADMIN, ACCESS_FINE_LOCATION
requirements = python3,kivy,android,able_recipe
# (str) Android's logcat filters to use
android.logcat_filters = *:S python:D
[buildozer]
warn_on_root = 1
# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output))
log_level = 2

View file

@ -0,0 +1,245 @@
"""Connect to "KivyBLETest" server and test various BLE functions
"""
import time
from able import AdapterState, GATT_SUCCESS, BluetoothDispatcher
from kivy.app import App
from kivy.clock import Clock
from kivy.config import Config
from kivy.properties import BooleanProperty, StringProperty
from kivy.uix.boxlayout import BoxLayout
from kivy.storage.jsonstore import JsonStore
Config.set('kivy', 'log_level', 'debug')
Config.set('kivy', 'log_enable', '1')
class MainLayout(BoxLayout):
pass
class BLETestApp(App):
ble = BluetoothDispatcher()
adapter_state = StringProperty('')
state = StringProperty('')
test_string = StringProperty('')
rssi = StringProperty('')
notification_value = StringProperty('')
counter_value = StringProperty('')
increment_count_value = StringProperty('')
incremental_interval = StringProperty('100')
counter_max = StringProperty('128')
counter_value = StringProperty('')
counter_state = StringProperty('')
counter_total_time = StringProperty('')
queue_timeout_enabled = BooleanProperty(True)
queue_timeout = StringProperty('1000')
device_name = StringProperty('KivyBLETest')
device_address = StringProperty('')
autoconnect = BooleanProperty(False)
store = JsonStore('bletestapp.json')
uids = {
'string': '0d01',
'counter_reset': '0d02',
'counter_increment': '0d03',
'counter_read': '0d04',
'notifications': '0d05'
}
def build(self):
if self.store.exists('device'):
self.device_address = self.store.get('device')['address']
else:
self.device_address = ''
return MainLayout()
def on_pause(self):
return True
def on_resume(self):
pass
def init(self):
self.set_queue_settings()
self.ble.bind(on_device=self.on_device)
self.ble.bind(on_scan_started=self.on_scan_started)
self.ble.bind(on_scan_completed=self.on_scan_completed)
self.ble.bind(on_bluetooth_adapter_state_change=self.on_bluetooth_adapter_state_change)
self.ble.bind(
on_connection_state_change=self.on_connection_state_change)
self.ble.bind(on_services=self.on_services)
self.ble.bind(on_characteristic_read=self.on_characteristic_read)
self.ble.bind(on_characteristic_changed=self.on_characteristic_changed)
self.ble.bind(on_rssi_updated=self.on_rssi_updated)
def start_scan(self):
if not self.state:
self.init()
self.state = 'scan_start'
self.ble.close_gatt()
self.ble.start_scan()
def connect_by_mac_address(self):
self.store.put('device', address=self.device_address)
if not self.state:
self.init()
self.state = 'try_connect'
self.ble.close_gatt()
try:
self.ble.connect_by_device_address(
self.device_address,
autoconnect=self.autoconnect,
)
except ValueError as exc:
self.state = str(exc)
def on_scan_started(self, ble, success):
self.state = 'scan' if success else 'scan_error'
def on_device(self, ble, device, rssi, advertisement):
if self.state != 'scan':
return
if device.getName() == self.device_name:
self.device = device
self.state = 'found'
self.ble.stop_scan()
def on_scan_completed(self, ble):
if self.device:
self.ble.connect_gatt(
self.device,
autoconnect=self.autoconnect,
)
def on_connection_state_change(self, ble, status, state):
if status == GATT_SUCCESS:
if state:
self.ble.discover_services()
else:
self.state = 'disconnected'
else:
self.state = 'connection_error'
def on_services(self, ble, status, services):
if status != GATT_SUCCESS:
self.state = 'services_error'
return
self.state = 'connected'
self.services = services
self.read_test_string(ble)
self.characteristics = {
'counter_increment': self.services.search(
self.uids['counter_increment']),
'counter_reset': self.services.search(
self.uids['counter_reset']),
}
def on_bluetooth_adapter_state_change(self, ble, state):
self.adapter_state = AdapterState(state).name
def read_rssi(self):
self.rssi = '...'
result = self.ble.update_rssi()
def on_rssi_updated(self, ble, rssi, status):
self.rssi = str(rssi) if status == GATT_SUCCESS else f"Bad status: {status}"
def read_test_string(self, ble):
characteristic = self.services.search(self.uids['string'])
if characteristic:
ble.read_characteristic(characteristic)
else:
self.test_string = 'not found'
def read_remote_counter(self):
characteristic = self.services.search(self.uids['counter_read'])
if characteristic:
self.ble.read_characteristic(characteristic)
else:
self.counter_value = 'error'
def enable_notifications(self, enable):
if enable:
self.notification_value = '0'
characteristic = self.services.search(self.uids['notifications'])
if characteristic:
self.ble.enable_notifications(characteristic, enable)
else:
self.notification_value = 'error'
def enable_counter(self, enable):
if enable:
self.counter_state = 'init'
interval = int(self.incremental_interval) * .001
Clock.schedule_interval(self.counter_next, interval)
else:
Clock.unschedule(self.counter_next)
if self.counter_state != 'stop':
self.counter_state = 'stop'
self.read_remote_counter()
def counter_next(self, dt):
if self.counter_state == 'init':
self.counter_started_time = time.time()
self.counter_total_time = ''
self.reset_remote_counter()
self.increment_remote_counter()
elif self.counter_state == 'enabled':
if int(self.increment_count_value) < int(self.counter_max):
self.increment_remote_counter()
else:
self.enable_counter(False)
def reset_remote_counter(self):
self.increment_count_value = '0'
self.counter_value = ''
self.ble.write_characteristic(self.characteristics['counter_reset'], [])
self.counter_state = 'enabled'
def on_characteristic_read(self, ble, characteristic, status):
uuid = characteristic.getUuid().toString()
if self.uids['string'] in uuid:
self.update_string_value(characteristic, status)
elif self.uids['counter_read'] in uuid:
self.counter_total_time = str(
time.time() - self.counter_started_time)
self.update_counter_value(characteristic, status)
def update_string_value(self, characteristic, status):
result = 'ERROR'
if status == GATT_SUCCESS:
value = characteristic.getStringValue(0)
if value == 'test':
result = 'OK'
self.test_string = result
def increment_remote_counter(self):
characteristic = self.characteristics['counter_increment']
self.ble.write_characteristic(characteristic, [])
prev_value = int(self.increment_count_value)
self.increment_count_value = str(prev_value + 1)
def update_counter_value(self, characteristic, status):
if status == GATT_SUCCESS:
self.counter_value = characteristic.getStringValue(0)
else:
self.counter_value = 'ERROR'
def set_queue_settings(self):
self.ble.set_queue_timeout(None if not self.queue_timeout_enabled
else int(self.queue_timeout) * .001)
def on_characteristic_changed(self, ble, characteristic):
uuid = characteristic.getUuid().toString()
if self.uids['notifications'] in uuid:
prev_value = self.notification_value
value = int(characteristic.getStringValue(0))
if (prev_value == 'error') or (value != int(prev_value) + 1):
value = 'error'
self.notification_value = str(value)
if __name__ == '__main__':
BLETestApp().run()

View file

@ -0,0 +1,95 @@
// +build
// based on https://github.com/paypal/gatt/blob/master/examples/server.go
package main
import (
"fmt"
"log"
"time"
"github.com/paypal/gatt"
"github.com/paypal/gatt/linux/cmd"
)
var DefaultServerOptions = []gatt.Option{
gatt.LnxMaxConnections(1),
gatt.LnxDeviceID(-1, false),
gatt.LnxSetAdvertisingParameters(&cmd.LESetAdvertisingParameters{
AdvertisingIntervalMin: 0x04ff,
AdvertisingIntervalMax: 0x04ff,
AdvertisingChannelMap: 0x7,
}),
}
func NewTestPythonService() *gatt.Service {
n := 0
s := gatt.NewService(gatt.MustParseUUID("16fe0d00-c111-11e3-b8c8-0002a5d5c51b"))
s.AddCharacteristic(gatt.MustParseUUID("16fe0d01-c111-11e3-b8c8-0002a5d5c51b")).HandleReadFunc(
func(rsp gatt.ResponseWriter, req *gatt.ReadRequest) {
n = 0
log.Println("Echo")
fmt.Fprintf(rsp, "test")
})
s.AddCharacteristic(gatt.MustParseUUID("16fe0d02-c111-11e3-b8c8-0002a5d5c51b")).HandleWriteFunc(
func(r gatt.Request, data []byte) (status byte) {
n = 0
log.Println("Reset counter")
return gatt.StatusSuccess
})
s.AddCharacteristic(gatt.MustParseUUID("16fe0d03-c111-11e3-b8c8-0002a5d5c51b")).HandleWriteFunc(
func(r gatt.Request, data []byte) (status byte) {
n++
log.Println("Increment counter")
return gatt.StatusSuccess
})
s.AddCharacteristic(gatt.MustParseUUID("16fe0d04-c111-11e3-b8c8-0002a5d5c51b")).HandleReadFunc(
func(rsp gatt.ResponseWriter, req *gatt.ReadRequest) {
log.Println("Response counter: ", n)
fmt.Fprintf(rsp, "%d", n)
})
s.AddCharacteristic(gatt.MustParseUUID("16fe0d05-c111-11e3-b8c8-0002a5d5c51b")).HandleNotifyFunc(
func(r gatt.Request, n gatt.Notifier) {
log.Println("Notifications enabled")
cnt := 1
for !n.Done() {
fmt.Fprintf(n, "%d", cnt)
cnt++
time.Sleep(100 * time.Millisecond)
}
log.Println("Notifications disabled")
})
return s
}
func main() {
d, err := gatt.NewDevice(DefaultServerOptions...)
if err != nil {
log.Fatalf("Failed to open device, err: %s", err)
}
d.Handle(
gatt.CentralConnected(func(c gatt.Central) { fmt.Println("Connect: ", c.ID()) }),
gatt.CentralDisconnected(func(c gatt.Central) { fmt.Println("Disconnect: ", c.ID()) }),
)
onStateChanged := func(d gatt.Device, s gatt.State) {
fmt.Printf("State: %s\n", s)
switch s {
case gatt.StatePoweredOn:
s1 := NewTestPythonService()
d.AddService(s1)
d.AdvertiseNameAndServices("KivyBLETest", []gatt.UUID{s1.UUID()})
default:
}
}
d.Init(onStateChanged)
select {}
}

View file

4
libs/able/tests/notebooks/.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
there.env
.ipynb_checkpoints/
*.asciidoc
*.ipynb

View file

@ -0,0 +1,43 @@
---
jupyter:
jupytext:
formats: ipynb,md
text_representation:
extension: .md
format_name: markdown
format_version: '1.3'
jupytext_version: 1.11.2
kernelspec:
display_name: Python 3
language: python
name: python3
---
```python
from time import sleep
%load_ext pythonhere
%connect-there
```
```python
%%there
from dataclasses import dataclass, field
from typing import List
from jnius import autoclass, cast
from able.android.dispatcher import (
BluetoothDispatcher
)
from able.scan_settings import (
ScanSettings,
ScanSettingsBuilder
)
@dataclass
class Results:
started: bool = None
completed: bool = None
devices: List = field(default_factory=lambda: [])
```

22
libs/able/tests/notebooks/run Executable file
View file

@ -0,0 +1,22 @@
#!/bin/bash
set -ex
name="$1"
command="${2}"
command="${command:=test}"
cat "${name}.md" |
jupytext --execute --to ipynb |
jupyter nbconvert --stdin --no-input --to asciidoc --output "${name}"
cat "${name}".asciidoc
if [ "${command}" = "test" ]; then
diff "${name}.asciidoc" "${name}.expected"
elif [ "${command}" = "record" ]; then
cp "${name}".asciidoc "${name}".expected
else
echo "Unknown command: ${command}"
exit 1
fi

View file

@ -0,0 +1,4 @@
#!/bin/bash
set -e
for name in test_*.md; do ./run "${name%%.*}"; done

View file

@ -0,0 +1,26 @@
[[setup]]
= Setup
[[run-ble-devices-scan]]
= Run BLE devices scan
----
Started: None Completed: None
----
[[check-that-scan-started-and-completed]]
= Check that scan started and completed
----
Started: 1 Completed: 1
----
[[check-that-testing-device-was-discovered]]
= Check that testing device was discovered
----
True
----

View file

@ -0,0 +1,74 @@
---
jupyter:
jupytext:
formats: ipynb,md
text_representation:
extension: .md
format_name: markdown
format_version: '1.3'
jupytext_version: 1.11.2
kernelspec:
display_name: Python 3
language: python
name: python3
---
# Setup
```python
%run init.ipynb
```
```python
%%there
class BLE(BluetoothDispatcher):
def on_scan_started(self, success):
results.started = success
def on_scan_completed(self):
results.completed = 1
def on_device(self, device, rssi, advertisement):
results.devices.append(device)
ble = BLE()
```
# Run BLE devices scan
```python
%%there
results = Results()
print(f"Started: {results.started} Completed: {results.completed}")
ble.start_scan()
```
```python
sleep(10)
```
```python
%%there
ble.stop_scan()
```
```python
sleep(2)
```
# Check that scan started and completed
```python
%%there
print(f"Started: {results.started} Completed: {results.completed}")
```
# Check that testing device was discovered
```python
%%there
print(
"KivyBLETest" in [dev.getName() for dev in results.devices]
)
```

View file

@ -0,0 +1,72 @@
[[setup]]
= Setup
[[test-device-is-found-with-scan-filters-set]]
= Test device is found with scan filters set
----
{'KivyBLETest'}
----
[[test-device-is-not-found-filtered-out-by-name]]
= Test device is not found: filtered out by name
----
[]
----
[[test-scan-filter-mathes]]
= Test scan filter mathes
----
EmptyFilter() True
EmptyFilter() True
EmptyFilter() True
----
----
DeviceAddressFilter(address='AA:AA:AA:AA:AA:AA') True
DeviceAddressFilter(address='AA:AA:AA:AA:AA:AB') False
AA is not a valid Bluetooth address
----
----
DeviceNameFilter(name='KivyBLETest') True
DeviceNameFilter(name='KivyBLETes') False
----
----
ManufacturerDataFilter(id=76, data=[], mask=None) False
ManufacturerDataFilter(id=76, data=[], mask=None) True
ManufacturerDataFilter(id=76, data=[2, 21, 141, 166, 131, 214, 229], mask=None) True
ManufacturerDataFilter(id=76, data=[2, 21, 141, 166, 131, 214, 170], mask=None) False
ManufacturerDataFilter(id=76, data=[2, 21, 141, 166, 131, 214, 170], mask=[255, 255, 255, 255, 255, 255, 0]) True
ManufacturerDataFilter(id=76, data=[2, 21, 141, 166, 131, 214, 170], mask=[255, 255, 255, 255, 255, 255, 255]) False
ManufacturerDataFilter(id=76, data=[2, 0, 141, 166, 131], mask=[255, 0, 255, 255, 255]) True
ManufacturerDataFilter(id=76, data=b'\x02\x15', mask=None) True
ManufacturerDataFilter(id=76, data=b'\x02\x16', mask=None) False
----
----
ServiceDataFilter(uid='0000180f-0000-1000-8000-00805f9b34fb', data=[], mask=None) True
ServiceDataFilter(uid='0000180f-0000-1000-8000-00805f9b34fc', data=[], mask=None) False
ServiceDataFilter(uid='0000180f-0000-1000-8000-00805f9b34fb', data=[34], mask=None) True
ServiceDataFilter(uid='0000180f-0000-1000-8000-00805f9b34fb', data=[33], mask=None) False
ServiceDataFilter(uid='0000180f-0000-1000-8000-00805f9b34fb', data=[33], mask=[240]) True
ServiceDataFilter(uid='0000180f-0000-1000-8000-00805f9b34fb', data=[33], mask=[15]) False
----
----
ServiceUUIDFilter(uid='16fe0d00-c111-11e3-b8c8-0002a5d5c51B', mask=None) True
ServiceUUIDFilter(uid='16fe0d00-c111-11e3-b8c8-0002a5d5c51C', mask=None) False
ServiceUUIDFilter(uid='16fe0d00-c111-11e3-b8c8-0002a5d5c51C', mask='ffffffff-ffff-ffff-ffff-ffffffffffff') False
ServiceUUIDFilter(uid='16fe0d00-c111-11e3-b8c8-0002a5d5c51C', mask='ffffffff-ffff-ffff-ffff-fffffffffff0') True
----

View file

@ -0,0 +1,222 @@
---
jupyter:
jupytext:
formats: ipynb,md
text_representation:
extension: .md
format_name: markdown
format_version: '1.3'
jupytext_version: 1.11.2
kernelspec:
display_name: Python 3
language: python
name: python3
---
# Setup
```python
%run init.ipynb
```
```python
%%there
from able.filters import *
class BLE(BluetoothDispatcher):
def on_scan_started(self, success):
results.started = success
def on_scan_completed(self):
results.completed = 1
def on_device(self, device, rssi, advertisement):
results.devices.append(device)
ble = BLE()
```
```python
%%there
BluetoothDevice = autoclass("android.bluetooth.BluetoothDevice")
ScanResult = autoclass("android.bluetooth.le.ScanResult")
ScanRecord = autoclass("android.bluetooth.le.ScanRecord")
Parcel = autoclass("android/os/Parcel")
ParcelUuid = autoclass('android.os.ParcelUuid')
def filter_matches(f, scan_result):
print(f, f.build().matches(scan_result))
def mock_device():
"""Return BluetoothDevice instance with address=AA:AA:AA:AA:AA:AA"""
device_data = [17, 0, 0, 0, 65, 0, 65, 0, 58, 0, 65, 0, 65, 0, 58, 0, 65, 0, 65, 0, 58, 0, 65, 0, 65, 0, 58, 0, 65, 0, 65, 0, 58, 0, 65, 0, 65]
p = Parcel.obtain()
p.unmarshall(device_data, 0, len(device_data))
p.setDataPosition(0)
return BluetoothDevice.CREATOR.createFromParcel(p)
def mock_scan_result(record):
return ScanResult(mock_device(), ScanRecord.parseFromBytes(record), -33, 1633954394000)
def mock_test_app_scan_result():
return mock_scan_result(
[2, 1, 6, 17, 6, 27, 197, 213, 165, 2, 0, 200, 184, 227, 17, 17, 193, 0, 13,
254, 22, 12, 9, 75, 105, 118, 121, 66, 76, 69, 84, 101, 115, 116,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
]
)
def mock_beacon_scan_result():
"""0x4C, # Apple Manufacturer ID
bytes([
0x2, # SubType: Custom Manufacturer Data
0x15 # Subtype lenth
]) +
uuid + # UUID of beacon: UUID=8da683d6-e574-4a2e-bb9b-d83f2d05fc12
bytes([
0, 15, # Major value
0, 1, # Minor value
10 # RSSI, dBm at 1m
])
"""
return mock_scan_result(bytes.fromhex('1AFF4C0002158DA683D6E5744A2EBB9BD83F2D05FC12000F00010A'))
def mock_battery_scan_result():
"""Battery ("0000180f-0000-1000-8000-00805f9b34fb" or "180f" in short form)
service data: 34% (0x22)
"""
return mock_scan_result(bytes.fromhex('04160F1822'))
beacon = mock_beacon_scan_result()
battery = mock_battery_scan_result()
testapp = mock_test_app_scan_result()
```
# Test device is found with scan filters set
```python
%%there
results = Results()
ble.start_scan(filters=[
DeviceNameFilter("KivyBLETest") & ServiceUUIDFilter("16fe0d00-c111-11e3-b8c8-0002a5d5c51b"),
])
```
```python
sleep(10)
```
```python
%%there
ble.stop_scan()
```
```python
sleep(2)
```
```python
%%there
print(set([dev.getName() for dev in results.devices]))
```
# Test device is not found: filtered out by name
```python
%%there
results = Results()
ble.start_scan(filters=[DeviceNameFilter("No-such-device-8458e2e35158")])
```
```python
sleep(10)
```
```python
%%there
ble.stop_scan()
```
```python
sleep(2)
```
```python
%%there
print(results.devices)
```
# Test scan filter mathes
```python
%%there
filter_matches(EmptyFilter(), testapp)
filter_matches(EmptyFilter(), beacon)
filter_matches(EmptyFilter(), battery)
```
```python
%%there
filter_matches(DeviceAddressFilter("AA:AA:AA:AA:AA:AA"), testapp)
filter_matches(DeviceAddressFilter("AA:AA:AA:AA:AA:AB"), testapp)
try:
filter_matches(DeviceAddressFilter("AA"), testapp)
except Exception as exc:
print(exc)
```
```python
%%there
filter_matches(DeviceNameFilter("KivyBLETest"), testapp)
filter_matches(DeviceNameFilter("KivyBLETes"), testapp)
```
```python
%%there
filter_matches(ManufacturerDataFilter(0x4c, []), testapp)
filter_matches(ManufacturerDataFilter(0x4c, []), beacon)
filter_matches(ManufacturerDataFilter(0x4c, [0x2, 0x15, 0x8d, 0xa6, 0x83, 0xd6, 0xe5]), beacon)
filter_matches(ManufacturerDataFilter(0x4c, [0x2, 0x15, 0x8d, 0xa6, 0x83, 0xd6, 0xaa]), beacon)
filter_matches(
ManufacturerDataFilter(0x4c,
[0x2, 0x15, 0x8d, 0xa6, 0x83, 0xd6, 0xaa],
[0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00]),
beacon
)
filter_matches(
ManufacturerDataFilter(0x4c,
[0x2, 0x15, 0x8d, 0xa6, 0x83, 0xd6, 0xaa],
[0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]),
beacon
)
filter_matches(ManufacturerDataFilter(0x4c, [0x2, 0, 0x8d, 0xa6, 0x83], [0xff, 0, 0xff, 0xff, 0xff]), beacon)
filter_matches(ManufacturerDataFilter(0x4c, b'\x02\x15'), beacon)
filter_matches(ManufacturerDataFilter(0x4c, b'\x02\x16'), beacon)
```
```python
%%there
filter_matches(ServiceDataFilter("0000180f-0000-1000-8000-00805f9b34fb", []), battery)
filter_matches(ServiceDataFilter("0000180f-0000-1000-8000-00805f9b34fc", []), battery)
filter_matches(ServiceDataFilter("0000180f-0000-1000-8000-00805f9b34fb", [0x22]), battery)
filter_matches(ServiceDataFilter("0000180f-0000-1000-8000-00805f9b34fb", [0x21]), battery)
filter_matches(ServiceDataFilter("0000180f-0000-1000-8000-00805f9b34fb", [0x21], mask=[0xf0]), battery)
filter_matches(ServiceDataFilter("0000180f-0000-1000-8000-00805f9b34fb", [0x21], mask=[0x0f]), battery)
```
```python
%%there
filter_matches(ServiceUUIDFilter("16fe0d00-c111-11e3-b8c8-0002a5d5c51B"), testapp)
filter_matches(ServiceUUIDFilter("16fe0d00-c111-11e3-b8c8-0002a5d5c51C"), testapp)
filter_matches(ServiceUUIDFilter(
"16fe0d00-c111-11e3-b8c8-0002a5d5c51C",
"ffffffff-ffff-ffff-ffff-ffffffffffff"
), testapp)
filter_matches(ServiceUUIDFilter(
"16fe0d00-c111-11e3-b8c8-0002a5d5c51C",
"ffffffff-ffff-ffff-ffff-fffffffffff0"
), testapp)
```

View file

@ -0,0 +1,27 @@
[[setup]]
= Setup
[[run-scan_mode_low_power]]
= Run SCAN_MODE_LOW_POWER
----
True
----
[[run-scan_mode_low_latency]]
= Run SCAN_MODE_LOW_LATENCY
----
True
----
[[check-that-received-advertisement-count-is-greater-with-scan_mode_low_latency]]
= Check that received advertisement count is greater with
SCAN_MODE_LOW_LATENCY
----
True
----

View file

@ -0,0 +1,105 @@
---
jupyter:
jupytext:
formats: ipynb,md
text_representation:
extension: .md
format_name: markdown
format_version: '1.3'
jupytext_version: 1.11.2
kernelspec:
display_name: Python 3
language: python
name: python3
---
# Setup
```python
%run init.ipynb
```
```python
%%there
class BLE(BluetoothDispatcher):
def on_scan_started(self, success):
results.started = success
def on_scan_completed(self):
results.completed = 1
def on_device(self, device, rssi, advertisement):
results.devices.append(device)
def get_advertisemnt_count():
return len([dev for dev in results.devices if dev.getName() == "KivyBLETest"])
ble = BLE()
```
# Run SCAN_MODE_LOW_POWER
```python
%%there
results = Results()
ble.start_scan(
settings=ScanSettingsBuilder().setScanMode(ScanSettings.SCAN_MODE_LOW_POWER)
)
```
```python
sleep(20)
```
```python
%%there
ble.stop_scan()
```
```python
sleep(2)
```
```python
%%there
low_power_advertisement_count = get_advertisemnt_count()
print(low_power_advertisement_count > 0)
```
# Run SCAN_MODE_LOW_LATENCY
```python
%%there
results = Results()
ble.start_scan(
settings=ScanSettingsBuilder().setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
)
```
```python
sleep(20)
```
```python
%%there
ble.stop_scan()
```
```python
sleep(2)
```
```python
%%there
low_latency_advertisement_count = get_advertisemnt_count()
print(low_latency_advertisement_count > 0)
```
# Check that received advertisement count is greater with SCAN_MODE_LOW_LATENCY
```python
%%there
print(low_latency_advertisement_count - low_power_advertisement_count > 2)
```

View file

@ -0,0 +1,81 @@
import pytest
from able.adapter import (
AdapterManager,
require_bluetooth_enabled,
set_adapter_failure_rollback,
)
from able.android.dispatcher import BluetoothDispatcher
@pytest.fixture
def manager(mocker):
return AdapterManager(mocker.Mock(), ..., [])
def test_operation_executed(mocker, manager):
operation = mocker.Mock()
logger = mocker.patch("able.adapter.Logger")
manager.execute(operation)
operation.assert_called_once()
logger.exception.assert_not_called()
def test_operation_failed_as_expected(mocker, manager):
manager.check_permissions = mocker.Mock(return_value=False)
expected = Exception("expected")
operation = mocker.Mock(side_effect=expected)
logger = mocker.patch("able.adapter.Logger")
manager.execute(operation)
operation.assert_not_called()
manager.check_permissions = mocker.Mock(return_value=True)
manager.execute_operations()
operation.assert_called_once()
logger.exception.assert_called_once_with(expected)
def test_operations_executed(mocker, manager):
operations = [mocker.Mock(), mocker.Mock()]
manager.operations = operations.copy()
manager.check_permissions = mocker.Mock(return_value=False)
manager.execute_operations()
# permissions not granted = > suspended
calls = [operation.call_count for operation in manager.operations]
assert calls == [0, 0]
assert manager.operations == operations
# one more operation requested
manager.execute(next_operation := mocker.Mock())
assert [operation.call_count for operation in manager.operations] == [0, 0, 0]
assert manager.operations == operations + [next_operation]
manager.check_permissions = mocker.Mock(return_value=True)
manager.execute_operations()
assert not manager.operations
assert [operation.call_count for operation in operations + [next_operation]] == [
1,
1,
1,
]
def test_rollback_performed(mocker, manager):
handlers = [mocker.Mock(), mocker.Mock()]
operations = [mocker.Mock(), mocker.Mock()]
manager.operations = operations.copy()
manager.rollback_handlers = handlers.copy()
manager.rollback()
assert not manager.rollback_handlers
assert not manager.operations
assert [operation.call_count for operation in operations] == [0, 0]
assert [operation.call_count for operation in handlers] == [1, 1]

View file

@ -0,0 +1,34 @@
import unittest
import mock
from able.queue import ble_task
class TestBLETask(unittest.TestCase):
def setUp(self):
self.queue = mock.Mock()
self.task_called = None
@ble_task
def increment(self, a=1, b=0):
self.task_called = a + b
def test_method_not_executed(self):
self.increment()
self.assertEqual(self.task_called, None)
def test_task_enqued(self):
self.increment()
self.assertTrue(self.queue.enque.called)
def test_task_default_arguments(self):
self.increment()
task = self.queue.enque.call_args[0][0]
task()
self.assertEqual(self.task_called, 1)
def test_task_arguments_passed(self):
self.increment(200, 11)
task = self.queue.enque.call_args[0][0]
task()
self.assertEqual(self.task_called, 211)

View file

@ -0,0 +1,47 @@
import pytest
from able.android.dispatcher import BluetoothDispatcher
@pytest.fixture
def ble(mocker):
mocker.patch("able.android.dispatcher.PythonBluetooth")
ble = BluetoothDispatcher()
ble._ble = mocker.Mock()
ble.on_scan_started = mocker.Mock()
return ble
def test_adapter_returned(mocker, ble):
manager = ble._adapter_manager
manager.check_permissions = mocker.Mock(return_value=False)
assert not ble.adapter
assert not ble.adapter
manager.check_permissions = mocker.Mock(return_value=True)
assert ble.adapter
def test_start_scan_executed(ble):
manager = ble._adapter_manager
assert manager
ble.start_scan()
ble._ble.startScan.assert_called_once()
def test_start_scan_failed_as_expected(mocker, ble):
manager = ble._adapter_manager
manager.check_permissions = mocker.Mock(return_value=False)
ble.start_scan()
ble._ble.startScan.assert_not_called()
assert len(manager.operations) == 1
assert len(manager.rollback_handlers) == 1
manager.on_runtime_permissions(permissions=[...], grant_results=[False])
ble.on_scan_started.assert_called_once_with(success=False)
assert len(manager.operations) == 0
assert len(manager.rollback_handlers) == 0

View file

@ -0,0 +1,50 @@
import pytest
import able.filters as filters
@pytest.fixture
def java_builder(mocker):
instance = mocker.Mock()
mocker.patch("able.filters.ScanFilterBuilder", return_value=instance)
return instance
def test_filter_builded(java_builder):
filters.Filter().build()
assert java_builder.build.call_count == 1
def test_builder_method_called(java_builder):
f = filters.DeviceNameFilter("test")
f.build()
assert java_builder.method_calls == [
("setDeviceName", ("test",)),
("build", )
]
def test_filters_combined(java_builder):
f = filters.DeviceNameFilter("test") & (
filters.DeviceAddressFilter("AA:AA:AA:AA:AA:AA") &
filters.ManufacturerDataFilter("test-id", [1, 2, 3])
)
f.build()
assert java_builder.method_calls == [
("setDeviceName", ("test",)),
("setDeviceAddress", ("AA:AA:AA:AA:AA:AA",)),
("setManufacturerData", ("test-id", [1, 2, 3])),
("build", )
]
def test_combine_same_type_exception(java_builder):
with pytest.raises(ValueError, match="cannot combine filters of the same type"):
f = filters.DeviceNameFilter("test") & (
filters.DeviceAddressFilter("AA:AA:AA:AA:AA:AA") &
filters.DeviceNameFilter("test2")
)

View file

@ -0,0 +1,30 @@
from pathlib import Path
import pytest
@pytest.fixture
def parser(mocker):
mocker.patch("setuptools.setup")
from setup import PathParser
return PathParser()
@pytest.mark.parametrize(
("cppflags", "expected"),
[
(
"-I/media/able/examples/alert/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/alert_mi/",
"/media/able/examples/alert/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/javaclasses/alert_mi",
),
(
"-DANDROID -I/home/user/.buildozer/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/media/able/examples/alert/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/alert_mi/arm64-v8a/include/python3.9",
"/media/able/examples/alert/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/javaclasses/alert_mi",
),
],
)
def test_javaclass_dir_found(mocker, parser, cppflags, expected):
mocker.patch("os.environ", {"CPPFLAGS": cppflags})
mocker.patch("pathlib.Path.exists", return_value=True)
mocker.patch("pathlib.Path.mkdir")
assert parser.javaclass_dir == Path(expected)

BIN
libs/arm64/libcodec2.so Executable file

Binary file not shown.

BIN
libs/armeabi/libcodec2.so Executable file

Binary file not shown.

1
main.py Normal file
View file

@ -0,0 +1 @@
import sbapp.main

View file

@ -0,0 +1,37 @@
"""
Android Bluetooth Low Energy
"""
from pythonforandroid.recipe import PythonRecipe
from pythonforandroid.toolchain import current_directory, info, shprint
import sh
from os.path import join
class AbleRecipe(PythonRecipe):
name = 'able_recipe'
depends = ['python3', 'setuptools', 'android']
call_hostpython_via_targetpython = False
install_in_hostpython = True
def prepare_build_dir(self, arch):
build_dir = self.get_build_dir(arch)
assert build_dir.endswith(self.name)
shprint(sh.rm, '-rf', build_dir)
shprint(sh.mkdir, build_dir)
srcs = ('../../libs/able/able', 'setup.py')
for filename in srcs:
print(f"Copy {join(self.get_recipe_dir(), filename)} to {build_dir}")
shprint(sh.cp, '-a', join(self.get_recipe_dir(), filename),
build_dir)
def postbuild_arch(self, arch):
super(AbleRecipe, self).postbuild_arch(arch)
info('Copying able java class to classes build dir')
with current_directory(self.get_build_dir(arch.arch)):
shprint(sh.cp, '-a', join('able', 'src', 'org'),
self.ctx.javaclass_dir)
recipe = AbleRecipe()

View file

@ -0,0 +1,9 @@
from setuptools import setup
setup(
name='able',
version='0.0.0',
packages=['able', 'able.android'],
description='Bluetooth Low Energy for Android',
license='MIT',
)

View file

@ -0,0 +1,51 @@
from os.path import join
from pythonforandroid.recipe import Recipe
from pythonforandroid.toolchain import current_directory, shprint
import sh
import os
# For debugging, clean with
# buildozer android p4a -- clean_recipe_build codec2 --local-recipes ~/Information/Source/Sideband/recipes
class Codec2Recipe(Recipe):
url = "https://github.com/markqvist/codec2/archive/00e01c9d72d3b1607e165c71c4c9c942d277dfac.tar.gz"
built_libraries = {'libcodec2.so': 'build_android/src'}
def include_flags(self, arch):
'''Returns a string with the include folders'''
codec2_includes = join(self.get_build_dir(arch.arch), 'build_android')
return (' -I' + codec2_includes)
def link_dirs_flags(self, arch):
'''Returns a string with the appropriate `-L<lib directory>` to link
with the libs. This string is usually added to the environment
variable `LDFLAGS`'''
return ' -L' + self.get_build_dir(arch.arch)
# def link_libs_flags(self):
# '''Returns a string with the appropriate `-l<lib>` flags to link with
# the libs. This string is usually added to the environment
# variable `LIBS`'''
# return ' -lcodec2{version} -lssl{version}'.format(version=self.version)
def build_arch(self, arch):
with current_directory(self.get_build_dir(arch.arch)):
env = self.get_recipe_env(arch)
flags = [
"..",
"--log-level=TRACE",
"--fresh",
"-DCMAKE_BUILD_TYPE=Release",
]
mkdir = sh.mkdir("-p", "build_android")
# cd = sh.cd("build_android")
os.chdir("build_android")
cmake = sh.Command('cmake')
shprint(cmake, *flags, _env=env)
shprint(sh.make, _env=env)
sh.cp("../src/codec2.h", "./codec2/")
recipe = Codec2Recipe()

BIN
recipes/codec2/generate_codebook Executable file

Binary file not shown.

View file

@ -0,0 +1,14 @@
from pythonforandroid.recipe import CompiledComponentsPythonRecipe
class CythonRecipe(CompiledComponentsPythonRecipe):
version = '3.1.6'
url = 'https://github.com/cython/cython/archive/{version}.tar.gz'
site_packages_name = 'cython'
depends = ['setuptools']
call_hostpython_via_targetpython = False
install_in_hostpython = True
recipe = CythonRecipe()

View file

@ -0,0 +1,175 @@
import sh
import os
from multiprocessing import cpu_count
from pathlib import Path
from os.path import join
from packaging.version import Version
from pythonforandroid.logger import shprint
from pythonforandroid.recipe import Recipe
from pythonforandroid.util import (
BuildInterruptingException,
current_directory,
ensure_dir,
)
from pythonforandroid.prerequisites import OpenSSLPrerequisite
HOSTPYTHON_VERSION_UNSET_MESSAGE = (
'The hostpython recipe must have set version'
)
SETUP_DIST_NOT_FIND_MESSAGE = (
'Could not find Setup.dist or Setup in Python build'
)
class HostPython3Recipe(Recipe):
'''
The hostpython3's recipe.
.. versionchanged:: 2019.10.06.post0
Refactored from deleted class ``python.HostPythonRecipe`` into here.
.. versionchanged:: 0.6.0
Refactored into the new class
:class:`~pythonforandroid.python.HostPythonRecipe`
'''
version = '3.11.5'
name = 'hostpython3'
build_subdir = 'native-build'
'''Specify the sub build directory for the hostpython3 recipe. Defaults
to ``native-build``.'''
url = 'https://www.python.org/ftp/python/{version}/Python-{version}.tgz'
'''The default url to download our host python recipe. This url will
change depending on the python version set in attribute :attr:`version`.'''
patches = ['patches/pyconfig_detection.patch']
@property
def _exe_name(self):
'''
Returns the name of the python executable depending on the version.
'''
if not self.version:
raise BuildInterruptingException(HOSTPYTHON_VERSION_UNSET_MESSAGE)
return f'python{self.version.split(".")[0]}'
@property
def python_exe(self):
'''Returns the full path of the hostpython executable.'''
return join(self.get_path_to_python(), self._exe_name)
def get_recipe_env(self, arch=None):
env = os.environ.copy()
openssl_prereq = OpenSSLPrerequisite()
if env.get("PKG_CONFIG_PATH", ""):
env["PKG_CONFIG_PATH"] = os.pathsep.join(
[openssl_prereq.pkg_config_location, env["PKG_CONFIG_PATH"]]
)
else:
env["PKG_CONFIG_PATH"] = openssl_prereq.pkg_config_location
return env
def should_build(self, arch):
if Path(self.python_exe).exists():
# no need to build, but we must set hostpython for our Context
self.ctx.hostpython = self.python_exe
return False
return True
def get_build_container_dir(self, arch=None):
choices = self.check_recipe_choices()
dir_name = '-'.join([self.name] + choices)
return join(self.ctx.build_dir, 'other_builds', dir_name, 'desktop')
def get_build_dir(self, arch=None):
'''
.. note:: Unlike other recipes, the hostpython build dir doesn't
depend on the target arch
'''
return join(self.get_build_container_dir(), self.name)
def get_path_to_python(self):
return join(self.get_build_dir(), self.build_subdir)
@property
def site_root(self):
return join(self.get_path_to_python(), "root")
@property
def site_bin(self):
return join(self.site_root, self.site_dir, "bin")
@property
def local_bin(self):
return join(self.site_root, "usr/local/bin/")
@property
def site_dir(self):
p_version = Version(self.version)
return join(
self.site_root,
f"usr/local/lib/python{p_version.major}.{p_version.minor}/site-packages/"
)
def build_arch(self, arch):
env = self.get_recipe_env(arch)
recipe_build_dir = self.get_build_dir(arch.arch)
# Create a subdirectory to actually perform the build
build_dir = join(recipe_build_dir, self.build_subdir)
ensure_dir(build_dir)
# Configure the build
build_configured = False
with current_directory(build_dir):
if not Path('config.status').exists():
shprint(sh.Command(join(recipe_build_dir, 'configure')), _env=env)
build_configured = True
with current_directory(recipe_build_dir):
# Create the Setup file. This copying from Setup.dist is
# the normal and expected procedure before Python 3.8, but
# after this the file with default options is already named "Setup"
setup_dist_location = join('Modules', 'Setup.dist')
if Path(setup_dist_location).exists():
shprint(sh.cp, setup_dist_location,
join(build_dir, 'Modules', 'Setup'))
else:
# Check the expected file does exist
setup_location = join('Modules', 'Setup')
if not Path(setup_location).exists():
raise BuildInterruptingException(
SETUP_DIST_NOT_FIND_MESSAGE
)
shprint(sh.make, '-j', str(cpu_count()), '-C', build_dir, _env=env)
# make a copy of the python executable giving it the name we want,
# because we got different python's executable names depending on
# the fs being case-insensitive (Mac OS X, Cygwin...) or
# case-sensitive (linux)...so this way we will have an unique name
# for our hostpython, regarding the used fs
for exe_name in ['python.exe', 'python']:
exe = join(self.get_path_to_python(), exe_name)
if Path(exe).is_file():
shprint(sh.cp, exe, self.python_exe)
break
ensure_dir(self.site_root)
self.ctx.hostpython = self.python_exe
if build_configured:
print("RUNNING ENSUREPIP:"+self.site_root)
shprint(
sh.Command(self.python_exe), "-m", "ensurepip", "--root", self.site_root, "-U",
_env={"HOME": "/tmp"}
)
print("RAN ENSUREPIP")
recipe = HostPython3Recipe()

View file

@ -0,0 +1,13 @@
diff -Nru Python-3.8.2/Lib/site.py Python-3.8.2-new/Lib/site.py
--- Python-3.8.2/Lib/site.py 2020-04-28 12:48:38.000000000 -0700
+++ Python-3.8.2-new/Lib/site.py 2020-04-28 12:52:46.000000000 -0700
@@ -487,7 +487,8 @@
if key == 'include-system-site-packages':
system_site = value.lower()
elif key == 'home':
- sys._home = value
+ # this is breaking pyconfig.h path detection with venv
+ print('Ignoring "sys._home = value" override', file=sys.stderr)
sys.prefix = sys.exec_prefix = site_prefix

Some files were not shown because too many files have changed in this diff Show more