Commit graph

291 commits

Author SHA1 Message Date
torlando-tech
921dce2dba test: add comprehensive tests for interface cleanup methods
Add test coverage for new BLEInterface cleanup functionality:
- _cleanup_pending_identity_connections: timeout handling for non-Reticulum devices
- _process_pending_detaches: delayed interface detachment with grace period
- _validate_spawned_interfaces: orphaned interface cleanup
- Multi-address disconnect handling (keeping interface alive for MAC rotation)
- Thread-safe _spawn_peer_interface with locking
- Central disconnect callback with address fallback

These tests cover the 195 lines of new code in BLEInterface.py to improve
patch coverage for PR #35.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 19:32:17 -05:00
torlando-tech
5947544cd7 test: fix test suite for BLE interface changes
- Fix mock_ble_driver.py import path (src/RNS/Interfaces -> src/ble_reticulum)
- Add address_to_interface, _pending_detach, _pending_detach_grace_period to test fixture
- Update test_identity_cache to expect grace period behavior (deferred cleanup)
- Update test_v2_2_mac_sorting to use renamed _cleanup_stale_address function

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 14:03:59 -05:00
torlando-tech
c76cfc1dd0 fix(ble): prevent interface/fragmenter loss during MAC rotation
- Rewrite _validate_spawned_interfaces() with 3-pass approach:
  - Pass 1: Collect orphaned addresses
  - Pass 2: Clean up address mappings, track interfaces to detach
  - Pass 3: Only detach interfaces with zero connected addresses
  - Fragmenters only cleaned up when interface fully detached

- Enhance _spawn_peer_interface() reuse logic:
  - Update address_to_identity and identity_to_address when reusing
  - Cancel pending detach for the identity
  - Mark interface as online

- Fix disconnect callbacks to preserve fragmenters:
  - _device_disconnected_callback: defer fragmenter cleanup to grace period
  - handle_central_disconnected: same fragmenter preservation
  - _process_pending_detaches: clean up fragmenters on actual detach

- Rename _cleanup_stale_interface() to _cleanup_stale_address():
  - No longer detaches interface during MAC rotation
  - Only cleans up stale address-specific mappings
  - Interface preserved for reuse with new address

Fixes orphaned peer interfaces and "No fragmenter for peer" warnings
during BLE MAC address rotation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 13:31:48 -05:00
torlando-tech
f21382acd5 fix: add identity handshake timeout for non-Reticulum connections
Connections from non-Reticulum BLE devices (AirTags, BLE scanners, etc.)
that connect to our GATT server but never complete the identity handshake
are now automatically disconnected after 30 seconds.

Changes:
- Track pending identity connections with timestamps in _pending_identity_connections
- Add _cleanup_pending_identity_connections() to disconnect stale connections
- Remove from pending tracking when identity is provided in callback
- Add debug logging for cleanup timer operations

This prevents non-protocol devices from appearing indefinitely in the
BLE connections list.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 22:57:36 -05:00
torlando-tech
ed625d4f0f fix: add address-based fallback for peer interface cleanup
BLE peer interfaces weren't being cleaned up when connections dropped
if the identity-to-address mapping wasn't available at disconnect time.
This caused orphaned interfaces to persist (peer interfaces shown with
zero active connections).

Changes:
- Add address_to_interface mapping for direct address-based cleanup
- Update _device_disconnected_callback with dual-index approach:
  try identity lookup first, fall back to address_to_interface
- Update handle_central_disconnected with same dual-index approach
- Add _validate_spawned_interfaces() periodic validation (every 30s)
  that cross-checks interfaces against driver.connected_peers
- Update _cleanup_stale_interface and _address_changed_callback to
  maintain the new mapping
