• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

How to structure PlatformIO for multiple related projects

Q&A Forum › Category: Other › How to structure PlatformIO for multiple related projects
0 Vote Up Vote Down
Paul French asked 4 years ago

Hi Sara,
I am trying to build a system to record sensor readings from multiple ESP32, using your tutorial on ESP Now. https://randomnerdtutorials.com/esp-now-two-way-communication-esp32/ 
I’d prefer to use VS with PIO, but I am puzzled trying to figure out how I can have multiple main.cpp in the same project in order to keep track of the 3 x ESP32’s separate code.  
Furthermore, I am using GitHub with VS and I’d like to get the setup right from the start.
What is the best practice to maintain a project like this with multiple ESP?
Many thanks
Paul

Question Tags: Visual Studio
5 Answers
0 Vote Up Vote Down
Steve Mercer answered 4 years ago

It appears from this post that you would structure different environments. Basically you would have main1.cpp, main2.cpp etc and each environment would compile each file separately and upload to a different COM port. Note specifically the way you exclude other files with “src_filter”.

0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Hi Paul.
 
Did Steve’s suggestion help?
 
Alternatively, you can create multiple projects on the same workspace and then, select which project you want to upload to which board. However, Steve’s suggestion seems a better choice for that specific example (but I haven’t tried it myself yet).
 
Regards,
Sara

0 Vote Up Vote Down
Paul French answered 4 years ago

Thank you Steve and Sara.  The separate project and shared workspace looks simpler but I will try Steve’s solution also and see if I can get that to work.  I want to use OTA and wonder if that will work using multiple main.cpp files.
Thanks again Paul
 

0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Hi Paul.
Can I mark this issue as resolved?
Regards,
Sara

0 Vote Up Vote Down
Paul French answered 4 years ago

Yes thank you Sarah.

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.