• 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

Getting the get_mac_adress sketch to run when uploaded from platformIO

Q&A Forum › Category: ESP32 › Getting the get_mac_adress sketch to run when uploaded from platformIO
0 Vote Up Vote Down
Timur Izmailov asked 2 years ago

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.

Question Tags: Esp-now
5 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

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

0 Vote Up Vote Down
Timur Izmailov answered 2 years ago

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.

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

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

0 Vote Up Vote Down
Timur Izmailov answered 2 years ago

Ok, I think I got it.
Thanks a lot, Sara

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

Is everything working as expected?
Or do you need further help?
Regards,
Sara

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

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 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.