esp-rs / espflash

Serial flasher utility for Espressif SoCs and modules based on esptool.py
Apache License 2.0
471 stars 115 forks source link

espflash: add `--offline` flag #407

Closed dimpolo closed 1 year ago

dimpolo commented 1 year ago

This flag disables the update check.

Hope it's okay to add this.

Please let me know if there's anything I can improve :)

SergioGasquez commented 1 year ago

Hi! Do you mind elaborating the rationale behind this? Just did a small test and when I had no internet connection the check was just skipped:

# With internet connection
❯ espflash board-info
[2023-05-22T07:10:23Z INFO ] 🚀 A new version of espflash is available: v2.0.0-rc.3
✔ Use serial port '/dev/ttyS0'? · no
Error: espflash::serial_not_found

  × The serial port '/dev/ttyS0' could not be found
  help: Make sure the correct device is connected to the host system

# With NO internet connection
❯ espflash board-info
✔ Use serial port '/dev/ttyS0'? · no
Error: espflash::serial_not_found

  × The serial port '/dev/ttyS0' could not be found
  help: Make sure the correct device is connected to the host system
dimpolo commented 1 year ago

I was hoping to have a client use espflash to update the firmware of a device. I'd like to add this flag to avoid possible questions about what else this tool might do in the background 😅

jessebraham commented 1 year ago

I'm a little apprehensive of adding options to the base Cli struct like that. A big part of the reason we completely rewrote the command-line interface was to eliminate these options, as they tended to cause confusion if provided in the wrong location (ie. after the subcommand instead of before it).

On top of that, it doesn't really do much. As @SergioGasquez mentioned the check fails silently with no connection. If they don't trust this application the source code is obviously available for review.

dimpolo commented 1 year ago

Those are valid points. For my niche I'm ok providing the client with my own build so I'll close this. Thanks for having a look