• 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 1 year 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 1 year 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 1 year 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 1 year 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 1 year ago

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

0 Vote Up Vote Down
Paul French answered 1 year 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] Firebase Web App with ESP32 and ESP8266 (version 1.2) April 25, 2022
  • [eBook Updated] MicroPython Programming with ESP32 and ESP8266 (version 1.3) February 7, 2022

You must be logged in to view this content.

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

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