B4R Question B4R Board Manager error, with Arduino15 path is new

peacemaker

Expert
Licensed User
Longtime User
Hi, All and @Erel

Just installed latest Arduino IDE 2.x, CLI and B4R 4.0 on a new laptop (Win11).
Arduino CLI and "Arduino15" folder are moved to another drive:

C:\Users\%USER_NAME%\.arduinoIDE\arduino-cli.yaml:
board_manager:
    additional_urls:
        - https://arduino.esp8266.com/stable/package_esp8266com_index.json
        - https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
directories:
    builtin:
        libraries: d:\Programs\Arduino\Arduino15\libraries
    data: d:\Programs\Arduino\Arduino15
    user: d:\Programs\Arduino\Sketches
locale: en

Boards are installed OK, Arduino IDE compiling, uploading an example sketch is OK.
javac path is choosen.
But Board Manager gives error:

Build modules tree: 0
B4R version: 4.00
.Net version: 4.0.30319.42000
Ini folder: C:\Users\LOQ\AppData\Roaming\Anywhere Software\B4R
Global Java version: 14
Build modules tree: 0
Gui: 764
Gui: 138
Gui: 136
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
в System.ThrowHelper.ThrowKeyNotFoundException()
в System.Collections.Generic.Dictionary`2.get_Item(TKey key)
в d.c(Object A_0, RunWorkerCompletedEventArgs A_1)
в System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e)
в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
в System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
Gui: 589

Any ideas ?
 
Last edited:
Solution
The default config file for arduino-cli is: C:\Users\H\AppData\Local\Arduino15\arduino-cli.yaml

You can copy the one from C:\Users\%USERNAM%\.arduinoIDE\arduino-cli.yaml

I will make B4R look for the IDE config file.

peacemaker

Expert
Licensed User
Longtime User
@Erel, is it possible to make the arduino-cli utility to get the installed boards via the path got first from C:\Users\%USER_NAME%\.arduinoIDE\arduino-cli.yaml ?

By "data: d:\Programs\Arduino\Arduino15" path.
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User


Suggested to do so, Erel
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
d:\Programs\Arduino\CLI>arduino-cli.exe --config-file "C:\Users\LOQ\.arduinoIDE\arduino-cli.yaml" board listall --format json > 1.txt
Such command returns the huge 1.txt file with list of the installed boards !
d:\Programs\Arduino\CLI>arduino-cli.exe --config-file "C:\Users\LOQ\.arduinoIDE\arduino-cli.yaml" core list
ID Installed Latest Name
esp32:esp32 3.1.3 3.2.0 esp32
esp8266:esp8266 3.1.2 3.1.2 esp8266
Works also !
d:\Programs\Arduino\CLI>arduino-cli.exe board listall --format json > 1.txt
Default call returns the empty list, @Erel.
 
Last edited:
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
Have a look at this. Be sure to read it from the first post to get a better understanding. Maybe there is a similar option if you dig carefully for the boards manager...

 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
Besides my previous answer you might also consider uninstalling the boards completely and then changing the folders in arduino-cli and re-installing the boards. Might be useful to change also the sketchbook folder in Arduino IDE in Files > Preferences.
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
If no " directories: " is available
Thanks, but my folders are EN, it's OK. And IDE works OK with these folders paths.

"arduino-cli config init" command clears the file "arduino-cli.yaml" content (i edited back).
Boards were installed OK after the "arduino-cli.yaml" file edited.

Trouble is that "arduino-cli" must be called not by default, but always with THIS config file "arduino-cli.yaml" path, as i posted above, in B4R IDE i mean.
It was pointed at the Arduino forum, and mentioned that Arduino IDE does the same.
 
Upvote 0
Top