Add NanoXRP robot support with firmware detection and battery threshold#252
Open
SaintSampo wants to merge 4 commits intomainfrom
Open
Add NanoXRP robot support with firmware detection and battery threshold#252SaintSampo wants to merge 4 commits intomainfrom
SaintSampo wants to merge 4 commits intomainfrom
Conversation
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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