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

Add Mac and Linux support to dfu install. #581

Closed
wants to merge 2 commits into from

Conversation

CartBlanche
Copy link
Collaborator

@CartBlanche CartBlanche commented Jun 25, 2024

Refactor to centralise Process launching and use more modern async pattern.

Changes:
Mac - will new install brew, then install dfu-util if they are not already installed.
Linux - Currently only Ubuntu is supported, but we can add more support for their respective package managers in future. It prompts for sudo rights before calling apt-get.
Windows - Will now auto-prompt for UAC access, before running the commands, so no need to launch a new prompt with Admin rights (I don't think, might need more testing, to be 100% sure)

Tested on:

  • Mac
  • Linux
  • Windows

Fixes WildernessLabs/Meadow_Issues#733

@CartBlanche CartBlanche self-assigned this Jun 25, 2024
@CartBlanche CartBlanche changed the title Add Mac and Linux support to dfu install. Refactor to centralise Proce… Add Mac and Linux support to dfu install. Jun 25, 2024
@CartBlanche CartBlanche marked this pull request as ready for review June 25, 2024 16:07
@CartBlanche CartBlanche marked this pull request as draft June 27, 2024 08:26
@CartBlanche CartBlanche force-pushed the dominique-DfuForLinux branch 3 times, most recently from 33353f5 to 0d3fa1e Compare June 27, 2024 22:18
@CartBlanche CartBlanche marked this pull request as ready for review June 28, 2024 10:18
Copy link

@halyssonJr halyssonJr left a comment

Choose a reason for hiding this comment

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

LGTM :)

…ess launching and use more modern async pattern.
@ctacke
Copy link
Contributor

ctacke commented Sep 24, 2024

I'm not sure I'm a fan of this whole strategy. We're basically trying to wrap a CLI command with a CLI command, and if the versions of DFU change or whatever, then we have to update as well. An alternative would be that if DFU is missing, give the user an error that is meaningful, for example:

> meadow firmware update
ERROR: DFU Is not found.
DFU is required to write the firmware.  For more information see the docs at wildernesslabs.co/docs?id=12345

@bryancostanich
Copy link
Contributor

This one is also my fault. We added windows DFU install support ages back because customers were running into serious issues with it. This path was fine for windows, but with mac and linux, this solution is super ugly. Hat tip to @CartBlanche for tracking this down and trying to solve it, but this is winding up being a super brittle path forward and will ultimately be superseded when the OtA path for firmware updates is moved to in the CLI, which will relegate DFU to only initial firmware flashing and hard erase. And initial firmware flashing will largely be handled in the manufacturing/fulfillment pipeline anyway.

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.

meadow dfu install not currently supported on Mac and Linux
4 participants