Comments on: ESP32: Save Wi-Fi Credentials in a Separate File (and Other Sensitive Information) https://randomnerdtutorials.com/esp32-save-credentials-separate-file/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Wed, 26 Nov 2025 11:14:51 +0000 hourly 1 https://wordpress.org/?v=6.8.5 By: Sara Santos https://randomnerdtutorials.com/esp32-save-credentials-separate-file/#comment-1127622 Wed, 26 Nov 2025 11:14:51 +0000 https://randomnerdtutorials.com/?p=182174#comment-1127622 In reply to Blaine.

Thanks for sharing that solution for VS Code.
Regards,
Sara

]]>
By: Blaine https://randomnerdtutorials.com/esp32-save-credentials-separate-file/#comment-1127406 Tue, 25 Nov 2025 14:56:34 +0000 https://randomnerdtutorials.com/?p=182174#comment-1127406 In reply to Kamil.

This can be achieved in PlatformIO. VS Code and PlatformIO is all I use now.

Create a file somewhere outside your project folder like “C:\dev-secrets\wifi_credentials.h”. Added something like this to that file.

#define MY_SSID "my_ssid"
#define WIFI_PASS "password"

Then add this build flag in your platformio.ini.

build_flags =
-I C:/dev-secrets

Now you can include that file in your project.

#include “wifi_credentials.h”

]]>
By: Ed https://randomnerdtutorials.com/esp32-save-credentials-separate-file/#comment-1127371 Tue, 25 Nov 2025 12:37:09 +0000 https://randomnerdtutorials.com/?p=182174#comment-1127371 In reply to Kamil.

I am no platformio expert but I would think that can pull in xxxx.h files just as easy, so in my opinion it would work the same, but maybe a true Platformio expert can shine a light on it

]]>
By: Kamil https://randomnerdtutorials.com/esp32-save-credentials-separate-file/#comment-1127210 Mon, 24 Nov 2025 20:24:27 +0000 https://randomnerdtutorials.com/?p=182174#comment-1127210 Very nice and interesting Arduino topic and clear explanation.
But, what about VS Platformio. There is not header file MyLogin.h located in my PC only and in case of publishing whole project, this file could be revealed.

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-save-credentials-separate-file/#comment-1123444 Thu, 13 Nov 2025 16:20:37 +0000 https://randomnerdtutorials.com/?p=182174#comment-1123444 In reply to Ed.

Yes, it’s a good alternative.
Thanks for the suggestion.
Regards,
Sara

]]>
By: Ed https://randomnerdtutorials.com/esp32-save-credentials-separate-file/#comment-1122958 Wed, 12 Nov 2025 13:03:58 +0000 https://randomnerdtutorials.com/?p=182174#comment-1122958 Rather than having to change the ‘comment_out’ in the .h file, it might be easier to put the various sections (home, on the road, parents) in an IFDEF structure and when compiling the main ino file just add a line *define HOME” etc…

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-save-credentials-separate-file/#comment-1120695 Sat, 08 Nov 2025 11:02:45 +0000 https://randomnerdtutorials.com/?p=182174#comment-1120695 In reply to Blaine.

Thanks for your support.
Regards,
Sara

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-save-credentials-separate-file/#comment-1120690 Sat, 08 Nov 2025 10:58:25 +0000 https://randomnerdtutorials.com/?p=182174#comment-1120690 In reply to Gunther Jordan.

Hi.
No need to apologize and thank you for sharing your feedback.
New ideas are always welcome.
Regards,
Sara

]]>
By: Sara Santos https://randomnerdtutorials.com/esp32-save-credentials-separate-file/#comment-1120687 Sat, 08 Nov 2025 10:55:00 +0000 https://randomnerdtutorials.com/?p=182174#comment-1120687 In reply to Gunther Jordan.

Hi.
I’m sorry.
That was not our intention.
We were just showing one of the many ways you can do so that you don’t have to always have to write your credentials in all sketches.
I know it may seem basic and simple, but many beginners don’t know how to do it.

However, yours is a good suggestion. Maybe I’ll try to implement something like that, inside LittleFS in a future tutorial.
Regards,
Sara

]]>
By: Blaine https://randomnerdtutorials.com/esp32-save-credentials-separate-file/#comment-1120462 Sat, 08 Nov 2025 03:02:00 +0000 https://randomnerdtutorials.com/?p=182174#comment-1120462 In reply to Blaine.

You’re right. My apologies. Not sure why that hit a nerve. Love this site!

]]>