Skip to content

Add NanoXRP robot support with firmware detection and battery threshold#252

Open
SaintSampo wants to merge 4 commits intomainfrom
JacobNanoXRP
Open

Add NanoXRP robot support with firmware detection and battery threshold#252
SaintSampo wants to merge 4 commits intomainfrom
JacobNanoXRP

Conversation

@SaintSampo
Copy link
Copy Markdown
Collaborator

@SaintSampo SaintSampo commented May 5, 2026

Summary

  • NanoXRP firmware support: Detects when a NanoXRP (RP2040, USB product ID 0x110A) is connected and uses firnware2040nanoxrp.uf2 for firmware updates instead of the Beta's firmware2040.uf2. Detection uses the USB port's product/vendor ID, stored as a flag before the device disconnects during the bootloader update flow.

  • NanoXRP battery threshold: Single-cell LiPo batteries top out at 4.2V, so the existing 5.0V low-battery warning threshold is wrong for NanoXRP. The Bluetooth low-battery check now uses 3.3V for NanoXRP and keeps 5.0V for Beta/standard XRP.

  • Local dev: Google auth fallback: When VITE_GOOGLE_AUTH_URL is not set (local development without the auth backend), the app now falls through to render normally instead of hanging on "Loading Google authentication...". Google Drive features are unavailable but XRP connection and all robot features work.

  • Added middle reflectance sensor block, only for NanoXRP

Test plan

  • Connect a NanoXRP via USB, trigger a firmware update, verify the network request fetches micropython/firnware2040nanoxrp.uf2
  • Connect an XRP Beta, verify firmware update still fetches firmware2040.uf2
  • Connect a standard XRP (2350), verify firmware update still fetches firmware2350.uf2
  • Verify low battery dialog appears at the correct threshold for NanoXRP vs other robots (Bluetooth connection)
  • Verify npm run dev loads without a backend running

SaintSampo added 3 commits May 5, 2026 18:18
Wrap the Login component in a GoogleAuthBoundary to swallow errors from Google auth and prevent the tree UI from crashing. Update Root initialization to distinguish between null (still loading) and empty string (fetch error), set googleClientId to '' on fetch failure, and only render GoogleOAuthProvider when a clientId is available; otherwise render the App without the provider.
Replace inline firmware filename logic in NavBar with CommandToXRPMgr.getFirmwareFilename(). Add Connection.isNanoXRP() (default false) and implement it in USBConnection to detect NanoXRP by USB vendor/product IDs. Track is_NanoXRP in CommandToXRPMgr (set when detecting RP2040 on connect, cleared on reset) and add getFirmwareFilename() to pick the correct UF2 image based on processor and NanoXRP state. This centralizes firmware selection and adds support for NanoXRP detection.
Add CommandToXRPMgr.isNanoXRP() accessor and update NavBar voltage check to use 3.3V for NanoXRP devices (instead of 5.0V). This ensures the low-battery dialog triggers at the correct voltage for NanoXRP hardware. Changes in src/managers/commandstoxrpmgr.ts and src/components/navbar.tsx.
@SaintSampo SaintSampo requested a review from kcq888 May 5, 2026 22:26
Introduce a new Blockly block xrp_m_refl for the NanoXRP middle reflectance sensor and its Python generator. The Python generator adds Reflectance imports and setup (reflectance = Reflectance.get_default_reflectance()) and emits reflectance.get_middle(). Update PluginMgr: pluginCheck now detects NanoXRP and calls configNanoXRP (which inserts the xrp_m_refl block into the Sensors -> Reflectance toolbox category). Existing RP2350 handling is preserved.
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.

1 participant