OpenWrt Forum Archive

Topic: Wifi client disconnects clicking on "Join Network"

The content of this topic has been archived on 7 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,

Board: AR-9344

a mobile device is connected to the board and browsing the GUI from it.
going to Network->Wifi->Scan. then clicking on any SSID's [Join Network] button, losses the connection with that mobile client device, so it doesn't lands on next page.

this does not happens while connecting with LAN wired pc.

Also let me know how to add console log messages in lua files.

(Last edited by amit.shah on 14 Sep 2015, 08:56)

I am assuming your router has a single WiFi radio?

If your mobile device is connected over WiFi to OpenWrt and then your perform a WiFi scan on the OpenWrt Router, you mobile device will get dropped, yes.

Your radio can't keep talking to the mobile device on 1 channel, and perform a scan on 11 (or 13) channels, and then attempt to connect to another channel after you click "Join Network" and keep the connection.  Not possible.

Regarding log messages, look for the "nixio.syslog" command for examples from other LUA files.

Yes, WiFi chip has one radio.

When i am doing the scan process its does not disconnects, the scan result with all SSID list appears on screen. but when i click the [Join Network] button its disconnects.

About your point of connecting to another channel;  but it happens same, even if we try to join with the same channel.

Maybe you should explain what you are actually trying to accomplish and then we can help point you in the right direction.

If you have the router configured as an AP, and you then try to scan networks and connect to them, why are you doing this?  What is the goal?  A repeater?

@amit.shah By default, your router is access point and your mobile phone is a client. If my understanding is correct, you are scanning other devices. Does that mean you want to connect to other access points or client(station)?

Hi,

Initial router configured as an LAN AP. So Any wireless device can connect to it, Then we scan the device and the scan result with all SSID list appears on screen and then Connect to SSID and join the network, joining to other SSID We create separate client(station) and connect to it.

Basically we need to configure the Wireless module as LAN SSID and client(station WDS). So our module will connect to other AP/hotspot and at the same time Any smartphone/laptop can connect to our module.

Hi @JohnV & @k.teza1,

please consider @afkar.ec's replies on behalf of me. we both together working on same issue as above.

Using a single radio, to act as both a client and an AP at the same time, AFAIK the only option is a "repeater"

https://forum.openwrt.org/viewtopic.php?id=39077

If you want 2 independent networks, one AP and one client, you need 2 radios.

This post motivated me to finish a post I have been working on for a few weeks now.  https://forum.openwrt.org/viewtopic.php?id=59678  While it appears based upon the Table of Hardware that this device is not a travel router, the basic conditions still apply.  I posted this in General as I am not a developer.  If I should re post it here please let me know.

The fundamental issue is that a with a single radio the WWAN and WLAN network settings need to be the same.  The configs as referenced by JohnV are the AP solutions.  If you need separate channels, then again as JohnV sasy, you need 2 radios.  I have done this in my HooToo TMo2, and use a EDImax 7811. https://forum.openwrt.org/viewtopic.php?id=58548  It is slower than the internal radio when all is ideally configured, but not so much in my case that I care.  @frietpan has a much slower speed on the same hardware and we do not know why.  The particular device is a micro receiver, I am sure you can find others that have larger antennas.

This issue is discussed recently in general discussions by myself and @frietpan here https://forum.openwrt.org/viewtopic.php?id=59448 and in other posts.  There has been some bug reporting on the way the wireless functionality fails when the WWAN side SSID is not available.  this all relates to the basic issue about needing to use 2 radios.

I am confused about your config.  When you refer to the wireless module are you referring the the AR-9344 as part of a system you are building?

Am I correct that you have a number of these AR-9344s that you want to talk to each other via WDS and get that some place on the system is a router that is the DHCP server and supports the WDS.  You then want to connect via mobile device to any of the AR-9344 boards uniquely via it's own AP to manage the specific device?

Not sure it these pages will also help
http://trac.gateworks.com/wiki/OpenWrt/wireless/relayd
http://trac.gateworks.com/wiki/OpenWrt/ … ess_bridge

Hi JohnV & RangerZ,

Thanks a lot for the reply. Yes we are using AR9344.

We will explain our scenario in details:

Initially we configure the wireless config file as below:
config wifi-device 'wifi0'
        option type 'qcawifi'
        option macaddr '00:26:75:bd:37:24'
        option hwmode '11ng'
        option txpower '16'
        option htmode 'HT20'
        option disabled '0'
        option channel '11'

config wifi-iface
        option device 'wifi0'
        option mode 'ap'
        option ssid 'LANSSID'
        option network 'lan'
        option encryption 'psk2'
        option key 'LANSSID_2.4'
        option vap_ind '1'
        option athnewind '1'
        option scanband '1'
       
and network file :
        config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config interface 'lan'
        option ifname 'eth0.1 eth1'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.5.1'
        option netmask '255.255.255.0'

