Skip to content

Add Raspberry Pi device capabilities on v5#35

Open
CodeMzt wants to merge 8 commits into
v5from
feat/rpi-endpoint
Open

Add Raspberry Pi device capabilities on v5#35
CodeMzt wants to merge 8 commits into
v5from
feat/rpi-endpoint

Conversation

@CodeMzt

@CodeMzt CodeMzt commented May 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Rebase Raspberry Pi endpoint device-layer work onto latest v5.
  • Keep v5 Core/gateway/tools/UI main-chain behavior as the base and adapt the Pi provider on top.
  • Preserve device config schema, registry validation, rpi.device.*, rpi.button.read, Pi diagnostics, and Core routing coverage.

Rebase notes

  • Rebased cleanly onto origin/v5 with no manual conflicts.
  • v5 remains the source of truth for Core/gateway/tools/UI main-chain files.
  • Pi provider changes remain scoped to endpoint provider, docs, examples, AGENTS guidance, and focused tests.

Validation

  • python -m pytest endpoint_providers/raspberry_pi/tests -q -> 40 passed
  • python -m pytest tests/test_rpi_core_integration.py tests/test_endpoint_tools.py -q -> 14 passed
  • python -m pytest tests/test_endpoint_tool_protocol.py tests/test_endpoint_provider_protocols.py tests/test_endpoint_protocol_v4.py tests/test_tool_router_v4.py -q -> 29 passed

Real Pi validation carried forward

  • Real Pi endpoint advertised 10 capabilities including rpi.device.* and rpi.button.read.
  • Core accepted registered_capability_count: 10.
  • User confirmed the device capabilities are available.

Security invariants

  • Raspberry Pi remains an Endpoint Provider only.
  • No /client/ws, source_client_id, target_client_id, or ClientToolDispatchService changes.
  • GPIO remains allowlist-bound.
  • Safe shell remains default-off.
  • Relay devices default to confirmation required unless explicitly disabled.
  • Endpoint keepalive remains connection keepalive only and does not trigger system.heartbeat.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 79a5ef3fe1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/rpi/smoke-test.sh
HEALTH_ARGS+=(--env-file "${ENV_FILE}")
fi

"${PYTHON_BIN}" -m endpoint_providers.raspberry_pi.meetyou_rpi_endpoint.health "${HEALTH_ARGS[@]}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve fake-GPIO smoke-test mode

When this script is run in its default local/simulation mode, the new health check exits non-zero before the simulator starts because it does not receive the later --fake-gpio setting and still requires real GPIO/lgpio checks and a token env; with set -e, a developer using the fallback user/rpi_endpoint.example.json on a non-Pi (or without /etc/meetyou/rpi-endpoint.env) never reaches the --simulate --fake-gpio command. Please either pass MEETYOU_RPI_FAKE_GPIO=1/a health simulation mode for this path or make the health check optional for local smoke runs.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 65e411f8dc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

async def _write_logical(device, value: bool, context: CapabilityContext) -> dict[str, Any]:
backend = _gpio_backend(context)
pin = _validate_device_pin(device, context)
return await backend.write(pin, _physical_value(device, value), duration_ms=0)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep real GPIO outputs open during device writes

On a real Pi using the gpiozero backend, this one-shot _write_logical call returns only after GpioZeroBackend.write() has closed the DigitalOutputDevice, so rpi.device.set releases the pin immediately and pulse/blink sleep after the pin has already been released. The fake backend stores state, so the new tests pass, but the advertised device operations will not reliably hold LEDs/relays active for the requested value or interval on real hardware.

Useful? React with 👍 / 👎.

@LuuOW LuuOW left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technical audit: code patterns and architectural layout verified for system reliability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants