Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tcp_server example always get bad auth error with WPA2/AES #408

Open
Claghorn opened this issue Jul 22, 2023 · 1 comment
Open

tcp_server example always get bad auth error with WPA2/AES #408

Claghorn opened this issue Jul 22, 2023 · 1 comment

Comments

@Claghorn
Copy link

I built the tcp_server example (the background version, not the poll version) with double and triple checked SSID and password and the connect always fails with a bad auth error. (I did modify the printf to print the error code, which is how I know it is bad auth).

If I set up a guest network with no security, the example works fine.

Then I tried the micropython code from https://projects.raspberrypi.org/en/projects/get-started-pico-w/2 and it has no problem connecting with WPA2/AES, so somewhere in micropython or picozero.py it knows something the tcp_server.c code doesn't know.

Sure be nice to have a working C code example.

@Claghorn
Copy link
Author

Revelation! The example program is fine, but the cmake stuff (which is totally obscure to me) does not manage to get the environment variables for WIFI_SSID and WIFI_PASSWORD all the way into the program as strings. If I add this near the top of the code, the program then compiles and works perfectly:

#undef WIFI_SSID
#define WIFI_SSID "ExampleSSID"
#undef WIFI_PASSWORD
#define WIFI_PASSWORD "ExamplePassword"

(Substituting the actual ssid and password in the real code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant