11 Replies Latest reply on May 19, 2020 7:52 AM by RaktimR_11

    How to program CYW954907EVAL-1F for data transfer between two modules using 802.11?

    HaTr_4568521

      I'm having a pair of CYW954907EVAL-1F boards and need to program them so that files stored on the SD card of one such module can be transferred to another such module using 802.11 protocol (802.11ac to be more specific). In WICED Studio 6.4, I could find the sd_filesystems program that can be used for routing data to and from the SD card. What I'm looking for is how do I program CYW954907EVAL-1F for various 802.11 PHY and MAC so that I can establish a connection between both the modules and transfer the data.

      Attached are some of the contents I've already referred to but couldn't make out much as in from where to start.

      Also, the other controllers that I've used have a set of instructions and programming well defined which helps the beginner to start with the development. For  CYW954907EVAL-1F also, if any such literature is available which best fits the marked application, please suggest that as well.

       

      P.S. I've already gone through the video tutorials available from Cypress which gives a good start for sure, however, the same is not having the details I'm looking for and hence the question.

        • 1. Re: How to program CYW954907EVAL-1F for data transfer between two modules using 802.11?
          RaktimR_11

          What are the 11ac specific features you are trying to enable?

           

          The idea is to use the sd_filesystem application and use tcp/udp to transmit data b/w two CYW54907.

          • 2. Re: How to program CYW954907EVAL-1F for data transfer between two modules using 802.11?
            HaTr_4568521

            Dear RaktimR_11 Following features of 802.11ac I want to implement:

             

            • use of 5 GHz frequency band for communication
            • bandwidth of communicaion = 40 MHz
            • modulation scheme: QPSK
            • channel coding rate: 1/2 or 3/4
            • Guard interval: 400 nsec
            • Spatial stream: 1 (however, I'd also like to program for more number of spatial streams)
            • transmit power: 15 dBm or more

             

            another query: how would I pair / connect two devices?

             

            Also, is there any literature available for programming the CYW954907 using WICED studio, cause referring to the code directly doesn't help much to me.

             

            Thanks.

            • 3. Re: How to program CYW954907EVAL-1F for data transfer between two modules using 802.11?
              RaktimR_11

              use of 5 GHz frequency band for communication

              - wwd_wifi_set_preferred_association_band( WLC_BAND_5G );

              bandwidth of communicaion = 40 MHz

              - wwd_wifi_set_bandwidth(40)

               

              modulation scheme: QPSK channel coding rate: 1/2 or 3/4

              I am guessing that you mean to use MCS 0-7

              - wwd_wifi_set_mcs_rate( wwd_interface_t interface, int32_t mcs, wiced_bool_t mcsonly);

              Guard interval: 400 nsec

              Re: (CYW43907) How to set GI(guard interval) for 802.11n   If you need APIs find the ioctls and use them accordingly. More help on ioctls: How to use IOCTL commands in CYW43907

              Spatial stream: 1 (however, I'd also like to program for more number of spatial streams)

              Since this is a SISO chip, only NSS 1 is supported which is the default configuration.

              transmit power: 15 dBm or more

              Country specific. Usually fixed by regulatory authorities of each country. Determined by clm_blob in Cypress WLAN solutions. More on clm_blob: https://www.cypress.com/file/453451/download If it's within per-defined limit set according to the ccode, wl txpwr1 or wwd_wifi_set_tx_power() can be used.

               

              another query: how would I pair / connect two devices?

              pairing/connect usually exists for BT/BLE devices. For WLAN it is more like ap-sta connection which goes through the auth-assoc process. You can setup a CYW54907 as a softAP and host a udp_server on the same interface; simultaneously, you can configure the other CYW54907 as a STA, connect to the softAP and use it as a udp_client to connect to the udp_server.

               

              For getting started with WICED, we do provide a quick-start-guide, which can be found in 43xxx_Wi-Fi/doc/WICED-QSG.pdf

              You can also refer to the product guide: CYW43907/CYW54907 Product Guide

              WICED can be a little tricky to get started with. But once you are comfortable after going through the above mentioned literature and the WICED-WiFi videos, it will warm up to you.

              • 4. Re: How to program CYW954907EVAL-1F for data transfer between two modules using 802.11?
                HaTr_4568521

                Dear RaktimR_11,

                 

                Thanks for the prompt response.

                 

                wwd_wifi_set_preferred_association_band( WLC_BAND_5G );

                wwd_wifi_set_bandwidth(40);

                wwd_wifi_set_mcs_rate( wwd_interface_t interface, int32_t mcs, wiced_bool_t mcsonly);

                 

                This seems to be helpful.

                 

                Another thing is, I could find the code snippet for TCP Server and TCP client. What modifications shall I do to implement a UDP server and a UDP client?

                Quick start guide and product guide are definitely good to start with, however, doesn't help much for a specific application development.

                • 5. Re: How to program CYW954907EVAL-1F for data transfer between two modules using 802.11?
                  RaktimR_11

                  In the same folder, you can find udp_receive and transmit operation (i.e, server and client). Those documents can only help you to get started with but for each user-specific application, you need to refer to the numerous applications spread across snip, demo, waf, wwd folder etc.

                  • 6. Re: How to program CYW954907EVAL-1F for data transfer between two modules using 802.11?
                    HaTr_4568521
                    In the same folder, you can find udp_receive and transmit operation (i.e, server and client). Those documents can only help you to get started with but for each user-specific application, you need to refer to the numerous applications spread across snip, demo, waf, wwd folder etc.

                     

                    Ohh!! Sounds good. I'll refer to it and get back in case of queries.

                     

                    One more thing, what determines the parameter value? for example, while referring to the TCP Server code, I could find the TCP_PACKET_MAX_DATA_LENGTH value as 30 and the same thing I also observed for UDP_MAX_DATA_LENGTH as well. So how would I be able to determine what is the appropriate value of such parameters?

                     

                    Thanks again for the help.

                    • 7. Re: How to program CYW954907EVAL-1F for data transfer between two modules using 802.11?
                      HaTr_4568521

                      some queries I had RaktimR_11

                       

                      • could not understand the difference between the soft AP used for device configuration and soft AP used for normal operation
                      • while working on the code, I commented the line UDP_TARGET_IS_BROADCAST and assigned the IP address to the receiver as The code snap is also attached below:

                      SSID: WICED UDP Transmit App

                      Protocol: Wi-Fi 4 (802.11n)

                      Security type: WPA2-Personal

                      Network band: 2.4 GHz

                      Network channel: 1

                      Link-local IPv6 address: fe80::55a:5607:c3b8:b260%21

                      IPv4 address: 192.168.0.2

                      IPv4 DNS servers: 192.168.0.1

                       

                      //commented out  #define UDP_TARGET_IS_BROADCAST

                      //commented out  #define GET_UDP_RESPONSE

                       

                      #ifdef UDP_TARGET_IS_BROADCAST

                      #define UDP_TARGET_IP MAKE_IPV4_ADDRESS(192,168,0,255)

                      #else

                      #define UDP_TARGET_IP MAKE_IPV4_ADDRESS(192,168,0,25)

                      #endif

                      • What determines whether the device will work as a UDP server or as a UDP client? Cause I checked for the code of wifi_config_dct.h and they both looked similar to me.

                       

                      • Where shall I be mentioning this? cause while editing wifi_config_dct.h, I found "WICED_802_11_BAND_2_4GHZ" as a CLIENT_AP_BAND and "1" as CLIENT_AP_CHANNEL. Shall we not set all such things for the server as well?

                      wwd_wifi_set_preferred_association_band( WLC_BAND_5G );

                      wwd_wifi_set_bandwidth(40);

                      wwd_wifi_set_mcs_rate( wwd_interface_t interface, int32_t mcs, wiced_bool_t mcsonly);

                       

                      Thanks!

                      • 8. Re: How to program CYW954907EVAL-1F for data transfer between two modules using 802.11?
                        RaktimR_11

                        If you have multiple questions pertaining to different topics relevant to same project, its always recommended to create separate threads and increase the outreach; so that others can also help. Trying to list down the answers

                         

                        • config_interface softap is mainly to configure the device during startup; say you want the device to connect to an AP after starting up. You can enter the credentials hosted on a webserver running on the config interface
                        • softap: it is more generic functionality allowing clients(STAs) to join and communicate with each other in server-client model.

                         

                        Typically, transmit operation is attributed to client and the receive operation is attributed to server with some exceptions as always. So, when you use wiced_udp_receive, it means the socket is waiting on data to be sent by some clients on that particular IP addr; if not broadcast (If you don't want broadcast, you just need to comment out the UDP_TARGET_IS_BROADCAST as you have rightly done).

                         

                        wifi_config_dct.h is provided so that you can modify the basic wlan related parameters like ssid, passphrase, band, channel which is  stored in DCT ( a dedicated section of ext flash). What you had asked primarily, is more to leverage the 11ac specific features which is why I recommended wwd apis. All of these APIs need to be incorporated in both client, server application(specifically .c file) by following the guidelines mentioned in 43xxx_Wi-Fi/WICED/WWD/include/wwd_wifi.h. Essentially, you can create a single application with two threads, one for tx, one for rx and control the thread spawning from command line along with the 11ac specific common settings that has been mentioned earlier.

                        • 9. Re: How to program CYW954907EVAL-1F for data transfer between two modules using 802.11?
                          HaTr_4568521

                          Hello RaktimR_11, I've now gone through wwd_wifi.h and could find that many functions that I'd been looking for are defined in this header file. As a solution to my problem statement, I further broke down the code and now trying to create an access point with some of the PHY parameters of 802.11ac. Code for the same is as follows:

                           

                          #include "wiced.h"

                          #include "wiced_wifi.h"

                          #include "wwd_wifi.h"

                           

                          #define SOFT_AP_SSID         "Try1_802.11ac"

                          #define SOFT_AP_PASSPHRASE   "80211AC"

                          #define SOFT_AP_SECURITY     WICED_SECURITY_WPA2_AES_PSK

                          #define SOFT_AP_CHANNEL      1

                           

                          static const wiced_ip_setting_t device_init_ip_settings =

                          {

                              INITIALISER_IPV4_ADDRESS( .ip_address, MAKE_IPV4_ADDRESS(192,168,  0,  1) ),

                              INITIALISER_IPV4_ADDRESS( .netmask,    MAKE_IPV4_ADDRESS(255,255,255,  0) ),

                              INITIALISER_IPV4_ADDRESS( .gateway,    MAKE_IPV4_ADDRESS(192,168,  0,  1) ),

                          };

                           

                          void application_start(void)

                          {

                              wiced_init( );

                           

                              wiced_ssid_t* ssid;

                              wiced_security_t auth_type;

                              const uint8_t* security_key;

                              uint8_t key_length;

                              uint8_t channel;

                              uint8_t tx_power = 15;

                              wiced_antenna_t antenna_type = 3;

                              uint8_t bandwidth_value = 40;

                              int32_t mcs_value = 7;

                           

                              wiced_interface_t interface;

                              wwd_result_t result;

                              wiced_bool_t mcsonly;

                           

                              &ssid = SOFT_AP_SSID;

                              auth_type = WICED_SECURITY_WPA2_AES_PSK;

                              &security_key = SOFT_AP_PASSPHRASE;

                              key_length = 8;

                              channel = SOFT_AP_CHANNEL;

                           

                              result = wiced_network_up_default( &interface, &device_init_ip_settings );

                           

                                  if( result != WICED_SUCCESS )

                                  {

                                      printf("Bringing up network interface failed !\r\n");

                                  }

                           

                              result = wwd_wifi_start_ap(&ssid, auth_type, &security_key, key_length, channel);

                           

                              if( result != WWD_SUCCESS )

                                  {

                                      printf("Bringing up AP failed !\r\n");

                                  }

                           

                              result = wwd_wifi_set_tx_power( tx_power );

                           

                                  if( result != WWD_SUCCESS )

                                      {

                                          printf("Tx power set to 15 dBm failed !\r\n");

                                      }

                           

                              result = wwd_wifi_select_antenna( antenna_type );

                           

                                  if( result != WWD_SUCCESS )

                                  {

                                      printf("Antena Selection for diversity receiver failed !\r\n");

                                  }

                           

                              wwd_wifi_set_preferred_association_band( WLC_BAND_5G );

                              wwd_result_t wwd_wifi_set_bandwidth( bandwidth_value );

                              result = wwd_wifi_set_mcs_rate( interface, mcs_value, mcsonly);

                          }

                          In the project folder, .c, .mk and wifi_config_dct.h are there.

                           

                          .mk file is as follows:

                           

                          NAME := apps_802.11ac_configuration

                           

                          $(NAME)_SOURCES := 802.11ac_configuration.c

                           

                          WIFI_CONFIG_DCT_H := wifi_config_dct.h

                          However, upon making the target, I'm getting the following error.

                          tools/makefiles/wiced_config.mk:267: *** Unknown component: Harsh_May.802.11ac_configuration.  Stop.

                          make: *** No rule to make target 'build/Harsh_May.802.11ac_configuration-CYW954907AEVAL1F/config.mk', needed by 'main_app'.  Stop.

                          I'm really not sure what error(s) are there in the code. I'd appreciate it if you could please through some light on the same?

                          • 11. Re: How to program CYW954907EVAL-1F for data transfer between two modules using 802.11?
                            RaktimR_11

                            I don't see the makefile error in my case. Probably, this is occurring because of some extra space issue in some line in the .mk. But I am not clear on the application side what  you are trying to do; since most of the commands are supposed to be executed when the driver down. But I see that you are trying to do wiced_network_up with the dct settings and then again trying to initialize the softap with wwd_wifi_* commands. You should do either or and use the wwd specific apis while the driver is down.. Then do the driver up and host the ap.

                             

                             

                            Alternatively, you can use the wl commands and explore the versatile nature of test.console example to test all 11ac specific features. The application can be located at 43xxx_Wi-Fi/apps/test/console. To use this example application, you would need to set CONSOLE_ENABLE_WL ?= 1 in line #380 of console.mk file.

                             

                            For ap specific case, you can use the start_ap command. I used something like this

                            start_ap softap wpa2 12345678 38 40 no_wps 192.168.2.1 255.255.255.0
                            

                            What this command essentially did is setup a softap, named "softap" ironically with wpa2 security and can be found in a 40 MHz channel in 5GHz (in this case channel 38). Look at the chart below to understand the channel in UNII bands.

                            New Spectrum - Wireless Training Solutions

                             

                            Additionally for guard interval, mcs rates etc, you can refer to the wl documentation as found in WL Tool for Embedded 802.11 Systems: CYW43xx Technical Information. Now you should be able to implement your ap with the desired settings. Additionally, if you want to convert this to an api based application you can just check the wl tool and command console implementation and try referring to the wwd_wifi_* apis to perform your application.

                            1 of 1 people found this helpful