PlatformIO Community

How to amend a file in a library

I’m using Hieromon/Autoconnect to create a captive portal.
On Arduino IDE I amended the file AutoConnectDefs.h line 87 from:
#define AUTOCONNECT_APID “esp32ap”
#define AUTOCONNECT_APID “Captive”
How can I reproduce this with PlatformIO?

Try adding this build flag: -DAUTOCONNECT_APID=\"Captive\" to platformio.ini.
If you have no other build flags, this line in the [env:...] section should do the trick:

build_flags = -DAUTOCONNECT_APID=\"Captive\"

(the extra backslashes will probably be needed to get a quoted string into the #define)

1 Like

Hi jcw,

Thanks for the reply :slight_smile:
Digging through Hieromon’s library, I found mylabels.h, which explains how to do it.
I put the link here in case you’re curious and looking for a clean way to do it.
Have a great day and happy holidays.