# Adding SSID and Password without using 'secrets tab'

**URL:** <https://forum.arduino.cc/t/adding-ssid-and-password-without-using-secrets-tab/1343535>\
**Category:** Cloud Editor\
**Created:** [January 16, 2025, 10:17pm UTC](https://forum.arduino.cc/t/adding-ssid-and-password-without-using-secrets-tab/1343535 "2025-01-16T22:17:24Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![isaac\_boyd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/isaac_boyd/32/1163597_2.png) [@isaac\_boyd](https://forum.arduino.cc/u/isaac_boyd)\
**Post date:** [January 16, 2025, 10:17pm UTC](https://forum.arduino.cc/t/adding-ssid-and-password-without-using-secrets-tab/1343535/1 "2025-01-16T22:17:24Z")

</div>

Hi, I was trying to remotely run an led using an uno r4 wifi and I noticed that when I used the 'Secrets Tab' for my wifi info when I used A 9 volt and the non usb power port (so it was not connected to my laptop) it would not work. here's the code that i'm working with

```arduino
#include "thingProperties.h"

void setup() {
  Serial.begin(9600);
  
  delay(1500); 

  
  initProperties();

  
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  

  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();
  pinMode(13, OUTPUT);
}

void loop() {
  ArduinoCloud.update();
  digitalWrite(13, led);
}

void onLedChange() {
  Serial.print("Led status changed:");
  Serial.println(led);
}

```

And here's thingProperties.h

```arduino
#include <ArduinoIoTCloud.h>
#include <Arduino_ConnectionHandler.h>

const char SSID[] = "mySSID"; // I had my actual wifi SSID and password. 
const char PASS[] = "myPassword";    

void onLedChange();

bool led;

void initProperties(){
  ArduinoCloud.addProperty(led, READWRITE, ON_CHANGE, onLedChange);
}

WiFiConnectionHandler ArduinoIoTPreferredConnection(SSID, PASS);

```

---

<div class="post-metadata">

**Author:** ![sonofcy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sonofcy/32/1283617_2.png) [@sonofcy](https://forum.arduino.cc/u/sonofcy)\
**Post date:** [January 16, 2025, 10:49pm UTC](https://forum.arduino.cc/t/adding-ssid-and-password-without-using-secrets-tab/1343535/2 "2025-01-16T22:49:35Z")

</div>

Use a more powerful battery like 6 x AA pack. Still 9V but a lot more Watts (power)

---

<div class="post-metadata">

**Author:** ![isaac\_boyd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/isaac_boyd/32/1163597_2.png) [@isaac\_boyd](https://forum.arduino.cc/u/isaac_boyd)\
**Post date:** [January 17, 2025, 1:35am UTC](https://forum.arduino.cc/t/adding-ssid-and-password-without-using-secrets-tab/1343535/3 "2025-01-17T01:35:29Z")

</div>

I’ve used the same power supply on many different projects and it’s a new 9 volt. I don’t think that’s the problem. All I'm running is a red LED, so it uses not much voltage to run it anyway.

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [January 17, 2025, 1:48am UTC](https://forum.arduino.cc/t/adding-ssid-and-password-without-using-secrets-tab/1343535/4 "2025-01-17T01:48:53Z")

</div>

> [@isaac\_boyd](#):
>
> it would not work

That is a vague description of your problem. How do you know that it's not working?

Are you saying that if you move the content of the secrets tab to the main ino file it all works?

For testing purposes I would use a 9V wall wart instead of a 9V battery.

Note:  
It's not only the LED, it's the full board as well that needs to be powered. And WiFi chips are known to be power hungry, And that is something that a 9V PP3 battery can not provide.

---

<div class="post-metadata">

**Author:** ![sonofcy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sonofcy/32/1283617_2.png) [@sonofcy](https://forum.arduino.cc/u/sonofcy)\
**Post date:** [January 17, 2025, 2:24am UTC](https://forum.arduino.cc/t/adding-ssid-and-password-without-using-secrets-tab/1343535/5 "2025-01-17T02:24:43Z")

</div>

Ok, good luck with that.

---

<div class="post-metadata">

**Author:** ![isaac\_boyd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/isaac_boyd/32/1163597_2.png) [@isaac\_boyd](https://forum.arduino.cc/u/isaac_boyd)\
**Post date:** [January 17, 2025, 3:08pm UTC](https://forum.arduino.cc/t/adding-ssid-and-password-without-using-secrets-tab/1343535/6 "2025-01-17T15:08:12Z")

</div>

My problem is that I can’t figure out how to put the Wi-Fi information in the sketch not in the secrets tab. I’ve used the same power supply on other projects and it work just fine. But thanks for trying to help.

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [January 17, 2025, 3:53pm UTC](https://forum.arduino.cc/t/adding-ssid-and-password-without-using-secrets-tab/1343535/7 "2025-01-17T15:53:54Z")

</div>

> [@isaac\_boyd](#):
>
> My problem is that I can’t figure out how to put the Wi-Fi information in the sketch not in the secrets tab.

Lets assume that your sketch contains the following line

```cpp
const char SSID[] = SECRET_SSID;

```

and your secrets tab contains

![image](https://europe1.discourse-cdn.com/arduino/original/4X/4/5/d/45d3642dff12693e9bacbe8d88355e4780dbc653.png)

In that case you can change the line in the sketch to

```cpp
const char SSID[] = "yourSSID";

```

Repeat for any other `SECRET_xxx`.

You can keep the secrets tab in the editor, the information will be ignored.

> [@isaac\_boyd](#):
>
> I’ve used the same power supply on other projects and it work just fine.

Did the other projects involve WiFi? Are you using a battery (our assumption) or a power supply?

---

<div class="post-metadata">

**Author:** ![isaac\_boyd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/isaac_boyd/32/1163597_2.png) [@isaac\_boyd](https://forum.arduino.cc/u/isaac_boyd)\
**Post date:** [January 17, 2025, 6:00pm UTC](https://forum.arduino.cc/t/adding-ssid-and-password-without-using-secrets-tab/1343535/8 "2025-01-17T18:00:46Z")

</div>

I have done projects using wifi and the same 9 volt battery power supply, I just completely forgot how to do it and sometime that sketch got deleted. And since that I could not figure it out again. I remember that I had the wifi info in the sketch NOT thingProperties.h. Here's the code that i need to edit tom add the wifi Info.

```arduino
#include "thingProperties.h"

const char SSID[] = "mySSID"; //My problem is that I do not remember how to enter the wifi info.
const char PASS[] = "myPassword"; //Is it in () or "" or what?

void setup() {
  Serial.begin(9600);
  
  delay(1500); 

  
  initProperties();

  
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  

  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();
  pinMode(13, OUTPUT);
}

void loop() {
  ArduinoCloud.update();
  digitalWrite(13, led);
}

void onLedChange() {
  Serial.print("Led status changed:");
  Serial.println(led);
}

```

At first i thought it would be in the thingProerties.h then i remembered that I had had it in the scetch its self.

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [January 18, 2025, 6:08am UTC](https://forum.arduino.cc/t/adding-ssid-and-password-without-using-secrets-tab/1343535/9 "2025-01-18T06:08:10Z")

</div>

> [@isaac\_boyd](#):
>
> Here's the code that i need to edit tom add the wifi Info.

I can't help you with that, sorry. No experience with your board, no real experience with WiFi and no experience with the cloud stuff.

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [January 18, 2025, 8:22am UTC](https://forum.arduino.cc/t/adding-ssid-and-password-without-using-secrets-tab/1343535/10 "2025-01-18T08:22:24Z")

</div>

Hi @isaac_boyd.

> [@isaac\_boyd](#):
>
> I can’t figure out how to put the Wi-Fi information in the sketch not in the secrets tab.

You have already accomplished that with the changes you made to lines 4 and 5 of your `thingProperties.h` file:

> [@isaac\_boyd](#):
>
> And here's thingProperties.h
> 
> ```cpp
> #include <ArduinoIoTCloud.h>
> #include <Arduino_ConnectionHandler.h>
> 
> const char SSID[] = "mySSID"; // I had my actual wifi SSID and password. 
> const char PASS[] = "myPassword";    
> 
> ```

When the Thing sketch uses the configuration from the ["Secret" tab](https://docs.arduino.cc/arduino-cloud/cloud-editor/store-your-sensitive-data-safely-when-sharing), as is the case with the `thingProperties.h` code that is generated by Arduino Cloud when you create a Thing, those lines look like this:

```cpp
const char SSID[] = SECRET_SSID; // Network SSID (name)
const char PASS[] = SECRET_OPTIONAL_PASS; // Network password (use for WPA, or use as key for WEP)

```

(`SECRET_SSID` and `SECRET_OPTIONAL_PASS` are macros automatically defined from the configuration in the "Secret" tab)

So if you are still experiencing the problem even after uploading the sketch with the modified `thingProperties.h` code you shared in [**post #1**](https://forum.arduino.cc/t/adding-ssid-and-password-without-using-secrets-tab/1343535), then this disproves your hypothesis that the problem was caused by the use of the "Secret" tab. Now it is time to forget about the "Secret" tab and focus your attention on the more likely cause of the fault:

> [@isaac\_boyd](#):
>
> I used A 9 volt

> [@isaac\_boyd](#):
>
> I’ve used the same power supply on other projects and it work just fine.

The amount of power required for stable operation of the Wi-Fi radio on the UNO R4 WiFi board can vary according to the environment. It very well might be that when it was working before the conditions were more favorable and so the radio didn't require as much power to communicate with the Wi-Fi access point as it does now and thus was able to get by with the marginal power provided by the battery.

So please, take the suggestion of the other helpers and check whether the problem still occurs if you use a more appropriate power supply.

> [@isaac\_boyd](#):
>
> ```cpp
> #include "thingProperties.h"
> 
> const char SSID[] = "mySSID"; //My problem is that I do not remember how to enter the wifi info.
> const char PASS[] = "myPassword"; //Is it in () or "" or what?
> 
> ```

You are wasting your time trying to move the Wi-Fi credentials to the `.ino` file. You already accomplished your goal of avoiding the use of the "Secret" tab through your changes to the code in the `thingProperties.h` file.

If you removed those lines from the `thingProperties.h` file and then delete the lines from the `.ino` file.

---

<div class="post-metadata">

**Author:** ![isaac\_boyd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/isaac_boyd/32/1163597_2.png) [@isaac\_boyd](https://forum.arduino.cc/u/isaac_boyd)\
**Post date:** [January 18, 2025, 1:59pm UTC](https://forum.arduino.cc/t/adding-ssid-and-password-without-using-secrets-tab/1343535/11 "2025-01-18T13:59:18Z")

</div>

Well thanks for trying.

---

<div class="post-metadata">

**Author:** ![isaac\_boyd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/isaac_boyd/32/1163597_2.png) [@isaac\_boyd](https://forum.arduino.cc/u/isaac_boyd)\
**Post date:** [January 18, 2025, 4:13pm UTC](https://forum.arduino.cc/t/adding-ssid-and-password-without-using-secrets-tab/1343535/12 "2025-01-18T16:13:47Z")

</div>

I tried using a non data transfer usb-c cable so it had full power it needed but it could not access the secrets tab on my computer, and guess what it didn't work! And as I said in post #8 I had at one point done this and then the sketch got deleted and I completely forgot how to do it.

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [January 18, 2025, 11:54pm UTC](https://forum.arduino.cc/t/adding-ssid-and-password-without-using-secrets-tab/1343535/13 "2025-01-18T23:54:28Z")

</div>

> [@isaac\_boyd](#):
>
> it could not access the secrets tab on my computer

The "Secret" tab feature is specific to **Arduino Cloud Editor** :

[https://docs.arduino.cc/arduino-cloud/cloud-editor/store-your-sensitive-data-safely-when-sharing](https://docs.arduino.cc/arduino-cloud/cloud-editor/store-your-sensitive-data-safely-when-sharing)

If you are using Arduino IDE, you can either replace the secret macros in `thingProperties.h`, as you did in code you shared in [**post #1**](https://forum.arduino.cc/t/adding-ssid-and-password-without-using-secrets-tab/1343535/1), or you can define the secret macros via `#define` directives in the `arduino_secrets.h` file of the sketch:

```cpp
#define SECRET_OPTIONAL_PASS "mySSID"
#define SECRET_SSID "myPassword"

```

You might also need to add an `#include "arduino_secrets.h"` directive to the `thingProperties.h` code. **Cloud Editor** is supposed to add this to the sketch when you download it, but I see that feature is broken right now.

> [@isaac\_boyd](#):
>
> it didn't work!

Please provide a detailed description of what you mean by this in a reply on this forum thread, including:

- What did you do?
- What were the results you expected from doing that thing?
- What were the results you observed that did not match your expectations?

Make sure to include the full and exact text of any error or warning messages you might have encountered.

---

<div class="post-metadata">

**Author:** ![david\_2018](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/david_2018/32/1013044_2.png) [@david\_2018](https://forum.arduino.cc/u/david_2018)\
**Post date:** [January 19, 2025, 12:10am UTC](https://forum.arduino.cc/t/adding-ssid-and-password-without-using-secrets-tab/1343535/14 "2025-01-19T00:10:38Z")

</div>

> [@isaac\_boyd](#):
>
> so it had full power it needed but it could not access the secrets tab on my computer

The Arduino board does not access the secrets tab at run time, it is accessed by the compiler when you compile/upload the code.

The only reason there is a secrets tab is so that your wifi credentials do not appear in the sketch itself. That makes it easier to share the sketch with someone else without accidentally revealing the SSID/password to your network.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [July 18, 2025, 12:10am UTC](https://forum.arduino.cc/t/adding-ssid-and-password-without-using-secrets-tab/1343535/15 "2025-07-18T00:10:42Z")

</div>

Closed on July 18, 2025, 12:10am UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
