Back to Smartcitizen.me

Building the firmware - platformio version

I’ve used chocolatey to install Python 3.11 and I’ve installed the packages listed here:
https://docs.smartcitizen.me/Guides/firmware/Edit%20the%20Firmware/#installing-python

However, when I run python make.py build sam -v or python make.py build esp -v, I get an error saying that I need platformio 6 (code output is below).

I’ve uninstalled Python 3.11 and installed Python 3.9 instead, but I got the same error.

I’ve run pio and platformio in the command line, and both commands are recognised.

My OS is Windows 11 and I’m using Cygwin version 3.3.6-341.x86_64 for the command line.

Code output:

$ python make.py build sam -v
Error: Please upgrade to the PlatformIO Core 6
Traceback (most recent call last):
  File "C:\HDD\WeCount\AirPollution\smartcitizen-kit-21\make.py", line 53, in <module>
    kit = sck.sck()
          ^^^^^^^^^
  File "C:\HDD\WeCount\AirPollution\smartcitizen-kit-21\./tools\sck.py", line 56, in __init__
    self.paths['pioHome'] = [s.split()[1].strip(',').strip("'") for s in subprocess.check_output(
                                                                         ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\subprocess.py", line 465, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\subprocess.py", line 569, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['pio', 'run', '-t', 'envdump']' returned non-zero exit status 1.

$ python make.py build esp -v
Error: Please upgrade to the PlatformIO Core 6
Traceback (most recent call last):
  File "C:\HDD\WeCount\AirPollution\smartcitizen-kit-21\make.py", line 53, in <module>
    kit = sck.sck()
          ^^^^^^^^^
  File "C:\HDD\WeCount\AirPollution\smartcitizen-kit-21\./tools\sck.py", line 56, in __init__
    self.paths['pioHome'] = [s.split()[1].strip(',').strip("'") for s in subprocess.check_output(
                                                                         ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\subprocess.py", line 465, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\subprocess.py", line 569, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['pio', 'run', '-t', 'envdump']' returned non-zero exit status 1.
$ platformio --version
PlatformIO Core, version 5.1.1

Hi @anna.molter

We have been getting issues with python 3.10 and python 3.11. If you can, I would stay with 3.8 or 3.9 when installing.

However, I don’t think this is the issue. Maybe the problem comes from the fact that “pio” is not recognised as an alias for “platformio”. → Can you check on the terminal and run “pio” and put it here? Maybe it’s simply missing the alias.

Thanks for posting here :slight_smile:

I’ve already checked and both pio and platformio are there. I’ve also tried using Python 3.9, but I got the same error.

Reading better your command line output, it seems that Windows is not liking platformio core 5.

Can you try doing pip install platformio --upgrade and try again?

I think this worked. The build ran successfully for both sam and esp.

Thanks!

2 Likes