Archive project

Hello

I’m a new user of platformIO, i have been reading the docs and related threads in this forum, but i’m not able to get this work…

I have a project based on arduinoespressif32, so far so good, but i would like to prevent project to auto-update dependecies and also will be nice to make it portable, so i can move it to another computer and compile it being sure that same versions are being used.

I use libraries from a local folder so libs is solved

But i also wanted to use my own local folder for arduinoespressif32 and espressif32, so i wanted to use a
custom local framework and platform.

I read about using platform_packages for that mission but is not able to make it work.

For now im just trying to do framework and once i understand how works add platform.

I started making a copy of framework-arduinoespressif32 folder from
/home/dev/.platformio/packages/ move to another location and rename it to framework-arduinoespressif32-custom and inside i change package.json name to "name": "framework-arduinoespressif32-custom"

Later in platform.io config file im doing

[env]
platform_packages = 
    framework-arduinoespressif-custom@file:///home/dev/PlatformIO/Projects/demo_storage/framework/framework-arduinoespressif32-custom

[env:esp32doit-devkit-v1]
platform = espressif32
board = esp32doit-devkit-v1
framework = arduino

This is not working, sure im doing something wrong but im not able to figure it, any clue will be wellcome!!

Thanks

If you change the package name, the entire espressif32 build logic will ignore it, since it is looking for framework-arduinoespressif32 (example). You would have to fixup the entire platform for this custom package.

If you want to use a custom framework folder, retain the package name.

[env]
platform_packages = 
    framework-arduinoespressif32@file://<path to your backed up framework with no package.json mods>

For fixing the platform integration and used Arduino core, you can simple refer to the espressif32 version you used when creating the project. Refer to the documentation.

That means, it’s as easy as

[env:esp32doit-devkit-v1]
; platform that uses Arduino-ESP32 2.0.4
platform = espressif32@5.1.0
board = esp32doit-devkit-v1
framework = arduino

Same with lib_deps.

1 Like

It works for setting my local version, thank you!!!

Also if i just wanted to ensure versions forgetting about to be local, setting @a.b.c will force to download that release version

platform = espressif32@5.1.0

will ensure that platform is release 5.1.0 espressif32 5.1.0

And how can i do the same to ensure that arduino-esp32 use the version i wanted, for example 2.0.4 ??
arduino-esp32 2.0.4 or is this a fixed dependency version from platform? so setting platform to 5.1.0 will force arduino-esp32 to be 2.0.4??

Thanks!

Yes, due to

Ahh ok, but with the ~ symbol means min version, so updates are allowed?

"version": "~3.20004.0"

Sorry to make too much questions! Im understanding better how it works, thanks

The ~ semver operator only operates on the minor version, which is 0. So the 3.20004 part, which means 2.0.4, stays.

Looking at PlatformIO Registry, there are indeed 3.20004.220818 and 3.20004.0 – there are some cases in which indeed such a version update is done to fix a critical bug, maybe Error programming with ESP-PROG on 5.1.0 · Issue #872 · platformio/platform-espressif32 · GitHub in this case. I think developers will only do such an update if it’s absolutely necessary and only beneficial.

If you want to avoid this, additionally use platform_packages to also fix every package, e.g.

platform_packages =
   framework-arduinoespressif32@3.20004.220818

Perfect, everything is clear now, thank you!