6 Replies Latest reply on Oct 23, 2018 10:23 PM by cohuc_3807591

    Dynamic AP switching question

    cohuc_3807591

      Hey all - a few questions about dynamic switching of APs. Some background: the app should be able to switch between 2 or 3 networks. All the networks are static (static ssid and wpa2 keys).

       

      1. Is there a way to do this using the high level APIs? One method I can think of is to call wiced_network_down and then edit the DCT and then use the new settings in a subsequent call to network_up. This is much more work than optimal though - is there a way to add multiple entries to the DCT and select between them at runtime?

      2. I have seen the lower level wwd functions to join a specific ap, but I haven't had much success using these so far. Is there a defined process to using these to establish the connection other than using the single function call? (I want to use the APs DHCP server)

       

      I sincerely appreciate the help, i'm getting a little lost in with unfamiliar WICED stuff. The higher level wiced API methods would be preferred, but if that's not possible i'm fine doing whatever works.

        • 1. Re: Dynamic AP switching question
          ZhengbaoZ_96

          Hi:

          Can you have a try with command console ?  we have commands like:

           

           

          { (char*) "join", join, 2, NULL, NULL, (char*) "<ssid> <open|wpa_aes|wpa_tkip|wpa2|wpa2_tkip|wpa2_fbt> [key] [channel] [ip netmask gateway]"ESCAPE_SPACE_PROMPT, (char*) "Join an AP. DHCP assumed if no IP address provided"}, \

            { (char*) "leave", leave, 0, NULL, NULL, (char*) "", (char*) "Leave an AP."}, \

           

          you can have a test by using below commands:

           

          join apname wpa2 153 192.168.1.51 255.255.255.0 192.168.1.35

          leave

          1 of 1 people found this helpful
          • 2. Re: Dynamic AP switching question
            cohuc_3807591

            Hey Zhez:

             

            I have been able to use the join command in the console previously - however the application i'm working on will need to switch APs completely autonomously, so I cant use the console in deployment. Is there another option? This functionality is critical to the app.

             

            Ill add an update to the question - yesterday I managed to be able to edit the DCT to reorder the AP list in trying to reconnect but I ran into the same issue mentioned in Re: Unable to bring network down. The DCT edit worked fine, but the call to wiced_network_down() returns error code 4 and I cannot join again. This is weird because if the call to network_down comes immediately after network_up, the network comes down successfully. My error came after I had opened and closed a TCP socket.

             

            I appreciate the response.

            • 3. Re: Dynamic AP switching question
              ZhengbaoZ_96

              Hi:

              switch APs completely autonomously .

              means: you change the DCT, and use network down and up function to join different AP ?

              if so , if the failure will occur on the first AP in the process network_down?

              1 of 2 people found this helpful
              • 4. Re: Dynamic AP switching question
                cohuc_3807591

                Zhez - it seems to me from your reply that you didn't understand what I said, so I will reiterate the purpose. yes, the application HAS to be able to switch APs autonomously. What I want at the most basic level is a solution to do so, and if possible, 2 ways to do so with both the high and low level APIs.

                 

                In trying to accomplish that goal, I tried the method described in my last reply. The join of the first AP works flawlessly - I can connect and send TCP packets to a server. However, the process of switching to another AP doesn't work, for the reasons described above. Ill restate and try to be more clear.

                     1. I am running into the error described in this thread Re: Unable to bring network down that went unresolved. (was there ever a      followup with that user?) because the call to network_down returns an error. That means that no matter what I do after that, I will be      unable to switch the AP.

                     2. So my question then becomes - Is this the recommended way to switch APs? (again, please recommend some ways to do this) and can      someone look back at the old thread and try to find the issue with the network_down calls?  

                • 5. Re: Dynamic AP switching question
                  ZhengbaoZ_96

                  Hi:

                        please add this function into wwd_wifi.c

                  before set to down, please add disassoc command for a try .

                  WLC_DISASSOC ,  and I think if you just want to switch to another AP , disassoc is enough .

                  wwd_result_t wwd_wifi_disassoc( void )

                  {

                      if (wwd_wlan_status.state != WLAN_UP)

                      {

                  WPRINT_WWD_INFO(("wwd_wifi_set_down: already down.\n"));

                  return WWD_INTERFACE_NOT_UP;

                      }

                   

                      /* Send DOWN command */

                      CHECK_RETURN( wwd_wifi_set_ioctl_void( WLC_DISASSOC, WWD_STA_INTERFACE ) );

                   

                      /* Update wlan status */

                  //   wwd_wlan_status.state = WLAN_DOWN;

                   

                      return WWD_SUCCESS;

                  }

                  2 of 2 people found this helpful
                  • 6. Re: Dynamic AP switching question
                    cohuc_3807591

                    Hey Zhez - thanks for the update, this is exactly what I was hoping for. Give me a few days to try it out and i'll get back to to you if all is good.