- Clear address_to_interface on detach()

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 17:34:07 -05:00
Torlando
1682c25c04
Merge pull request #34 from torlando-tech/fix/identity-cache-on-disconnect
fix: add identity cache to prevent data loss on reconnection
2025-12-30 16:08:50 -05:00
torlando-tech
e30a73fd1b fix: patch RNS.log in BLEInterface module's namespace
The previous patch changed RNS.log in the test's namespace, but
BLEInterface.py imports RNS at module load time. To capture log
calls from _address_changed_callback(), we need to patch RNS.log
where it's used: ble_reticulum.BLEInterface.RNS.log

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 14:59:28 -05:00
torlando-tech
cb473b8704 fix: patch RNS.log at module level in address_changed test
The test was using mock_rns.log.assert_called() but the real
BLEInterface code calls the actual RNS.log function, not the mock.

Fixed by patching RNS.log at module level to capture actual log calls,
then asserting the "no identity found" warning was logged.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 14:50:27 -05:00
torlando-tech
b5518e3799 test: comprehensive integration tests for identity cache
Add 14 tests that exercise the REAL BLEInterface code:

- TestIdentityCacheOnDisconnect: verify caching on disconnect
- TestIdentityCacheOnDataReceive: verify cache restoration on data
- TestAddressChangedCallback: verify address migration
- TestCacheTTL: verify 60-second TTL behavior
- TestReassemblyCodePath: verify cache in reassembly path
- TestEdgeCases: concurrent access, multiple disconnects

Tests skip locally if RNS not installed but run in CI to provide
actual line coverage on the identity cache changes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 14:20:29 -05:00
torlando-tech
d332f9a9bb test: add integration tests that exercise real BLEInterface code
Add TestIdentityCacheIntegration class that imports and tests actual
BLEInterface methods instead of just mocking the logic. This should
provide codecov coverage on the changed lines.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 14:14:50 -05:00
torlando-tech
b1206b3c6e fix: configure codecov token and coverage paths
- Add CODECOV_TOKEN to codecov-action uploads (required for v4)
- Change unit test coverage from single file to entire package
- Add codecov.yml with coverage thresholds and flags

Note: CODECOV_TOKEN secret must be added to repository settings.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 14:07:24 -05:00
torlando-tech
d576dcce50 test: add unit tests for identity cache feature
Add comprehensive tests for:
- Identity caching on disconnect (60s TTL)
- Cache retrieval when data arrives from unknown peer
- Cache expiry after TTL
- Address change callback for dual connection deduplication
- Driver identity resync fallback

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 13:56:58 -05:00
torlando-tech
46299f3147 fix: add identity cache to prevent data loss on reconnection
When Python's disconnect callback fires but the driver layer (Android/Kotlin)
maintains or quickly re-establishes the GATT connection, data was being
dropped because address_to_identity was cleared.

Changes:
- Add _identity_cache with 60-second TTL to preserve identities after disconnect
- Cache identity in _device_disconnected_callback before cleanup
- Check cache in _handle_ble_data and restore identity if found
- Add on_address_changed callback for dual connection deduplication
- Add _address_changed_callback to migrate identity mappings
- Support driver.request_identity_resync() for fallback recovery

This fixes the "no identity for peer X, dropping data" warning that occurred
when the Python layer lost track of a peer that was still connected at the
driver level.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 12:38:08 -05:00
Torlando
3b3450ab78
Merge pull request #33 from torlando-tech/refactor/package-namespace
refactor: rename package from RNS.Interfaces to ble_reticulum
2025-12-30 00:15:30 -05:00
torlando-tech
b1f57fa658 fix: clean up workflow YAML formatting
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 23:59:23 -05:00
torlando-tech
463383dc39 fix: update paths in installer, tests, and workflows for package rename
- Update install.sh to copy from src/ble_reticulum/
- Update test files with new source paths
- Update GitHub workflows for new package structure
- Remove temporary refactoring helper scripts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 23:58:18 -05:00
torlando-tech
ca88c6b4c9 fix: restore RNS.Interfaces.Interface import for base class
The sed replacement was too aggressive - it replaced the import for
the base Interface class from the Reticulum package itself.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 23:38:21 -05:00
torlando-tech
2fbb9c3ad2 refactor: rename package from RNS.Interfaces to ble_reticulum
Fixes namespace collision with Reticulum's own RNS.Interfaces package.
When both packages were installed, the collision caused import issues
and prevented BLE discovery between devices.

