Wi-Fi (RP-SMA) and GSM (SMA) terminals comparasion Connect antenna to the Wi-Fi connector.
The Wiren Board Wi-Fi is available at a distance of no more than one meter without the antenna.To get a standart Wi-Fi radius of operation, you need to connect antenna to the appropriate connector of the controller. If the controller is in the closet (especially in a metal one) or a separate room, it is better to use a remote antenna.
The antenna has standart Wi-Fi connector: RP-SMA (differs from SMA-connector for GSM antennas)RP-SMA
Wiren Board controller's WI-Fi works in hotspot mode by default:
hotspot name: WirenBoard...
password: none
adress of the controller in the created network: 192.168.42.1
Setting up Wi-Fi in Linux
The setting up is usually proceed in a standart way for Linux Debian: via file /etc/network/interfaces. The following are brief instructions for common tasks on Linux Debian, there is a detailed documentation on the Linux site. detailed documentation.
Setting up in a hotspot mode
Access point mode is enabled by default. Operation in the access point mode is provided by the hostapd daemon.
Configuration process:
Enable access point mode. For this:
open file /etc/default/hostapd and uncomment the string(e.g.,remove the # at the beginning of the string)
DAEMON_CONF="/etc/hostapd.conf"
edit the /etc/hostapd.conf file like in the example:
interface=wlan0
#driver=nl80211 # this line should stay commentedssid=WirenBoard# you can substitute WirenBoard with a different name for the hotspotchannel=1wpa=2wpa_passphrase=your_password# replace your_password with your own passwordwpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIPCCMP
rsn_pairwise=TKIPCCMP
Edit /etc/network/interfaces:
uncomment and edit the lines(or add them, if there were none) related to the hotspot settings:
ifacewlan0inetstatic
address192.168.42.1# here 192.168.42.1 - is the address where the Wiren Board controller will be located in the new network; you can specify a different addressnetmask255.255.255.0
comment out the lines related to the operating in client mode:
uncomment and edit the lines (or add them if there were none):
autowlan0
ifacewlan0inetdhcpwpa-ssid{ssid}# replace {ssid} with the name of the hotspotwpa-psk{password}# replace {password} with your own password
To apply the changes, run the following commands
ifdownwlan0
ifupwlan0
Setting up in hotspot and client mode simultaneously
The mode of simultaneous operation of the Wi-Fi module in both the hotspot mode and the client mode is called Concurrent Mode or STA+SoftAP, and is not supported by all Wi-Fi modules. It also does not work on all versions of the Wiren Board controllers. We've found out that it works out of the box on Wiren Board controllers with Realtek 8723BU chip and Linux kernel 4.1.15. To check that, run the following commands:
uname-a
lsmod|grep8723bu
If the conditions are not met, you may still be able to configure Concurrent Mode on your Wiren Board. As a starting point, use the instructions(rus only).
The mode of simultaneous operation of the Wi-Fi module in both the hotspot mode and the client mode is called Concurrent Mode or STA+SoftAP, and is not supported by all Wi-Fi modules. It also does not work on all versions of the Wiren Board. We have found out that it works out of the box on Wiren Board with Realtek 8723BU chip and Linux kernel 4.1.15. To check that, run the following commands:
If conditions are met:
Run command
iwconfig
Its output should show two Wi-Fi interfaces: wlan0 и wlan1.
Use the previous two instructions to configure the client mode and the hotspot mode connection, but use different interfaces. For example, leave wlan0 for the hotspot and make the client on wlan1. The corresponding part of /etc/network/interfaces should look like this:
# Wireless interfaces
autowlan1
ifacewlan1inetdhcp
wpa-ssid{ssid}# replace {ssid} with the hotspot namewpa-psk{password}# replace {password} with your own password
autowlan0
ifacewlan0inetstatic
address192.168.42.1
netmask255.255.255.0
Universal Wi-Fi settings file
Below is the text of the file, which shows the settings for connecting to networks with different encryption settings. The file is borrowed from here.
#####################; start of wireless bits#; this command stays for all configs
autowlan0
####################; comments indicated by #;#; commands indicated by ##; remove the # to enable the command#####################; if using static IP then....##iface wlan0 inet static# address UR_IP#gateway UR_ROUTER_IP#netmask 255.255.255.0###################; otherwise use dhcp ##iface wlan0 inet dhcp####################; OPEN wireless config ##wireless-essid UR_ESSID#wireless-mode managed####################; WEP wireless config ##wireless-essid UR_ESSID#wireless-key UR_KEY#; end of WEP config#########################; WPA and WPA2 wireless config ##; all command config lines above HERE to be #'ed except the entry auto wlan0########################
wpa-driverwext
wpa-ssidUR_ESSID
#; wpa-ap-scan is 1 for visible and 2 for hidden hubs
wpa-ap-scan1#; wpa-proto is WPA for WPA1 (aka WPA) or RSN for WPA2
wpa-protoWPA
#; wpa-pairwise and wpa-group is TKIP for WPA1 or CCMP for WPA2
wpa-pairwiseTKIP
wpa-groupTKIP
wpa-key-mgmtWPA-PSK
#; use "wpa_passphrase UR_ESSID UR_KEY" to generate UR_HEX_KEY#; enter the result below
wpa-pskUR_HEX_KEY
########################### end of wireless bits
Automatic reconnection in case of connection problems
For example, the controller is connected to a router with the 192.168.0.1 address via the wlan1 interface. Then:
in /root folder create script wifi_autoconnect.sh as in the example below:
#!/bin/bash# Substitute the name of the interfaceWLANINTERFACE=wlan1
# Substitute the address of the router or server on the Internet, access to which will be checkedSERVER=192.168.0.1
# Only send two pings, sending output to /dev/null
ping-I${WLANINTERFACE}-c2${SERVER}>/dev/null
# If the return code from ping ($?) is not 0 (meaning there was an error)if[$?!=0]then# Restart the wireless interface
ifdown--force${WLANINTERFACE}
ifup${WLANINTERFACE}fi
Make file executable by running the command
chmod+x/root/wifi_autoconnect.sh
Schedule the script to run every minute. For this:
Install cron:
apt-getinstallcron
In the end of the/etc/crontab file add line
*****root/root/wifi_autoconnect.sh
# be sure to add an empty line at the end of the file
Limits
Wi-Fi in Wiren Board controllers in hotspot mode is relatively slow. The speed is enough to work with the web interface, but do not use the Wiren Board as a replacement for a standart router.
In very rare cases, the Wi-Fi adapter on the Wiren Board controllers may not be compatible with some other Wi-Fi devices. This is a common problem of Wi-Fi implementations on chipsets from different manufacturers. If you encounter unexplained problems, we recommend to change the encryption settings, channel width, etc.