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

Present boards in alphabetical order in "Board manager" #7665

Closed
6 tasks done
mats-nk opened this issue Oct 21, 2020 · 12 comments · Fixed by #7670
Closed
6 tasks done

Present boards in alphabetical order in "Board manager" #7665

mats-nk opened this issue Oct 21, 2020 · 12 comments · Fixed by #7670

Comments

@mats-nk
Copy link

mats-nk commented Oct 21, 2020

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: All
  • Core Version: 2020-10-21
  • Development Env: Arduino IDE
  • Operating System: All

Settings in IDE

"Board manager"

Problem Description

I have found it hard to always scan the list of boards in the board manager for the board I'm currently working with since they are not in alphabetical order.

So I split the "Arduino/tools/boards.txt.py" into one file per board and then the start and end info into separate files.

boards.zip contains all the "one file per board".
boards.zip

build.txt ->build.bat builds a new version of boards.txt.py with the boards in alphabetical order.
build.txt

I would appreciate if the boards could be presented in an alphabetical order highly.

@d-a-v
Copy link
Collaborator

d-a-v commented Oct 21, 2020

Why don't you make a pull request with an updated version of boards.txt.py in which you have alphabetically sorted the board description blocks instead ?

@mhightower83
Copy link
Contributor

@mats-nk I have a problem with searching any long list. My solution was to add and use the --filter option on boards.txt.py. This option will also place the boards in the order they appear in the filter file.

So you can dump a list of the boards with:

./tools/boards.txt.py --boardnames >favorites.txt

arrange and delete boards as needed. This would also allow you to group boards in any order. Then:

./tools/boards.txt.py --boardsgen --filter favorites.txt

I don't remember how I positioned the generic boards. They are special and always added even if you leave them out of the favorites.txt.

@mhightower83
Copy link
Contributor

@mats-nk Well, I just got back to my system and looked at this again. ☹️ The boards.txt is ordered to match the favorites.txt file; however, the version of Arduino IDE 1.8.9 that I am now using doesn't honor the order when it presents the list. I am sure this use to work. Otherwise, I would not have added it to the doc. ☹️

@mats-nk
Copy link
Author

mats-nk commented Oct 22, 2020

Neat that was a nice way, I'm not a python guy so I didn¨t see that one in the boards.txt.py .

Then I would suggest that the boards.txt that is built in the releases and delivered through the "json" is built with the flag --boardnames.

Because I don't believe that the common person will build their own boards.txt file and since the function is there why not use it.

@mats-nk
Copy link
Author

mats-nk commented Oct 22, 2020

And a thought, is it possible to make boards.txt.py more generic, example to split out the boards from it and place all board definition in a separate file. In that way it could also be used in the "Arduino" project, or any other hardware boards.

@mats-nk
Copy link
Author

mats-nk commented Oct 22, 2020

@mhightower83 thx for that info, I have never heard of favorites.txt and searching for it was not easy, but I found:

https://arduino-esp8266.readthedocs.io/en/latest/faq/a05-board-generator.html

But that doc needs some proof reading, like AppDataLocalArduino15packagesesp8266hardwareesp82662.4.2for PlatformIO it is in .platformiopackagesframework-arduinoespressif8266. . I think I can guess what it is, but without \ and / not so easy.

My guess is:
%LOCALAPPDATA%\Arduino15\packages\esp8266\hardware\esp8266\<release version>

@mats-nk
Copy link
Author

mats-nk commented Oct 22, 2020

So I tried the above suggestions with

./tools/boards.txt.py --boardnames >favorites.txt
arrange and delete boards as needed. This would also allow you to group boards in any order. Then:
./tools/boards.txt.py --boardsgen --filter favorites.txt

And it works, I get the subset that I specified in favorites.txt + "Generic ESP8285 Module", but the sorting I had to do manually in favorites.txt.

I just specified :

# Available board names. Delete or comment out the boards you do not need:
d1_mini              # WeMos D1 R2 & mini
generic              # Generic ESP8266 Module

@d-a-v
Copy link
Collaborator

d-a-v commented Oct 22, 2020

Sorting could be automated

@mats-nk
Copy link
Author

mats-nk commented Oct 22, 2020

@d-a-v Sorting would be highly appreciated from me.

Is it hard to split out the board definitions in a separate file, like boards.def, because then boards.txt.py could be used with the AVR MCU and other MCUs.

@d-a-v
Copy link
Collaborator

d-a-v commented Oct 23, 2020

@mhightower83 it seems the order given by boards.txt is preserved in the Arduino IDE (I tested with 1.8.14).
@mats-nk
Sorting can be done like this:

./tools/boards.txt.py --boardnames | sort > favorites.txt

(it should also work under windows, I just discovered sort is there too).
Does this work with you ? Should it be enough to document this ?

@mats-nk
Copy link
Author

mats-nk commented Oct 23, 2020

As I have said earlier, I think it would be appreciated to have the boards sorted in alphabetical order in the release, NOT something that you have to do manually after finding something in the doc and have installed python.

Lets have the average user in focus.

And thanks, I didn't know that sort worked in the Windows cli, Linux bash is more my tool.

And YES the documentation should be proof read and updated.

@d-a-v
Copy link
Collaborator

d-a-v commented Oct 23, 2020

#7670 is a proposal for automating board sorting, leaving generic boards always first.
link to new default boards.txt

Is that OK ?

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 a pull request may close this issue.

3 participants