Commit Graph
18 Commits
Author SHA1 Message Date
DeFiDude 83b88146f4 transport: discover paths for roaming interfaces 2026-06-26 16:10:52 -06:00
Chad Attermann 4d6f0b9de2 Added dual-class PSRAM/TLSF allocator system and refactored memory management
Introduces a flexible two-class allocator architecture (RNS_DEFAULT_ALLOCATOR and RNS_CONTAINER_ALLOCATOR) supporting heap, PSRAM, and TLSF pool variants for fine-grained control over embedded memory layout.

- New Memory.h/cpp with ContainerAllocator<T>, heap/PSRAM/pool allocator types, and heap stats reporting
- IdentityTable and PathTable now use ContainerAllocator
- Replaced RNS_USE_TLSF/RNS_USE_ALLOCATOR/RNS_USE_PSRAM flags with per-class allocator flags (RNS_DEFAULT_ALLOCATOR, RNS_CONTAINER_ALLOCATOR)
- Added ESP32 PSRAM allocator support (RNS_PSRAM_ALLOCATOR, RNS_PSRAM_POOL_ALLOCATOR)
- Added Transport::get_path()/remove_path() helpers
- Added loop callback (set_loop_callback) to enable more responsive app during long operations (like clean_cache)
- Aded guard against re-entrancy to clean_cache()
- Added callback option to list_directory() to avoid heap allocation
- Added OOM auto-restart (ESP.restart/NVIC_SystemReset) in Interface send/receive and Reticulum loop.
- Renamed setLogCallback to set_log_callback
- Made Link/Identity static members private
- Added native14 env to CI and platformio.ini
- Bumped version to 0.2.10
2026-03-06 16:43:04 -07:00
Chad Attermann 49ccbc2827 Major bug fixes and performance enhancements
- Fixed bug in path table loading from flash storage wherein the raw
(packed) announce packet associated with each path entry was not being
unpacked prior to use.
- Fixed bug in path table entry announce packet loading where critical
changes to the announce packet (like hops increment) was being
overwriteen each time packet was re-loaded from cache.
- Optimized path table entries to lazy-load both announce packet and
receive interface so that memory is consumed by these structures until
if/when the path is actually used.
- Updated several global timers and sizes to match new RNS 1.x values.
- Bumped version to 0.2.9
2026-03-03 17:53:06 -07:00
Chad Attermann 79b75bbd4e Replace string-concatenation logging with printf-style F-variants
Converted log calls across src/, examples/, and test/ to use DEBUGF/TRACEF/ERRORF/etc. macros instead of std::string + operator+. This eliminates temporary heap allocations on every log call, which matters on memory-constrained MCUs.
2026-03-01 10:59:33 -07:00
Chad Attermann 11155b5829 WIP: Completed but un-tested port of Link.
Link is now mostly ported from Python but as of yet un-tested.
Refactored Interface.
Orgnanized example apps.
2025-08-21 17:29:26 -06:00
Chad Attermann fcfda66365 WIP: General improvements in persistence efficiency 2024-08-14 21:59:23 -06:00
Chad Attermann 3af5111606 WIP: Logging optimizations and memory management
Changed a few key logs to use printf-style instead of string
concatenation to avoid dynamic memory allocation. Still need to move
all remaining logging over to printf-style.

Added option (-DRNS_USE_ALLOCATOR=1) to override new/delete operators for
both allocation metrics and the ability to implement an alternate memory
allocator.

Added option (-DRNS_USE_TLSF=1) to use the alternate TLSF allocator
(must also define RNS_USE_ALLOCATOR). This allocator is well known for
reducing fragmentation and providing constant, O(1)-time allocation
and deallocation for real-time embedded systems.

This TLSF allocator appears to already be the default allocator for
ESP32 boards, but the allocator used by NRF52 is unknown at this time so
the TLSF allocator internal to microReticulum is only being used for
NRF52 boards at this time.

Future memory management improvements will include custom allocators for
long-lived structures like the path table that will segregate them from
the general pool of memory that is constantly cycling, thereby further
reducing fragmentation. It will also allow these structures to use
alternate memory like PSRAM present on T-Beam boards.
2024-07-16 10:40:46 -06:00
Chad Attermann bef8dbc1b0 WIP: Stable memory and flash with limited paths 2024-07-03 06:55:06 -06:00
Chad Attermann 518db13ec8 WIP: Switched to macros for build control of logs 2024-07-01 20:25:46 -06:00
attermann 7aac0f4355 WIP: Additional work on transport node support
Added processing for LINKREQUEST and PROOF in Transport. This is
expected to enable transport and repeating of these packets, but support
for local Link and Resources is yet to be implemented.
2023-12-15 09:27:18 -07:00
attermann 162dcff6cd WIP: Continued work of persistence and refactoring 2023-12-11 13:42:20 -07:00
attermann f9a679ffc2 WIP: Initial implementation of persistence
Persistence implemented with the help of the ArduinoJson library using
MessagePack format.
2023-12-05 11:06:49 -07:00
attermann c39e9e7fee WIP: Fixed archictectural flaw with Interfaces
Fixed packet transmit issue caused by fundamental issue of attempting to
send on a copy of an interface which is not properly associated with the
actual method overrides of the derived class (the interface
implementation).
Fix was to use methods in the Object data to callback to the original
(implementation) instance of the object.
General clean-up to remove some early testing code.
2023-12-03 16:43:53 -07:00
attermann 642486ac7e WIP: Fixes, optimizations, and more Transport
Changed all time references to use decimal seconds to match Python
reference implementation.
Fixed memory issues caused by storing references to objects instead of
copies.
More implementation of Transport logic.
This is the first build that fully implements end-to-end path finding
and routing.
2023-12-02 08:52:45 -07:00
attermann ea7b4603ed WIP: Added super basic UDP interface for testing
Basic UDP interface enabled testing with RNS reference implementation.
Added to basic Transport implementation.
2023-11-26 18:10:46 -07:00
attermann 263f589801 WIP: Refactor pointer/reference style. 2023-11-20 10:51:56 -07:00
attermann d09331ec0e WIP: Optimizations with reference return types. 2023-11-20 10:26:14 -07:00
attermann 9f1602067d WIP: More refactoring to reduce need for headers 2023-11-19 13:17:42 -07:00