config interface 'wan'
        option ifname 'eth0.2'
        option proto 'dhcp'

config switch
        option name 'eth0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'eth0'
        option vlan '1'
        option ports '0t 2 3 4 5'

config switch_vlan
        option device 'eth0'
        option vlan '2'
        option ports '0t 1'

config switch
        option name 'eth1'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'eth1'
        option vlan '1'
        option ports '0 1 2 3 4 5'
       
So this works fine as AP mode.

-----------------------------------------------------------------------

Then we scan the network and join one of the wireless AP/hotspot.
We configure the wireless config file as below:
        config wifi-device 'wifi0'
        option type 'qcawifi'
        option macaddr '00:26:75:bd:37:24'
        option hwmode '11ng'
        option txpower '16'
        option htmode 'HT20'
        option disabled '0'
        option channel '11'

config wifi-iface
        option device 'wifi0'
        option mode 'ap'
        option ssid 'LANSSID'
        option network 'lan'
        option encryption 'psk2'
        option key 'LANSSID_2.4'
        option vap_ind '1'
        option athnewind '1'
        option scanband '1'

config wifi-iface
        option network 'wwan'
        option ssid 'WirelessRouter'
        option encryption 'psk2'
        option device 'wifi0'
        option mode 'sta'
        option key '0009593460'
        option wds '1'
       
and network file:
    config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config interface 'lan'
        option ifname 'eth0.1 eth1'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.5.1'
        option netmask '255.255.255.0'

config interface 'wan'
        option ifname 'eth0.2'
        option proto 'dhcp'

config switch
        option name 'eth0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'eth0'
        option vlan '1'
        option ports '0t 2 3 4 5'

config switch_vlan
        option device 'eth0'
        option vlan '2'
        option ports '0t 1'

config switch
        option name 'eth1'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'eth1'
        option vlan '1'
        option ports '0 1 2 3 4 5'

config interface 'wwan'
        option proto 'dhcp'

If we do this process using wired connection everything works fine, we are join the other network. but when we use wireless to configure this process during joining the wireless AP its disconnect the connection because the during connecting the OpenWrt change the /etc/config/network, /etc/config/dhcp etc.. file.

If we try to connect to wireless AP of same network also it disconnect the connection using wireless.

Sorry for the very lengthy post, but it is just trying to word down the scenario that I am looking at to configure the wifi module.

Mainly we have to configure for AP and router mode at same time.

Could you pleas suggest can we do this process using wireless connection.

(Last edited by afkar.ec on 17 Sep 2015, 03:49)

Perhaps it's an issue of your client device not re-connecting automatically back to the AP after the AP WiFi network comes back online.

Try on a device that has no other WiFi networks "known" by it ("forget" all of them except your AP), and see if the client will re-connect when the AP comes back online.  Not sure it will re-connect fast enough to allow the UI to load the next page, but the device should re-connect and at least provide access to the WWAN side of the connection.

I don't think there is anyway to avoid a disconnect from the AP to the client when you perform the Join Network.  That being the case, the issue lies with the client not re-connecting automatically and/or quickly enough.

Have you tried this with WDS off?  I realize that does not solve your problem in the bigger picture.

Hi JohnV & RangerZ,

Thanks for the reply,

Yes its reconnecting but by the time it reconnect the UI page would not be there, so the process is not completing. Some Strange things is happening When we use the laptop accessing the GUI via wireless then it will complete the process.

I tried without wds but the same problem we are facing.

Hi @JohnV,

yes, it is been observed that the wifi client;

  1. if it is a laptop/pc, then mostly are patient enough to wait a while after the disconnection.

  2. whereas if the client are mobile device, it immediately shows the disconnection message popped-up by the OS (Android/IOS). if it is IOS then the disconnection is quick and not trying to even reconnect it.

what ever at the client side issues, we can't expect the end user and the vendor to adjust with this problem. big_smile
so we need to reach to the conclusion. whether it is possible to eliminate this issue or some other solution without making the end user adjust for the device in odd way. roll

Thanks all of you for your regular replies.

(Last edited by amit.shah on 18 Sep 2015, 02:48)

I don't think it is possible to re-configure a single physical radio and not cause a drop in the WiFi connection.  I don't believe this is a fault of OpenWRT, it is simply a limitation of using a single radio to perform two tasks (AP and Client).    You would be better off using a 2 radio device and then this problem is not a problem.  Probably not an easy solution, but likely the only one.

Thanks JohnV, for your support and replies.

however, our think tank leaders still don't accepts this disconnection issue, according to them it must be handled using some coding to stop the disconnection before the web query completes. at least it should send some response to the webpage back before the AP disconnects. so please let me know how can i find that bunch of code and put some log to know where exactly it happens, and what all we can do.

i remembered told something about "nixio.syslog", let me find tutorial how to use it.

The discussion might have continued from here.