Changes:
- Rename src/RNS/Interfaces/ to src/ble_reticulum/
- Update pyproject.toml package configuration
- Update all imports in source and test files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 23:30:07 -05:00
torlando-tech
bbeb6c43e8 Merge branch 'main' of github-public:torlando-tech/ble-reticulum 2025-12-29 23:26:51 -05:00
Torlando
507d81a83e
Merge pull request #32 from torlando-tech/fix/identity-hash-double-hashing-v2
fix: remove double-hashing in _compute_identity_hash()
2025-12-29 23:00:52 -05:00
torlando-tech
942cbe05f1 test: add unit tests for _compute_identity_hash() fix
Adds 4 tests to verify the double-hashing bug is fixed:
- test_identity_hash_returns_hex_of_input: verifies correct hex output
- test_identity_hash_does_not_double_hash: proves fix differs from buggy code
- test_identity_hash_with_various_inputs: tests multiple byte patterns
- test_actual_bleinterface_implementation: verifies source code contains fix

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 22:43:37 -05:00
torlando-tech
0b946a804d fix: remove double-hashing in _compute_identity_hash()
The peer_identity parameter is already the identity hash received from
the BLE handshake. Calling RNS.Identity.full_hash() on it again produced
a completely different value, causing identity mismatch between peers.

