setCredentials WPA2 Password Length Requirement

Just thought I’d make a quick post as a PSA to help anyone who is struggling using WiFi.setCredentials() like I just did.

When setting a password for a WPA2 network, make sure you’re inputting something longer than 8 characters.

I was trying and failing to test a simple program calling this function, and couldn’t figure out why my test SSID of “hello” and test password of “world” were not saving to my photon’s memory. After more time + trial and error than I’d like to admit, I finally dug through the system firmware and found that it requires an 8 character password, but wasn’t creating an error that was evident as I was printing out to serial. Only then did I remember that 8 characters is the shortest password allowed with WPA2. duh. :man_facepalming:

Anyway, just thought I’d record this here in case anyone finds it helpful in the future. Happy coding!

3 Likes

Thank you for posting!