arduino / arduino-ide

Arduino IDE 2.x
https://www.arduino.cc/en/software
GNU Affero General Public License v3.0
2.3k stars 391 forks source link

Communicate first run Internet access requirement to user #784

Open per1234 opened 2 years ago

per1234 commented 2 years ago

Describe the problem

On the first run, Arduino IDE must download some files from the Internet:

If the IDE does not have Internet access at that time, it can not reach a functional state. There is currently no communication to the user in this situation.

This is a change from Arduino IDE 1.x, which is in a fully functional state from the start with no hard dependency on an Internet connection (though obviously Library/Boards Manager can't be used).

To reproduce

  1. Quit the IDE if it is running.
  2. Rename or delete (:warning: cautiously) the following folders to simulate the environment of a first run:
    • Windows:
      C:\Users\<username>\.arduinoIDE
      C:\Users\<user name>\AppData\Local\Arduino15
      C:\Users\<user name>\AppData\Roaming\arduino-ide
      C:\Users\<user name>\Documents\Arduino
    • Linux:
      ~/.arduinoIDE
      ~/.arduino15
      ~/.config/arduino-ide
      ~/Arduino
    • macOS:
      ~/.arduinoIDE
      ~/Library/Arduino15
      ~/Library/Application Support/arduino-ide
      ~/Arduino
  3. Disconnect your computer from the Internet.
  4. Start the Arduino IDE.
  5. Wait as long as you need to feel confident the IDE has finished doing all first run procedures.
  6. Connect an Arduino board to your computer.
  7. Open the board/port selector. :bug: Notice that the board and port are not listed.
  8. Select Tools > Board from the Arduino IDE menus. :bug: Notice that the expected "Arduino AVR Boards" menu item is not present.
  9. Open the Tools > Port menu. :bug: Notice that the port of your board is not listed.
  10. Open the Sketch > Include Library menu. :bug: Notice that there are no libraries.

After you connect to the Internet and restart the IDE, the discoveries will be installed, so the missing ports issue will resolve itself at that time 🙂. However, the missing "Arduino AVR Boards" platform and libraries condition is persistent :bug: because this is only attempted on the first run, whether or not it fails.

Expected behavior

Arduino IDE version

Original report

2.0.0-rc3-snapshot.1d88263

Last verified with

9a6a457bc44fb16f646b9e61a9e8b336b3666412

Operating system

Windows

Operating system version

10

Additional context

At one time, the IDE showed a notification when there was no Internet connection (https://github.com/arduino/arduino-ide/pull/266), which was cryptic but at least gave some feedback:

Request loadSketch failed with message: 2 UNKNOWN: downloading builtin:ctags@5.8-arduino11 tool: Get "https://downloads.arduino.cc/tools/ctags-5.8-arduino11-pm-i686-mingw32.zip": dial tcp: lookup downloads.arduino.cc: no such host

But that notification is no longer shown (probably because the system has been made more tolerant of error conditions).


Additional reports:

Issue checklist

per1234 commented 2 years ago

Some nice advancements have been made toward resolving this.

https://github.com/arduino/arduino-ide/pull/1169 introduces two important advancements:

Unfortunately, there was also a regression that causes the IDE to hang at the splash screen on first run without Internet connection (https://github.com/arduino/arduino-ide/issues/2042), which prevents the IDE from reaching the state where the notification can be shown to the user.