Connecting to Arduini IOT cloud with no password?

Hi, Im cant connect to Arduino IOT cloud with no password, but with password, there`s no problem.
Arduino secrets header file looks like this:

#define SECRET_SSID "MY_USER_NAME"
#define SECRET_PASS ""
#define SECRET_DEVICE_KEY "XXXXXXXXXXXXXXXXXXX"

What should I do?

Hi @noobmastha. Are you using Wi-Fi? If so, this is the SSID and password of your Wi-Fi router. Unless you happen to have disabled password protection on your router, you will always need to provide the password in your sketch if you want your Arduino board to be able to connect to Arduino IoT Cloud through your router's connection to the Internet.

Put your password in. Problem solved!

And what board you are using?
At ESP8266 or ESP32 i simply call begin function with just ssid without password parameter, if WiFi is not password protected (WPA/WPA2-PSK).

So variants should be like...

WiFi.begin(ssid);
WiFi.begin(ssid, pass);

maybe third and fourth parameter is supported too at WEP WiFi networks, key and keyindex

I'm using esp8266.
Yes it's working with password, but to cut long story short, in my application, it's inconvenient to use a password, so I thought it could be done by code..?

Arduino connection handler is doing wifi job, as I understand?? ,

Can you explain why? If it's about changing the password at occasion, you can provide a means to change it (e.g. via the serial port).

So it's not possible to use Arduino iot cloud without password on the router ??

You shold show us your full program (without API key).
Because I haven't use Arduino IoT Cloud yet, so I don't know how that code looks like...

Yeah, I see that the "Arduino_ConnectionHandler" library does require the passphrase argument:

However, that should not be a problem. The "ESP8266WiFi" library uses a default parameter value to make this argument optional:

then uses that default value in the determination of whether the network is secured:

So you only need to pass NULL as the passphrase argument.

If you are using Arduino Web Editor, that will not be possible to do in the "Secret" tab because its form based interface only allows setting secrets as string literals, but you can just add it directly to your thingProperties.h file:

  WiFiConnectionHandler ArduinoIoTPreferredConnection(SECRET_SSID, NULL);

Or if you are developing your Thing sketch locally in the Arduino IDE then you can set it in the arduino_secrets.h file:

#define SECRET_PASS NULL

Thanks a Lot, I'll try that tomorrow. Btw, something strange is happening, few days ago I connected with SECRET_PASS " ", but only once, then I couldn't connect again..

You got it this is an answer, thanks a LOT.

btw,
<const char PASS[] = SECRET_PASS;>
should be deleted also.

You are welcome. I'm glad if you are able to connect your Arduino board to Arduino IoT Cloud now. Enjoy!