4 Replies Latest reply on Aug 26, 2014 9:03 AM by userc_6496

    How to connect to a specific Wi-Fi network in WICED programmatically?

      I want to implement an auto-join application that connects to a specific Wi-Fi network when it is discovered. How to do this in WICED programmatically?

        • 1. Re: How to connect to a specific Wi-Fi network in WICED programmatically?

          To be able to implement an auto join to an access point, the first step would be to use WICED’s scan API, wiced_wifi_scan_networks( ). This function works by passing the address of a callback function to it. The function is called by WICED whenever a nearby access point is discovered. WICED passes the following information about the scanned access point:

           

          1. Security type
          2. Channel
          3. BSSID
          4. Signal Strength (RSSI)
          5. Indication if scanning is complete

           

          Using the specified SSID and password, try to look for any match against the scanned access points. If a match is found, joining the access point can be done by populating the platform_dct_wifi_config_t structure with the SSID, password and security. Then write this to DCT by calling the wiced_dct_write_wifi_config_section( ) function which writes a volatile copy of the DCT Wi-Fi config section in RAM to the flash. The access point information set in DCT will be used to connect to the access point when the network interface is brought up using wiced_network_up( ).

          A copy is written to flash each time and could result in flash wear-out, so this must be considered in the design.

          • 2. Re: How to connect to a specific Wi-Fi network in WICED programmatically?

            Hi, I have the same issues for this kinds of  issues.

             

            1. WiFi AP is set as below

                SSID : aptest

                Auth : WPAPSK

                Encrypt : TKIP

                Network Key : 1234567890abc

             

            2. At the module, I got the scan result

               [0,Infra,00:08:9F:BE:79:FC,-46,300.0,11,WPA TKIP,aptest,

             

            3.  I refered stored_ap_list[0]

                 [0,aptest,5DAC1F66AA5EF469DF157E0BC6A3BBB70C9176C7C0B01866C3E8F6F62DE8AC98

             

            4. WIFI DCT at the compile time

            // wifi_dct is defined as below and network key(PASSPHRASE) is defined 1234567890abc

            #define CLIENT_AP_SSID       "aptest"

            #define CLIENT_AP_PASSPHRASE "1234567890abc"

            #define CLIENT_AP_SECURITY     WICED_SECURITY_WPA_TKIP_PSK

            #define CLIENT_AP_CHANNEL    11

            #define CLIENT_AP_BAND       WICED_802_11_BAND_2_4GHZ

             

            5. Question: 

                As you wrote, if I can change the " platform_dct_wifi_config_t" with stored_ap_list[].

                I think that I have to make key encryption, how can I make encrypt as TKIP?

               1.  Do we need to passphrase encryption and store it to wifi dct and write it to   

                   flash(wiced_dct_write_wifi_config_section)

               2. Is there are any like belows

                    a) set_stored_ap_list(0,"SSID","PASSPHRASE");

                        - WiFi driver does  scan AP and it does make encryption with scaned AP information.

                           if AP is TKIP, then driver does passphrase  as TKIP and apply to connected.

             

               3. We are using this as serial to wifi module  and all configuration is done by serial input.

                    ex >

                         1. serial input command <AP-SSID,PASSPHRASE,Auth_method,encrypt_type>

                         2. if we save it to stored_ap_list[0], then there is no way for encryption.

             

            Any of advice is highly appreciated.

             

                  

                  

             

              

            • 3. Re: How to connect to a specific Wi-Fi network in WICED programmatically?

              Please take a look at <WICED-SDK>/Apps/snip/security_types/security_types.c. This snippet application demonstrates how to specify and join access points with different security types.

              • 4. Re: How to connect to a specific Wi-Fi network in WICED programmatically?

                Is there an equivalent example for SDK 3.0.1? Security_types is not available, and some of the function calls used were depreciated.