So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By drewle
#59094 Hi,
I'm working with:
xtensa-lx106-elf-gcc (GCC) 4.8.2
SDK v2.0.0 (No RTOS)

I want to connect to my rooter with WPA2-personal. What I'm doing is the following in user_init:
Code: Select all   u1_Status = wifi_station_set_auto_connect(0);
   os_printf("wifi_station_set_auto_connect(0) %u\r\n",u1_Status);

   u1_Status = wifi_set_opmode_current(STATION_MODE);
   os_printf("wifi_set_opmode_current(STATION_MODE) %u\r\n",u1_Status);

   os_printf("ssid: %s\r\n",stationConfig.ssid);
   os_printf("password: %s\r\n",stationConfig.password);
   os_printf("bssid_set: %u\r\n",stationConfig.bssid_set);
   os_printf("bssid: %s\r\n",stationConfig.bssid);
   u1_Status = wifi_station_set_config(&stationConfig);
   os_printf("wifi_station_set_config %u\r\n",u1_Status);

   wifi_set_event_handler_cb(wifi_event_handler_cb);

   u1_Status = wifi_station_connect();
   os_printf("wifi_station_connect %u\r\n",u1_Status);


The selected SSID and password should be right. bssid_set is set to 0.
wifi_station_connect() always returns false.

What am I doing wrong?
Is there somewhere an example? (I only found examples for Ardoino, which doesn't help me.)

Thanks
drewle