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

select custom board #79

Open
jon-daemon opened this issue Oct 23, 2016 · 6 comments
Open

select custom board #79

jon-daemon opened this issue Oct 23, 2016 · 6 comments

Comments

@jon-daemon
Copy link

Hello,
I have created a few custom boards but I cannot find them in Deviot.
I can see my boards if I execute platformio boards in terminal.
Should I update the list in Deviot somehow?

@gepd
Copy link
Owner

gepd commented Oct 23, 2016

I'm improving this feature in v2 of deviot, in this version you should remove the file located in: Packages\User\Deviot\Preset\platformio_boards.json and restart ST

It will took a few seconds to refresh and show the new board

@jon-daemon
Copy link
Author

jon-daemon commented Oct 24, 2016

I deleted this file but it didn't reappear after restarting ST. Also it wasn't showing the boards list to select one.
It reappeared after building a project, disabling and enabling Deviot.
I found that it changed the structure of my boards json files.
I had something like that:

{
"my_board_name":{
"build": {},
    "frameworks": [], 
    "name": "", 
    "platform": "", 
    "upload": {}, 
    "url": "", 
    "vendor": ""
  }
}

which turned into this:

{
  "build": {}, 
  "frameworks": [], 
  "name": "", 
  "platform": "", 
  "upload": {}, 
  "url": "", 
  "vendor": ""
}

After this change I can see my boards on Deviot but it gives me an error if I execute platformio boards in terminal.

@gepd
Copy link
Owner

gepd commented Oct 24, 2016

Your first structure is like this:? #77 (comment)

Try again, and this time after delete the file in the Preset folder, go to Deviot > Language and select your current language, it will ask to restart Deviot, accept it and tell me if the behavior is the same

@jon-daemon
Copy link
Author

jon-daemon commented Oct 24, 2016

No, the structure I was using is like this because I found that only with this structure I'm not getting errors on terminal.

After the structure change they are like the commment you posted but I get this error

Error: Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/platformio/__main__.py", line 107, in main
    cli(None, None, None)
  File "/Library/Python/2.7/site-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/Library/Python/2.7/site-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Library/Python/2.7/site-packages/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Library/Python/2.7/site-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/platformio/commands/boards.py", line 36, in cli
    if data['platform'] not in grpboards:
TypeError: string indices must be integers

============================================================

An unexpected error occurred. Further steps:

* Verify that you have the latest version of PlatformIO using
  `pip install -U platformio` command

* Try to find answer in FAQ Troubleshooting section
  http://docs.platformio.org/en/latest/faq.html

* Report this problem to the developers
  https://github.com/platformio/platformio/issues

============================================================

@gepd
Copy link
Owner

gepd commented Oct 24, 2016

it seems to be a problem with PlatformIO.

The last structure is working only with PlatformIO 3, having open a cpp or ino file, Deviot will show you the version installed in the status bar, if your version is 2.x I suggest you to update from

Deviot Menu > Options > Upgrade PlatformIO

After install the last version (3.1.0 in this moment) you shouldn't have problem but If you keep getting errors, you can remove the folder Deviot in Packages\User it will make to install PlatformIO again, this time all errors should be gone

And you should use this json structure for your board

@jon-daemon
Copy link
Author

jon-daemon commented Oct 25, 2016

I have Deviot 1.2.5 and PlatformIO 3.1.0
I use Mac OS X 10.12 and ST build 3126.
I tried all your suggestions with no luck.
I created just one board with the structure you suggested.
Everything is working fine on ST but still getting the same error in Terminal.

edit: It seems to be fixed after upgrading platformio with

sudo pip install -U platformio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants