NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
OMAP Wireless Connectivity NLCP WLAN AP Configuration Scripts
Contents
- 1 Access Point Configuration scripts using "Host APD" commands
- 2 Hardware setting
- 3 Access point settings
- 3.1 Access Point configuration - Band support
- 3.2 Access Point configuration - Non Secured network
- 3.3 Access Point configuration - Secured network (WEP-40)
- 3.4 Access Point configuration - Secured network (WEP-128)
- 3.5 Secured network (WPA)
- 3.6 Access Point configuration - Secured network (WPA2)
- 3.7 Access Point configuration - Secured network (any WPA)
- 4 How to set the DHCP server on the AP
- 5 How to run The EVM in Access Point mode
- 6 How to Exit from Access Point mode
- 7 External links
Access Point Configuration scripts using "Host APD" commands[edit]
The following section provides information how to configure the EVM to work in Access point, how to set the AP to work with arbitrary Security mode also adding the DHCP server and NAT (Network Address Translation) capability in order to have an Access Point that can function as a WLAN router.
In that release we don’t have a GUI capability to configure the AP to any mode of operation therefore all the setting will be done using Terminal that is connected over the serial port to the EVM.
The following items will be covered:
- Access Point configuration - Non Secured network
- Access Point configuration - Secured network (WEP-40)
- Access Point configuration - Secured network (WEP-128)
- Access Point configuration - Secured network (WPA)
- Access Point configuration - Secured network (WPA2)
- Access Point configuration - Secured network (any WPA)
- How to set the DHCP server on the AP
- How to run The EVM in Access Point mode
- How to Exit from Access Point mode
Hardware setting[edit]
Access point settings[edit]
The hostapd.conf file (located in folder /etc) defines the Soft AP settings.
Note: most common fields are:
- “ssid” field, modify according to the requested SSID WiFi network, generated by the AP.
- "channel" field, defines the channel that the AP will work on
- "hw_mode" field, in case it is "g" then the AP works in 802.11g band
- "beacon_int" field, is the Beacon interval
- "dtim_period" field, is the DTIM period
for more detailed information on hostapd.conf, use the following link: <hostapd.conf information>
Access Point configuration - Band support[edit]
- hw_mode=g - to support bg band
- hw_mode=b - to support b only band
- ieee80211n=1 - to support 802.11n band
Following are the main definitions that should be edited in that file
Step 1 - Configuring hostapd.conf[edit]
First, we will back up the existing hostapd.conf file by invoking:
mv /etc/hostapd.conf /etc/hostapd.conf.bak
The editing above can be done by vi editor as follows:
vi /etc/hostapd.conf
- The editor will be opened. Type the character 'i' to switch to editing mode.
- Copy and paste the above content into the editor.
- Hit 'esc' button to stop editing.
- Type the sequence ":wq" in order to save and quit.
Create a new hostapd.conf with the following content:
Access Point configuration - Non Secured network[edit]
interface=wlan0 driver=nl80211 channel=1 hw_mode=g preamble=1 dtim_period=2 beacon_int=100 logger_syslog=-1 logger_syslog_level=2 logger_stdout=-1 logger_stdout_level=2 dump_file=/tmp/hostapd.dump ctrl_interface=/var/run/hostapd ctrl_interface_group=0 supported_rates=60 90 120 180 240 360 480 540 basic_rates=60 90 120 180 240 ssid=MAC_AP max_num_sta=5 macaddr_acl=0 auth_algs=3 ieee80211d=0 uapsd_advertisement_enabled=1 wep_rekey_period=0 own_ip_addr=127.0.0.1 wpa_group_rekey=0 wpa_strict_rekey=0 wpa_gmk_rekey=0 wpa_ptk_rekey=0 #ap_table_max_size=255 #ap_table_expiration_time=60 eap_server=1 disassoc_low_ack=1 ap_max_inactivity=4294967295
Access Point configuration - Secured network (WEP-40)[edit]
interface=wlan0 driver=nl80211 channel=1 hw_mode=g preamble=1 dtim_period=2 beacon_int=100 logger_syslog=-1 logger_syslog_level=2 logger_stdout=-1 logger_stdout_level=2 dump_file=/tmp/hostapd.dump ctrl_interface=/var/run/hostapd ctrl_interface_group=0 ssid=zoomtest max_num_sta=5 macaddr_acl=0 auth_algs=1 wep_default_key=0 wep_key0=1234567890 eapol_key_index_workaround=0 eap_server=0 own_ip_addr=127.0.0.1
Access Point configuration - Secured network (WEP-128)[edit]
interface=wlan0 driver=nl80211 channel=1 hw_mode=g preamble=1 dtim_period=2 beacon_int=100 logger_syslog=-1 logger_syslog_level=2 logger_stdout=-1 logger_stdout_level=2 dump_file=/tmp/hostapd.dump ctrl_interface=/var/run/hostapd ctrl_interface_group=0 ssid=zoomtest max_num_sta=5 macaddr_acl=0 auth_algs=1 wep_default_key=2 wep_key0=1234567890 wep_key1=1234567890 wep_key2=CcCcCcCcCcCcCcCcCcCcCcCcCc wep_key3=1234567890 wme_enabled=0 eapol_key_index_workaround=0 eap_server=0 own_ip_addr=127.0.0.1
Secured network (WPA)[edit]
interface=wlan0 driver=nl80211 channel=1 hw_mode=g preamble=1 dtim_period=2 beacon_int=100 logger_syslog=-1 logger_syslog_level=2 logger_stdout=-1 logger_stdout_level=2 dump_file=/tmp/hostapd.dump ctrl_interface=/var/run/hostapd ctrl_interface_group=0 ssid=zoomtest max_num_sta=5 macaddr_acl=0 auth_algs=1 wme_enabled=0 eapol_key_index_workaround=0 eap_server=0 own_ip_addr=127.0.0.1 wpa=1 wpa_passphrase=12345678 wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP
Access Point configuration - Secured network (WPA2)[edit]
interface=wlan0 driver=nl80211 channel=1 hw_mode=g preamble=1 dtim_period=2 beacon_int=100 logger_syslog=-1 logger_syslog_level=2 logger_stdout=-1 logger_stdout_level=2 dump_file=/tmp/hostapd.dump ctrl_interface=/var/run/hostapd ctrl_interface_group=0 ssid=zoomtest max_num_sta=5 macaddr_acl=0 auth_algs=1 wme_enabled=0 eapol_key_index_workaround=0 eap_server=0 own_ip_addr=127.0.0.1 wpa=2 wpa_passphrase=12345678 wpa_key_mgmt=WPA-PSK wpa_pairwise=CCMP
Access Point configuration - Secured network (any WPA)[edit]
interface=wlan0 driver=nl80211 channel=1 hw_mode=g preamble=1 dtim_period=2 beacon_int=100 logger_syslog=-1 logger_syslog_level=2 logger_stdout=-1 logger_stdout_level=2 dump_file=/tmp/hostapd.dump ctrl_interface=/var/run/hostapd ctrl_interface_group=0 ssid=zoomtest max_num_sta=5 macaddr_acl=0 auth_algs=1 wme_enabled=0 eapol_key_index_workaround=0 eap_server=0 own_ip_addr=127.0.0.1 wpa=3 wpa_passphrase=12345678 wpa_key_mgmt=WPA-PSK wpa_pairwise=CCMP TKIP
How to set the DHCP server on the AP[edit]
The file /etc/udhcpd.conf contains configuration information specific to the udhcp server.
Following are the main parameters:
- "start" field - The starting address of the IP lease block; default value: 192.168.0.20.
- "end" field - The ending address of the IP lease block; default value: 192.168.0.254.
- "interface" field - The udhcp server should listen on INTERFACE. The default is eth0, and we will modify it to wlan0.
- "dns" fiels - The list of DNS servers; In this example, the public google DNS servers were used.
- "subnet" field - The subnet mask
- "router" field - The list of routers; In this example, the SoftAP WLAN IP address is used.
- "lease" field - The lease time in seconds; In this example: 10 days.
For the following demo, create the udhcpd.conf file with the content below, store it in /etc folder, and modify some basic fields according to the expected DHCP behavior (such as “start”, “end” address etc.).
# Sample udhcpd configuration file (/etc/udhcpd.conf) # The start and end of the IP lease block start 192.168.0.20 #default: 192.168.0.20 end 192.168.0.254 #default: 192.168.0.254 # The interface that udhcpd will use interface wlan0 #default: eth0 #Examles opt dns 8.8.8.8 8.8.4.4 # public google dns servers option subnet 255.255.255.0 opt router 192.168.0.1 option lease 864000 # 10 days of seconds
Press the following to get a sample of <udhcpd.conf file>, unzip the file to get the udhcpd.conf file
First, we will back up the existing udhcpd.conf file by invoking:
mv /etc/udhcpd.conf /etc/udhcpd.conf.bak
and then edit the file by
vi /etc/udhcpd.conf
Create a new udhcpd.conf with the following content:
How to run The EVM in Access Point mode[edit]
Note: The wlan0 port IP address that is defined as "ifconfig wlan0 192.168.0.1" below, should be the same IP address as defined in the “router” field in the /etc/udhcpc.conf file
in order to run the Soft AP, run the following:
echo 1 > /proc/sys/net/ipv4/ip_forward ifconfig wlan0 192.168.0.1 hostapd -B /etc/hostapd.conf -P /var/run/hostapd.pid udhcpd /etc/udhcpd.conf iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
How to Exit from Access Point mode[edit]
follows the next commands in order to exit from Access Point mode and return to WLAN Station mode: first need to kill both the hostapd and the udhcpd, for that use ps command to verify what is the Process ID of hostapd and udhcpd
root@am37x-evm:/etc# ps PID USER VSZ STAT COMMAND 2702 root 4904 S hostapd -B /etc/hostapd.conf -P /var/run/hostapd.pid 2704 root 2936 S udhcpd /etc/udhcpd.conf 2714 root 3128 R ps
once we have the Process ID, we can kiil it
kill -9 2702 kill -9 2704 echo 0 > /proc/sys/net/ipv4/ip_forward iptables -F ifconfig wlan0 down iwconfig wlan0 mode managed ifconfig wlan0 up
External links[edit]
- For more information on Soft AP (hostapd) configuration please use the following link <wl12xx hostapd configuration >