Configuration of the WiFi interface.
Configuration of the WiFi interface.
The WiFi interface is configured using the Net_Config_WiFi_n.h file. n stands for the number of the WiFi interface. The options are set in the file directly or using the Configuration Wizard.
WiFi Interface Configuration File
The WiFi configuration file contains the following settings:
- Connect to hardware via Driver_WiFi# defines the number of the WiFi driver to be used. This is usually "0".
- WiFi Mode defines the operation mode of the WiFi interface. This is usually "Station".
- To use WiFi MAC from the configuration, enable the check box.
- MAC Address specifies the six byte WiFi MAC address of the device. It must be unique for each WiFi interface that is part of a WLAN. The value FF:FF:FF:FF:FF:FF is not allowed. This option is usually disabled and the MAC address available in the WiFi module is used.
- To use IPv4, enable the check box.
- IP Address specifies a static local 4 bytes IP address. The value 255.255.255.255 is not allowed. This IP address is only used by the device if the Dynamic Host Configuration is disabled. If DHCP is enabled, the IP address is obtained automatically from the DHCP server or an AutoIP is used. A static IP address can also be changed at runtime.
- Subnet mask defines the net mask. The value of the net mask has to to be in line with the above specified IP address.
- Default Gateway specifies the IP address of the default gateway. It is used when accessing the external WAN. If the application is used on a local LAN only, then the value is irrelevant.
- Primary DNS Server specifies the IP address of the primary DNS server. The DNS Client sends IP address resolution requests to this address. The setting is irrelevant if the DNS Client is disabled.
- Secondary DNS Server specifies the IP address of the secondary DNS server. It is used if the primary DNS server is down or not accessible. In this case, the DNS Client automatically switches to the secondary DNS server if a non-zero address is provided. The setting is irrelevant if the DNS Client is disabled.
- IP Fragmentation enables fragmentation of outgoing IP datagrams, and reassembling the fragments of incoming IP datagrams.
- ARP Definitions configures various parameters of the Address Resolution Protocol that is used to cache the IP addresses of remote peers.
- Cache Table size specifies the size of ARP cache table. It defines how many cache entries can be kept in the ARP cache. Increase this value when using multiple simultaneous IP connections.
- Cache Timeout in seconds specifies the timeout for an ARP cache entry. After a timeout, the Permanent IPs are refreshed, and the Temporary IPs are removed from the cache. The Timeout (Keep-alive) Timer is reset on every access to the cache entry.
- Number of Retries is the maximum number of retries to resolve the WiFi MAC address of the remote peer.
- Resend Timeout in seconds specifies the waiting interval between two re-sends. When this timeout has expired and no response has been received from the remote peer, the ARP request is resent.
- Send Notification on Address changes enables or disables the Gratuitous ARP Service. When it is enabled, the embedded host will broadcast a Gratuitous ARP notification at startup, or when the local IP address has changed.
- IGMP Group Management enables or disables sending or receiving IP Multicast packets. In order to receive Multicast packets, a host must first join a Host Group with a specified Host Group IP address.
- Membership Table size specifies the size of IGMP Host Group table. It defines how many Host Groups a host can join.
- If the NetBIOS Name Service is enabled, the device can be accessed by its local host name in a LAN. For example: instead of
- If Dynamic Host Configuration is enabled, the device obtains all network parameters like IP address, net mask, default gateway, primary and secondary DNS servers automatically from the DHCP server on the LAN. Enable also the option NetBIOS Name Service to access the hardware by its name. DHCP requires UDP Sockets to be enabled as it uses one UDP socket for communication with the DHCP server.
- Vendor Class Identifier (VCI) specifies a string, which is added to the DHCP request message. The VCI can be used to selectively identify a device on a DHCP server (option 60). For example, the DHCP server can assign an IP address to a specific Vendor Class group and ignore all other DHCP clients with a different VCI.
- Bootfile Name enables or disables the DHCP option 67. If this option is enabled, a DHCP client requests also a Bootfile Name parameter from a DHCP server. When enabled, the user needs to provide a netDHCP_Notify callback function in his application.
- NTP Servers specifies that a list of NTP servers (option 42) is also requested from the DHCP server.
- To use IPv6, enable the check box.
- IPv6 Address specifies the static IP address in text representation. If no static IP address is assigned, use "::".
- In the Subnet prefix-length you can enter the number of bits that define the network address.
- Default Gateway specifies the IP address of the default gateway. It is used when accessing the external WAN. If the application is used on a local LAN only, then the value is irrelevant.
- Primary DNS Server specifies the IP address of the primary DNS server. The setting is irrelevant if the DNS Client is disabled.
- Secondary DNS Server specifies the IP address of the secondary DNS server. It is used if the primary DNS server is down or not accessible. The setting is irrelevant if the DNS Client is disabled.
- IPv6 Fragmentation enables fragmentation of outgoing IPv6 datagrams, and reassembling the fragments of incoming IPv6 datagrams.
- Neighbor Discovery configures various parameters of the Neighbor Discovery Protocol that is used to cache the IPv6 addresses of neighbor nodes.
- The Cache Table Size sets the number of cached neighbor node addresses. Increase this value when using multiple simultaneous IPv6 connections.
- The Cache Timeout in seconds specifies the timeout for cached node addresses.
- The Number of Retries is used to resolve an IP address before the NDP module gives up and stops the resolution.
- The Resend Timeout in seconds specifies the timeout for resending Neighbor Solicitation.
- Multicast Listener Discovery enables or disables sending or receiving IPv6 Multicast packets. In order to receive Multicast packets, a host must first join a Host Group with a specified Host Group IPv6 address.
- Membership Table size specifies the size of MLD Host Group table. It defines how many Host Groups a host can join.
- If Dynamic Host Configuration is enabled, the device obtains all network parameters like IP address and primary/secondary DNS servers automatically from the DHCPv6 server on the LAN.
- Two DHCPv6 Client Modes are used to connect to a DHCPv6 server: in stateless mode, the client obtains only extended information from the DHCPv6 server, such as DNS server addresses. In stateful mode, the client connects to a DHCPv6 server for a leased IPv6 address and DNS server addresses.
- Vendor Class Option is used to send vendor information to the DHCPv6 server. This information can be used to selectively identify a device on a DHCPv6 server, similar to VCI in IPv4.
- Enterprise ID specifies Enterprise-number as assigned by IANA.
- Vendor Class Data specifies a string, which is added to the DHCPv6 request message.
- OS Resources Settings are used to optimize usage of OS resources.
- The default Interface Thread Stack Size is 512 bytes.
- The default Interface Thread priority is osPriorityAboveNormal. You can change this priority by changing the WIFIn_THREAD_PRIORITY defined in this configuration file. This priority must be high enough for the WiFi interface to respond to events in a timely manner. Due to this requirement, it is recommended that this setting remain the default. For more information on default settings, see the section CMSIS-RTOS Requirements.
Additional WiFi configuration settings:
- The WIFIn_ICMP_NO_ECHO defines the Echo response mode that is enabled by default. A value of 1 disables the echo response, and a value of 0 enables it. Alternatively, you can change it from a running application with the netICMP_SetNoEcho function.
- The WIFIn_ICMP6_NO_ECHO defines the Echo response mode for IPv6 that is enabled by default. A value of 1 disables the echo response, and a value of 0 enables it. Alternatively, you can change it from a running application with the netICMP6_SetNoEcho function.