PlatformIO Community

Error execute pio init

I want to compile espeasy using atom and platformio ide
When I try to execute
pio init --board d1_mini --board sonoff_basic --ide atom
get error message :

Error: Processing d1_mini (platform: espressif8266; board: d1_mini; framework: arduino)

Verbose mode can be enabled via `-v, --verbose` option
KeyError: 'BUILD_FLAGS':
  File "C:\users\donyo\.platformio\penv\lib\site-packages\platformio\builder\", line 149:
    env.SConscript(item, exports="env")
  File "C:\Users\donyo\.platformio\packages\tool-scons\script\..\engine\SCons\Script\", line 605:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\Users\donyo\.platformio\packages\tool-scons\script\..\engine\SCons\Script\", line 286:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "D:\Users\donyo\Documents\GitHub\ESPEasy\", line 13:
    my_flags = env.ParseFlags(env['BUILD_FLAGS'])
  File "C:\Users\donyo\.platformio\packages\tool-scons\script\..\engine\SCons\", line 410:
    return self._dict[key]
============================================= [FAILED] Took 0.62 seconds ============================================= 

Help … What I’m missing?

I never used the PIO Cli this way, but intuitively, shouldn’t it be --board d1_mini sonoff_basic instead of passing the argument twice? This would somewhat explain the KeyError: 'BUILD_FLAGS' error.

1 Like

No, that seems correct… you pass multiple --board if you want to set up multiple boards.

I wasn’t able to reproduce the error on my Windoze, so not sure what’s broken there. If it were me, and i didn’t care about debugging it, I’d just close Atom, delete the C:\users\donyo\.platformio\penv directory, and let the PlatformIO extension reinstall the PlatformIO core when Atom is restarted.

Note: I’m using VSCode, but ran the Atom version of the init command without issue.