Application Overview

The provisioning application demonstrates how to get UDP echo functionality using Quessence.

Following are the procedure steps

  1. Configure device as Access Point and set IP address
  2. Transmit UDP data from remote side
  3. Device gives UDP echo by transmitting same packet which it received.

  Click here to download the source code for the AP UDP Echo Application

Setup required

  1. Quessence
  2. 32/64-bit PC with minimum 2GB RAM and USB port for power, downloading and debugging software
  3. Windows 7/8/8.1/10 Operating System. It should have the Keil IDE and the CMSIS DAP drivers installed on it. Refer to installation section for download and installation steps.
  4. A windows machine (as a WiFi Station) with any UDP application.

Configure the Application

Use an IDE to edit the ap_udp_echo_tcpipbypass.c file available in the path Ap_udp_echo/Applications to make the following changes

Macro Value Description
SSID
   “”
This macro refers to the name of Access point .
CHANNEL_NO   

 
This macro refers to the channel in which AP would be started
SECURITY_TYPE
   

This macro refers to the type of security.

Security types are defined in the below path

Ap_udp_echo/Libraries/Wireless/include/rsi_wlan_apis.h

PSK
   “”
This macro refers to the secret key .
ENCRYPTION_TYPE
  

This macro refers to the Encryption type of Access Point  to be made.

Encryption modes are defined in below the path

Ap_udp_echo/Libraries/Wireless/include/rsi_wlan_apis.h

BEACON_INTERVAL 

 

This macro refers to the time delay between two consecutive beacons(units in milliseconds).

Allowed value are integers from 100 to 1000 which are multiples of 100.

DTIM_COUNT

 
This macro is to configure DTIM count to the Access Point.Allowed values are 1 to 255.
DEVICE_PORT

 
This macro is to configure the Device port . This is the TCP local port of the module.
REMOTE_PORT
   
This macro is to configure port number of the remote server.
GLOBAL_BUFF_LEN

 
This macro is to configure Application memory length which is required by the driver
DHCP_MODE

 

To configure IP address

IP address to be configured to the device should be in long format and in little endian byte order.

Example: 1.To configure “192.168.10.101” as IP address,update the macro DEVICE_IP as 0x650AA8C0.

2. To configure “192.168.10.1” as Gateway,update the macro  GATEWAY as 0x010AA8C0.

3.To configure “255.255.255.0” as network mask,update the macro NETMASK as 0x00FFFFFF 

#define  DEVICE_IP    
#define  GATEWAY      
#define  NETMASK      

A sample configuration is shown in the below snapshot

Update the WLAN Configuration file

Check the following macros of rsi_wlan_config.h file available in the path  Ap_udp_echo/Libraries/Wireless/include

Macro Value
CONCURRENT_MODE RSI_DISABLE
RSI_FEATURE_BIT_MAP FEAT_SECURITY_PSK              
RSI_TCP_IP_BYPASS RSI_ENABLE
RSI_TCP_IP_FEATURE_BIT_MAP TCP_IP_FEAT_BYPASS
RSI_CUSTOM_FEATURE_BIT_MAP 0
RSI_BAND RSI_BAND_2P4GHZ

 

 

Execute the Application

  1. Connect Quessence to the Windows PC running Keil IDE.
  2. Configure the macros in the files ap_udp_echo_tcpipbypass.c and rsi_wlan_config.h as mentioned above.
  3. Build and launch the application.
  4. After program gets executed, Quessence will be in Access Point mode. Now connect WIFI station to it and assign static IP address in that network of AP.

5.Now open UDP socket available in the path Ap_udp_echo/SocketTest3.zip on port number REMOTE_PORT to receive data sent by AP and open UDP client socket with port number DEVICE_PORT to send UDP data to AP. and transmit data to Quessence.

6.Send “hii” message from UDP client to UDP server opened in AP and same messages will send back by AP to the UDP server opened on WiFi Station.       

         Please refer the given below image for messages sent by WiFi Station and AP.

7. Quessence receives and transmits same data .