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?
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”.
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).
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