PlatformIO and custom compilation

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
PandCall
Normal user
Posts: 57
Joined: 22 Sep 2022, 20:04

PlatformIO and custom compilation

#1 Post by PandCall » 26 Sep 2024, 09:01

Hello,
A simple question
I use PlatformIO to make my custom firmware.
But I'm using a version of the Github repository that is quite old.
The question I have is, each time I launch PlatformIO and my new firmware, is there a package update or do I have to copy the repository from time to time?
Regards

TD-er
Core team member
Posts: 9283
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: PlatformIO and custom compilation

#2 Post by TD-er » 26 Sep 2024, 09:08

I'm not 100% sure I understand what you're asking.

Did you make changes to ESPEasy for your builds?
Or is it just changing the Custom.h file?

If it is just the Custom.h file, you can just fetch the latest sources and build it.

If you have made changes to ESPEasy, then I would suggest you work on a fork of the repository using Git and make a branch for yourself.
Then when you want to update the ESPEasy sources to the latest version, you just fetch and pull the 'mega' branch and then merge this 'mega' branch into your own branch.
Git will then identify any possible merge issues, or even try to handle those merge issues itself.

User avatar
Ath
Normal user
Posts: 3954
Joined: 10 Jun 2018, 12:06
Location: NL

Re: PlatformIO and custom compilation

#3 Post by Ath » 26 Sep 2024, 09:43

For building (and optionally improving) ESPEasy using VSCode with PlatformIO and Github we have a documentation page: https://espeasy.readthedocs.io/en/lates ... ormIO.html
/Ton (PayPal.me)

PandCall
Normal user
Posts: 57
Joined: 22 Sep 2022, 20:04

Re: PlatformIO and custom compilation

#4 Post by PandCall » 26 Sep 2024, 21:14

I don't touch the code itself.
Only Custom.h
It's just a question of knowing whether I have to update all the mega files from time to time to benefit from corrections and new features, or whether the compilation takes care of updating my local files before compiling them.
Thanks Ath, I'll have a look at that link.
I'd like my local to always be updated with the latest available files. :D

TD-er
Core team member
Posts: 9283
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: PlatformIO and custom compilation

#5 Post by TD-er » 26 Sep 2024, 21:20

Just make sure to checkout the files using Git and not just downloading ZIP files from the release page.
Sometimes files get renamed or moved, so when copying a ZIP file over the old source code tree will then result in build issues and I've seen some issues when using ZIP files from the releases pages.

PandCall
Normal user
Posts: 57
Joined: 22 Sep 2022, 20:04

Re: PlatformIO and custom compilation

#6 Post by PandCall » 26 Sep 2024, 21:35

So the recommendation is to save my Custom.h
Delete local content
Download the ZIP
Unzip it
replace my Custom.h
Compare Custom-sample.h to see if there are any new features.
and compile Custom.
And check for new versions from time to time.

TD-er
Core team member
Posts: 9283
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: PlatformIO and custom compilation

#7 Post by TD-er » 26 Sep 2024, 21:50

And download the ZIP from GitHub, not from the releases page.
Screenshot 2024-09-26 214955.png
Screenshot 2024-09-26 214955.png (189.89 KiB) Viewed 2084 times

PandCall
Normal user
Posts: 57
Joined: 22 Sep 2022, 20:04

Re: PlatformIO and custom compilation

#8 Post by PandCall » 26 Sep 2024, 21:54

Yes, that's no problem, I'm used to it. ;)
Regards

User avatar
Ath
Normal user
Posts: 3954
Joined: 10 Jun 2018, 12:06
Location: NL

Re: PlatformIO and custom compilation

#9 Post by Ath » 26 Sep 2024, 22:00

Well, if you don't intend/expect to change any of the ESPEasy code, you can also clone the repository to your computer, either via a fork, as described in the Development docs, or directly from the letscontrolit/ESPEasy repository, like this: (you'll need to have git installed on your system)

Code: Select all

cd /development
git clone https://github.com/letscontrolit/ESPEasy
(NB: /development is just an example)
Then you can copy your Custom.h in the /development/ESPEasy/src folder, and use VSCode/PlatformIO to build the desired Custom environment.

To update your local repo, you would use these commands:

Code: Select all

cd /development/ESPEasy
git pull
Then you can just rebuild, as the Custom.h file is still intact, because it's excluded from git updates or commits.

IMHO, this method is less work and less error-prone than downloading and extracting a zip file ;)
/Ton (PayPal.me)

PandCall
Normal user
Posts: 57
Joined: 22 Sep 2022, 20:04

Re: PlatformIO and custom compilation

#10 Post by PandCall » 26 Sep 2024, 22:07

Thank you for all this additional information.
And you confirmed that there is no automatic update before compilation.
That was my question, and I have my answer.
Now it's up to me to maintain the local sources.
Best Regards

User avatar
Ath
Normal user
Posts: 3954
Joined: 10 Jun 2018, 12:06
Location: NL

Re: PlatformIO and custom compilation

#11 Post by Ath » 26 Sep 2024, 22:16

PandCall wrote: 26 Sep 2024, 22:07 And you confirmed that there is no automatic update before compilation.
Well, in VSCode there's the Sync button to update the repo, but that shouldn't be automatic, that should be up to you.
Screenshot - 26-09-2024 , 22_14_38.png
Screenshot - 26-09-2024 , 22_14_38.png (9.87 KiB) Viewed 2070 times
/Ton (PayPal.me)

PandCall
Normal user
Posts: 57
Joined: 22 Sep 2022, 20:04

Re: PlatformIO and custom compilation

#12 Post by PandCall » 26 Sep 2024, 22:24

I try

[Update]
I don't have this option


[Update 2]
my repository is probably not properly configured, I'm looking into it.
Attachments
Capture d’écran du 2024-09-26 22-31-29.png
Capture d’écran du 2024-09-26 22-31-29.png (15.53 KiB) Viewed 2067 times
Capture d’écran du 2024-09-26 22-32-18.png
Capture d’écran du 2024-09-26 22-32-18.png (24.33 KiB) Viewed 2067 times

User avatar
Ath
Normal user
Posts: 3954
Joined: 10 Jun 2018, 12:06
Location: NL

Re: PlatformIO and custom compilation

#13 Post by Ath » 26 Sep 2024, 22:42

You'll see that option when opening the cloned git repo locally, you won't get that on an unzipped directory structure
/Ton (PayPal.me)

PandCall
Normal user
Posts: 57
Joined: 22 Sep 2022, 20:04

Re: PlatformIO and custom compilation

#14 Post by PandCall » 26 Sep 2024, 22:47

Okay, I'll watch it quietly after a good night's sleep.
Regards

PandCall
Normal user
Posts: 57
Joined: 22 Sep 2022, 20:04

Re: PlatformIO and custom compilation

#15 Post by PandCall » 28 Sep 2024, 10:21

Until I fully understand the Update mode above and get things right, downloading the ZIP, deleting the folder, decompressing the ZIP and comparing Custom.h is fine for the moment.
I don't compile every day, but only occasionally when I'm testing a new project or adding a device.
Thanks for all your advice and help on this update issue.
Best Regards

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests