How to reconnect wifi after router reboot or other network issue?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to reconnect wifi after router reboot or other network issue?

2,088 次查看
Jarpba
Contributor II

I'm using mqx3.7 and redpine rs2101 wifi module. I can connect to wifi network without any problems and the connection works like it should. When I power off my router, wifi driver correctly sees the loss of connectivity

 

****** JOIN FAIL *****
RS2101 wireless link is down

But it never tries to reconnect. If I try to manually call iwcfg_set_scan again, it founds the network and says NETWORK JOIN DONE but then it stucks.

 

I wish there would be a way to start initializing the network connection from the beginning but I haven't found a way. Any advice on that? Or other ways to reconnect wifi without rebooting the whole system?

 

 

标签 (1)
标记 (1)
0 项奖励
回复
4 回复数

1,775 次查看
Tarun_redpine
Contributor III

Hello

 

Once the module lost the connection it tries to rejoin.

Did you try to apply the redpine patch?

https://www.freescale.com/webapp/Download?colCode=FSLMQXOS_3_7_REDPINE_PATCH&location=null&fsrch=1&s...

Let me know if problem persists even after applying the patch.

 

0 项奖励
回复

1,775 次查看
Jarpba
Contributor II

Hi there! My application now reconnects successfully, using patch for 3.7. I had some unnecessary wifi driver related calls in the code before calling iwcfg_set_scan after Adapter_g->event_type has become DEAUTH. Now that part seems to work.

 

However, a new problem seems to be in the wifi initialization part if the network with specified ssid is not available. In such a case iwcfg_set_scan hangs and the system only recovers after watchdog resets it. If I turn the network on while iwcfg_set_scan is waiting it never finds the network (only finds it if the network is available when set_scan is called). My wifi initialization routine goes as follows (simplified):

 

RTCS_create(); IPCFG_default_enet_device = BSP_RSI_WIFI_DEVICE; ipcfg_get_mac(IPCFG_default_enet_device, IPCFG_default_enet_address); //seems to get correct mac for wifi device instead of using ENET_get_mac_addressipcfg_init_device(IPCFG_default_enet_device, IPCFG_default_enet_address);iwcfg_set_passphrase(IPCFG_default_enet_device,CFG_WIFI_PASSWORD);iwcfg_set_essid(IPCFG_default_enet_device,CFG_WIFI_SSID); //comment this to get list of networks instead of joining one directlyiwcfg_set_scan(IPCFG_default_enet_device,CFG_WIFI_SSID);

 


 

If I comment the row where ssid is set, then it properly lists all available networks, but I would like to wait for the specified network to become available and then join it. Some configurable timeout would be nice as well.

 


 

0 项奖励
回复

1,775 次查看
Tarun_redpine
Contributor III

Hello There... If the module is not able to scan that SSID after some time it gives the error "AP not found".

You can use that error or error code and can implement your logic accordingly to rescan or whatever you want to do next.

Hope my answer helps.

 

0 项奖励
回复

1,775 次查看
slaroche
Contributor II

I am trying to restart the initialization sequence using "ENET_shutdown()".  So far, I did not succeed.  I am thinking that maybe I will need to do some modification in the rs21 driver.

0 项奖励
回复