Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Add beta support for SPIKE / MINDSTORMS installation in Pybricks Code #659

Closed
laurensvalk opened this issue Jun 3, 2022 · 1 comment
Labels
enhancement New feature or request hub: primehub/inventorhub Issues related to the LEGO SPIKE Prime hub and LEGO MINDSTORMS Robot Invetor hub platform: essentialhub Issues related to the LEGO SPIKE Essential hub software: pybricks-code Issues with https://code.pybricks.com application topic: USB Issues related to USB

Comments

@laurensvalk
Copy link
Member

Is your feature request related to a problem? Please describe.
It is currently not easy to install Pybricks on SPIKE Prime, SPIKE Essential, and MINDSTORMS robot inventor. This issue is about adding a minimized solution to make it work.

Describe the solution you'd like
On a settings or "experimental" tab, add the following:

  • A button (or clickable text item) to connect to the hub via USB:
    • Only enabled if no hub is currently connected via BLE (info box can say "disconnect first")
    • Button opens the browser dialog to connect to LEGO devices with the right USB ids
    • Once connected, it communicates over USB serial:
      • It pastes this function into the REPL to provide a basic file transfer interface. See also the same file for doing a soft reset before doing anything. This could be adapted into something that works well with what Pybricks Code has already for uploads.
      • Install the firmware via this procedure: This uploads a few files from the firmware.zip archive, including the install script, and runs it.
    • All output is displayed in the Pybricks Code terminal, so no need for fancy progress bars for now.
  • A button to restore the original firmware:
    • Only enabled if Pybricks hub is currently connected via BLE (add info box to say "connect first")
    • The button is just a shorthand for downloading and running this script
    from pybricks.experimental import restore_firmware
    from pybricks import version
    
    print(version)
    restore_firmware()
  • A link to the DFU recovery page as a fall back option

Describe alternatives you've considered
It works via pybricksdev and a separate web page, but not all hubs are supported and the firmware easily gets outdated.

@laurensvalk laurensvalk added enhancement New feature or request hub: primehub/inventorhub Issues related to the LEGO SPIKE Prime hub and LEGO MINDSTORMS Robot Invetor hub software: pybricks-code Issues with https://code.pybricks.com application topic: USB Issues related to USB platform: essentialhub Issues related to the LEGO SPIKE Essential hub labels Jun 3, 2022
@dlech
Copy link
Member

dlech commented Jul 28, 2022

This feature has been released in Pybricks Code v3.2.0b3 (Pybricks Beta v2.0.0-beta.4).

@dlech dlech closed this as completed Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hub: primehub/inventorhub Issues related to the LEGO SPIKE Prime hub and LEGO MINDSTORMS Robot Invetor hub platform: essentialhub Issues related to the LEGO SPIKE Essential hub software: pybricks-code Issues with https://code.pybricks.com application topic: USB Issues related to USB
Projects
None yet
Development

No branches or pull requests

2 participants