I recently built an ESP-Now project using Arduino IDE. Now, I want to recreate it using PlatformIO.
As before, the process includes getting MAC addresses of my two ESP boards, but I cant seem to find any information on how to add the WIFI.h library to my sketch. All the tutorials online use Arduino ide, where you just write the name of the library at the top of the sketch.
I know that in plaformIO you first need to add the library in the platformio.ini file after writing “lib_deps = “, but I don’t know what to write there. Just “lib_deps = wifi”?. Is this a default library that is added when you install platformIO or something that gets added when you choose the ESP board?
All help will be much appreciated.
Hi.
You don’t need to add libraries that are already included in the ESP32 core to the platformio ini file.
You should add the following line at the beginning of all your main.cpp files
#include <Arduino.h>
Let me know if this solves your problem or if you need further help.
Regards,
Sara
Hi Sara. Thank you for your reply.
I guess I didn’t make it clear enough.
As far as I understand, adding the Arduino.h library to the main.cpp sketch when uploading with platformIO is just a standard practice. What I want is to get a sketch that gives the MAC address of an esp board to run when uploaded using platformIO.
When uploading a sketch with the mentioned functionality using arduino IDE, we need to use a WiFi.h library, which we do by writing its name at the top of the said sketch. My question is what to write in the platformio.ini file when uploading a sketch using plaformIO?
Here: screenshot
thanks.
Hi.
That library is part of the ESP32 core by default. So, you don’t need to include it in the platformio.ini file.
Any library that you wouldn’t need to manually install in ArduinoIDE, you don’t need in platformIO either.
Are you getting any errors regarding that library?
I think there is an issue with the link you shared. I can’t see any image. Can you double-check it?
Regards,
Sara