This caused "no reassembler for X" errors because the sending peer's
identity didn't match what the receiving peer computed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 22:13:42 -05:00
Torlando
d475432cb0
fix(ble): Event-driven D-Bus monitoring to eliminate HCI errors on BCM43xx chips (#30)
* fix(ble): Increase D-Bus monitoring intervals to prevent HCI errors

The D-Bus monitoring threads were polling too frequently (0.5s and 30s),
causing HCI command collisions on BCM43xx single-radio chips. These chips
cannot handle concurrent BLE operations, and the frequent D-Bus activity
was interfering with scan/advertise cycles.

Changes:
- Increase D-Bus disconnect monitor interval from 0.5s to 5s
- Increase stale connection poll interval from 30s to 120s

This eliminates HCI errors (Opcode 0x2005/0x2006) while preserving
disconnect detection functionality with slightly higher latency.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor(ble): Convert D-Bus monitoring to event-driven approach

Replace polling-based D-Bus monitoring with true event-driven pattern:

1. D-Bus monitor thread:
   - Use asyncio.Event instead of periodic sleep
   - Store loop reference for thread-safe shutdown
   - Use call_soon_threadsafe to wake loop on stop

2. Stale poll thread:
   - Replace busy-wait loop (240 x 0.5s) with single Event.wait()
   - Increase interval from 120s to 300s (safety net only)
   - Immediate response to stop signal

Benefits:
- Zero CPU usage while waiting (no periodic wakeups)
- Immediate shutdown response (ms instead of 5s)
- Cleaner, simpler code
- Maintains disconnect detection via D-Bus signals

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test(ble): Add comprehensive unit tests for HCI error fixes

Add 26 new unit tests for the event-driven D-Bus monitoring fixes
that eliminated HCI errors on BCM43xx single-radio chips.

Test coverage:
- TestEventDrivenDBusMonitor: Tests asyncio.Event usage, immediate
  wake response, call_soon_threadsafe cross-thread signaling
- TestStalePollImprovements: Tests threading.Event.wait() usage,
  300s interval, immediate stop response
- TestStopShutdownBehavior: Tests stop() async signaling, RuntimeError
  handling, shutdown latency improvement
- TestIntegrationScenarios: Tests full lifecycle, multiple stop calls
- TestCodeVerification: Verifies actual source patterns match expected

All 26 tests pass without requiring pytest-asyncio plugin.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(tests): Use threading.RLock instead of asyncio.Lock in test fixtures

In Python 3.8/3.9, asyncio.Lock() requires a running event loop. When
test_hci_error_fixes.py runs first (alphabetically) and uses asyncio.run(),
it closes the event loop after each test. Subsequent test fixtures that
create asyncio.Lock() then fail with "no current event loop" errors.

Since these are mock fixtures that don't need async semantics, use
threading.RLock() instead.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(tests): Replace all asyncio.Lock() with threading.RLock() in test mocks

asyncio.Lock() requires a running event loop in Python 3.8/3.9. When
test files using asyncio.run() execute first, the event loop is closed,
causing subsequent test fixtures to fail when creating asyncio.Lock().

Fixed in:
- test_peripheral_disconnect_cleanup.py (mock_gatt_server fixture)
- test_bluez_state_cleanup.py (mock_driver fixture)
- test_ble_peer_interface.py (create_mock_peer_interface helper)
- conftest.py (create_mock_interface helper)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: torlando-tech <torlando-tech@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 00:46:06 -05:00
Torlando
d8c76df20f
Merge pull request #29 from torlando-tech/fix/cleanup-stale-interface-memory-leak
fix(ble): Clean up address_to_identity in _cleanup_stale_interface()
2025-12-28 23:01:27 -05:00
torlando-tech
0c80f4f100 fix(ble): Clean up address_to_identity in _cleanup_stale_interface()
The _cleanup_stale_interface() method was cleaning up identity_to_address
but not the reverse mapping address_to_identity. This caused:
- Memory leak: stale entries accumulate over time
- Inconsistent state: bidirectional mappings become out of sync

This fix matches the cleanup pattern in _disconnected_callback() which
properly cleans up both directions of the mapping.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 23:47:17 -05:00
torlando-tech
254da2e0f4 fix(install): Use proper wheel filename for pre-built dbus_fast
pip extracts package metadata from the wheel filename, which must follow
PEP 427 format: {package}-{version}-{pythontag}-{abi}-{platform}.whl

The previous filename (dbus_fast-armv6l-$$.whl) caused pip to fail with
"Invalid wheel filename (wrong number of parts)" on 32-bit ARM systems.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 22:34:24 -05:00
torlando-tech
c262c1a5c2 feat(install): Add uv tool installation support
Detect and handle RNS installations via `uv tool install rns`:
- Add uv detection when python3 can import RNS (path contains /uv/tools/)
- Add shebang-based detection when system python3 differs from tool's python
- Install dependencies using `uv pip install --python`
- Handle uv Python path for setcap Bluetooth permissions

This fixes "Could not determine installation mode" errors for users
who install Reticulum with uv instead of pip/pipx.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 15:44:34 -05:00
Torlando
54ee4048e0
Merge pull request #25 from torlando-tech/release/v0.2.2
Some checks failed
Release / Validate Release (push) Has been cancelled
Release / Run Tests (push) Has been cancelled
Release / Run Tests-1 (push) Has been cancelled
Release / Run Tests-2 (push) Has been cancelled
Release / Run Tests-3 (push) Has been cancelled
Release / Build Release Artifacts (push) Has been cancelled
Release / Create GitHub Release (push) Has been cancelled
v0.2.2
Release v0.2.2
2025-12-17 23:58:31 -05:00
torlando-tech
bee68879af Merge main into release/v0.2.2
Resolved conflicts:
- BLEInterface.py, test_v2_2_mac_sorting.py, CLAUDE.md: Keep release
  (HW_MTU fix, pending_mtu, MAC rotation recovery/bypass, corrected tests)
- install.sh, README.md: Keep main (JustWorksRepairing auto-configuration)
- CHANGELOG.md: Consolidated detailed notes from main into [0.2.2] section
- Added FUNDING.yml from main

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 23:37:22 -05:00
torlando-tech
a1e3d47506 test(ble): Add MAC rotation bypass tests and fix existing test expectations
- Add TestMACRotationBypassesSorting class with 4 tests for the MAC rotation fix
- Fix MockInterface to properly mock RNS.Interfaces.Interface module
- Add get_config_obj() to MockInterface for BLEInterface initialization
- Fix inverted test expectations in test_sequential_mac_addresses and
  test_mac_sorting_with_multiple_peers (lower MAC initiates connection)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 12:33:06 -05:00
torlando-tech
564b2be07e fix(ble): Bypass MAC sorting after MAC rotation cleanup
After detecting MAC rotation and cleaning up the stale interface,
immediately add the peer to scored_peers and continue, bypassing
the MAC sorting check. This ensures reconnection always happens
after MAC rotation regardless of which device has the higher MAC.

Bug: After MAC rotation, peer interface wasn't recreated because
the code fell through to MAC sorting check which could skip the
peer if local MAC > peer MAC.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 12:22:47 -05:00
torlando-tech
f7bb63562a Merge pull request #28 from torlando-tech/fix/hw-mtu-and-mac-rotation
Fix/hw mtu and mac rotation
2025-11-26 18:04:48 -05:00
torlando-tech
0f14264b18 Revert "feat(install): Add JustWorksRepairing and GATT cache configuration"
This reverts commit 4f9df43033.
2025-11-26 18:00:22 -05:00
torlando-tech
4f9df43033 feat(install): Add JustWorksRepairing and GATT cache configuration
- Enable JustWorksRepairing = always for automatic BLE pairing
- Disable GATT caching (Cache = no) to prevent Service Changed
  subscription pairing prompts on Android 15+ devices
- Track config changes and only restart BlueZ when needed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 17:52:52 -05:00
torlando-tech
64a4e2e43b Merge pull request #27 from torlando-tech/fix/hw-mtu-and-mac-rotation
fix(ble): Prevent data loss from peripheral reassembler race condition
2025-11-26 12:22:59 -05:00
torlando-tech
12eafcdffc fix(ble): Prevent data loss from peripheral reassembler race condition
Reorder operations in handle_peripheral_data() to create
fragmenter/reassembler BEFORE spawning peer interface. This
prevents data from being dropped during the brief window when
the interface exists but the reassembler doesn't.

Also adds unit tests to verify the fix and prevent regression.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 12:21:42 -05:00
torlando-tech
b0246e320b fix(ble): Prevent data loss from peripheral reassembler race condition
Reorder operations in handle_peripheral_data() to create
fragmenter/reassembler BEFORE spawning peer interface. This
prevents data from being dropped during the brief window when
the interface exists but the reassembler doesn't.

Also adds unit tests to verify the fix and prevent regression.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 12:21:42 -05:00
torlando-tech
4ed1f1d03a Merge pull request #26 from torlando-tech/fix/hw-mtu-and-race-conditions
Fix/hw mtu and race conditions
2025-11-25 18:29:38 -05:00
torlando-tech
2663764cf4 fix: Add MAC rotation recovery for stale interface cleanup
When a peer reconnects from a new MAC address (common with Android MAC
rotation, also possible on Linux after adapter reset), the old interface
state may become stale. This change adds:

1. _cleanup_stale_interface() method:
   - Detaches old interface
   - Cleans up identity mappings
   - Removes fragmenter/reassembler for old address
   - Clears pending MTU for old address

2. MAC rotation detection in _select_peers_to_connect():
   - If interface exists for identity but old address is not in peers
     (connection dead), clean up stale state and allow reconnection
   - If old connection still active, skip as before (no change)

This is defensive code that handles edge cases like:
- Android MAC rotation (~15 min intervals)
- Linux adapter reset while peer state is tracked
- Connection timeout without proper disconnect callback

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 18:23:43 -05:00
torlando-tech
2ff9ddc4f1 fix: HW_MTU instance attribute and MTU/identity race condition
Two critical fixes ported from Android testing:

1. HW_MTU instance attribute fix:
   - Base Interface.__init__() sets self.HW_MTU = None
   - BLEInterface.HW_MTU = 500 is a CLASS attribute, not instance
   - After super().__init__(), self.HW_MTU is None (instance shadows class)
   - BLEPeerInterface copies: self.HW_MTU = parent.HW_MTU (gets None)
   - When HW_MTU is None, Transport.py truncates packet.data incorrectly
   - Result: Link establishment fails with mismatched link_id
   - Fix: Explicitly set self.HW_MTU = BLEInterface.HW_MTU after super().__init__()

2. MTU/identity race condition fix:
   - MTU negotiation can complete before identity is received
   - Previously: Warning logged, fragmenter not created
   - Now: Store pending MTU, create fragmenter when identity arrives
   - Adds pending_mtu dict to track deferred MTU values
   - _device_connected_callback checks for pending MTU after storing identity

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 18:18:22 -05:00
torlando-tech
857c0b8145 chore: prepare v0.2.2 release
Update CHANGELOG.md with release notes for v0.2.2

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-15 22:45:47 -05:00
torlando-tech
05ac05d1c0 Merge pull request #14 from torlando-tech/fix/issue-13-justworksrepairing
Fix issue #13: Enable JustWorksRepairing in install.sh
2025-11-15 22:41:13 -05:00
torlando-tech
0874f8f153 Merge pull request #24 from torlando-tech/torlando-tech-patch-1
Rename 'ko-fi' to 'ko_fi' in FUNDING.yml
2025-11-15 21:25:32 -05:00
torlando-tech
9916c09251 Rename 'ko-fi' to 'ko_fi' in FUNDING.yml 2025-11-15 21:25:19 -05:00
torlando-tech
c197b483d0 Merge pull request #23 from torlando-tech/torlando-tech-patch-1
Add funding information for Ko-fi
2025-11-15 21:24:25 -05:00
torlando-tech
f7551225da Add funding information for Ko-fi 2025-11-15 21:24:09 -05:00
torlando-tech
d819008f05 Merge pull request #22 from torlando-tech/fix/remove-duplicate-deploy-workflow
fix: remove duplicate deploy workflow file
2025-11-15 21:16:34 -05:00
torlando-tech
58ef0a4bf8 fix: remove duplicate deploy workflow file
Removed .github/workflows/deploy.yaml which was a byte-for-byte duplicate
of deploy.yml. Both workflows were executing independently, causing:
- Duplicate deployments to Raspberry Pi devices
- Potential race conditions from concurrent SSH sessions
- Unnecessary resource usage

Kept deploy.yml as it uses the more standard extension in the GitHub
Actions ecosystem.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-15 21:14:59 -05:00
torlando-tech
c93fabb944 fix: remove duplicate deploy workflow file
Removed .github/workflows/deploy.yaml which was a byte-for-byte duplicate
of deploy.yml. Both workflows were executing independently, causing:
- Duplicate deployments to Raspberry Pi devices
- Potential race conditions from concurrent SSH sessions
- Unnecessary resource usage

Kept deploy.yml as it uses the more standard extension in the GitHub
Actions ecosystem.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-15 21:14:59 -05:00
torlando-tech
9514a6570a fix: enable JustWorksRepairing in install.sh to prevent pairing failures
Adds Step 5C to install.sh that automatically configures BlueZ's
JustWorksRepairing setting to "always" in /etc/bluetooth/main.conf.
This enables automatic pairing for peer-initiated BLE connections,
which is required for zero-touch mesh networking.

Changes:
- install.sh: Add Step 5C to configure JustWorksRepairing
  - Checks current setting and only modifies if needed
  - Handles both root and non-root execution
  - Restarts bluetooth service to apply changes
  - Container-friendly with non-fatal restart operations
- README.md: Document JustWorksRepairing in manual installation steps
- README.md: Add troubleshooting section for JustWorksRepairing warning

Fixes #13

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-15 21:06:57 -05:00