Connection to what? My device? The internet? Some remote cloud web service? Why is the error itself so uselessly vague?
Why does it want any connection to anything simply to compile?
I've just installed the latest 2.1.0 IDE - how do I COMPILE (not upload) for an ESP32 which is not connected to my PC? (I work on my code when I travel).
There seems to be a logic error in the IDE - it forces the selection of a port all the time, which is not needed for compile-only workflow.
(And yes - my ESP32-CAM is connected just now, and I have picked the right port)
TO BE CLEAR - I AM NOT ASKING FOR HELP.
I want to know exactly what I asked: WHAT DOES THE ERROR MEAN ?
The Arduino CLI tool provides all the non-GUI functionality for Arduino IDE under the hood. Arduino IDE communicates with Arduino CLI via an internal TCP/IP port in your computer on "localhost". This is the "connection" mentioned in the error message.
You can get more details by starting Arduino IDE from the command line. The logs will be printed there.
You can get even more information by setting the GRPC_VERBOSITY environment variable to "DEBUG" and the GRPC_TRACE environment variable to "all" before you run the IDE from the command line.
OK, fair enough. If you do end up wanting assistance, you are welcome to ask for it here.
And if you find the solution on your own, it is helpful to share your findings here. Others who have the same problem and find this topic through their researches will be grateful to you.
Please provide a detailed explanation of what makes you think it is forcing the selection of a port.
localhost - ok, now I know ideas to investigate (rebooting and checking firewall and stuff)
Might I respectfully suggest you fix the error wording to say "No connection established to Arduino-CLI on localhost port xxxx" so everyone knows what it means, why, where, how, and can get some clues about possible solutions.
I downgraded to 1.8.3 in the end - 2.1.0 was a complete mess - ruined my settings (erased all my boards from preferences.txt at least), couldn't update anything because it threw "file already exists" errors (of course - that's what "Update" means), unusable serial monitor, ...
@ptillisch - good thinking about the CLI startup and extra verbosity options: not sure why I didn't think of those myself (well - I probably didn't expect a poorly worded error message to have a non-poorly-worded equivalent elsewhere, hence not thinking to look)
Thanks for understanding my "NOT ASKING FOR HELP" - so many times people lose track of the actual question and chime in with stuff they think "helpful" (which never answers the question).