출처 : https://forum.armbian.com/topic/1237-opi-one-wireless-success/
There seems to be a lot of confusion and missing information on how to access the dirt cheap OPI ONE wirelessly and the steps necessary to successfully use cheap Realtek USB dongles ( 8188cus, 8188eu ) with Armbian_5.10.
This is a short summary of the needed materials and steps to turn your OPI ONE into a wireless client or wireless AP. There are NO custom kernels, custom modules or anything else needed, we are using stock Armbian_5.10 with stock kernel, stock modules and stock software to configure wireless access for select tested and working Realtek wifi dongles.
Follow the steps without variation. Once you get wifi working you may adapt setup/configuration to your specific needs
Prerequisites
- OPI ONE with quality power supply 5V/2A
- MicroSD ( 4G or higher ) with stock Armbian_5.10 installed per official instructions
- Supported wifi USB dongle
- LAN connection to host computer ( preferrably notebook running Linux ) for needed setup/configuration
- WLAN-router accessible from host computer to test wireless connections.
General procedure to set up wireless on OPI ONE
- Set up your OPI ONE with basic Armbian_5.10 and configure a static IP LAN-address
- Access OPI ONE via ssh from your host computer
- Plug in wireless dongle and load correct driver module
- check capabilities of wifi dongle (iw list)
- configure wpa_supplicant for client mode
- configure hostapd for AP mode
>>> all configurations will be minimal without added automagic complexities ( bridges, DHCP etc...)
OPI ONE wireless client
Module 8192cu works with Realtek 8188CUS dongles and provides a wireless interface wlan0 ready to be configured in managed mode with wpa_supplicant.
nano /etc/modules-load.d/modules.conf
=====================================
#8189es
8192cu
nano /etc/network/interfaces (adapt to your network setup)
==========================================================
auto lo
iface lo inet loopback
#----- lan interface ( standard maintenance connection via ssh )
allow-hotplug eth0
iface eth0 inet static
address 192.168.3.164
netmask 255.255.255.0
network 192.168.3.0
#----- Realtek 8192cu wlan interface client ( access defined in /etc/wpa_supplicant/wpa_supplicant.conf )
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.2.164
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
gateway 192.168.2.77
dns-nameservers 192.168.1.1
dns-nameservers 8.8.8.8
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
nano /etc/wpa_supplicant/wpa_supplicant.conf
============================================
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="<your_ssid>"
psk="<your_password>"
key_mgmt=WPA-PSK
priority=99
}
After restarting OPI ONE it should be connected to your configured wireless router and accessible under the static IP.
Wireless connection is working now and the rest is up to your hopefully wild imagination and creativity.
Tested working dongles
RTL8188CUS cheap no-name dongle from Aliexpress ( < $2 )
Bus 002 Device 003: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
RTL8188CUS Edimax EW-7811Un high quality dongle ( $10 )
Bus 001 Device 008: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
Wifi performance is not stellar, but definitely adequate. Under ideal conditions ( same room as router, little interference ) speeds of 80mbps ( measured with iperf ) can be expected. Crossing two walls at 20m distance from router the signal was still usable yielding 20mbps.
OPI ONE access point + wireless client
Surprise : You were asking for AP mode and now you are getting AP deluxe with an extra client interface for free.
Module 8188eu works with Realtek 8188EU dongle and provides TWO wireless interfaces : wlan0 is ready to be configured in AP mode with hostapd and wlan1 in managed mode with wpa_supplicant.
When the dongle is plugged in and the driver correctly loaded, iw list will enumerate the drivers parameters for the two new interfaces. iwconfig will show wlan0 and wlan1.
nano /etc/modules-load.d/modules.conf
=====================================
#8189es
8188eu
nano /etc/default/hostapd
=========================
DAEMON_CONF="/etc/hostapd.conf"
nano /etc/network/interfaces
============================
auto lo
iface lo inet loopback
#----- lan interface ( standard maintenance connection via ssh )
allow-hotplug eth0
iface eth0 inet static
address 192.168.3.164
netmask 255.255.255.0
network 192.168.3.0
#----- Realtek 8188eu wlan interface AP ( access defined in /etc/hostapd.conf )
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.4.164
netmask 255.255.255.0
network 192.168.4.0
#----- Realtek 8188eu wlan interface client ( access defined in /etc/wpa_supplicant/wpa_supplicant.conf )
allow-hotplug wlan1
iface wlan1 inet static
address 192.168.2.164
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
gateway 192.168.2.77
dns-nameservers 192.168.1.1
dns-nameservers 8.8.8.8
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
nano /etc/hostapd.conf
======================
ssid=<your-OPI-ONE-ssid>
interface=wlan0
hw_mode=g
channel=5
driver=nl80211
logger_syslog=0
logger_syslog_level=0
wmm_enabled=1
ieee80211n=1
wpa=3
preamble=1
#wpa_psk=66eb31d2b48d19ba216f2e50c6831ee11be98e2fa3a8075e30b866f4a5ccda27
wpa_passphrase='12345678'
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
auth_algs=1
macaddr_acl=0
noscan=1
#ht_capab=[HT40-][sHORT-GI-40][sHORT-GI-40][DSSS_CCK-40]
country_code=<your country code>
#ieee80211d=1
nano /etc/wpa_supplicant/wpa_supplicant.conf
============================================
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="<your-router-ssid>"
psk="<your-router-password>"
key_mgmt=WPA-PSK
priority=99
}
After restarting OPI ONE it should be connected to your configured wireless router and accessible under the static IP. On your notebook the newly created OPI ONE access point should be visible when scanning. Specify a static IP for the link and connect using the chosen password ( e.g. '12345678' ) . Feel like a hero, empty a sixpack and order more pizza....
Wireless connection is working now and the rest is up to your hopefully wild imagination and creativity.
Tested working dongle for AP mode :
RTL8188EU cheap no-name dongle from Aliexpress ( $2.20 )
Bus 001 Device 009: ID 0bda:0179 Realtek Semiconductor Corp. ( noname identified as 8188EU )
Wifi performance with both interfaces active is surprisingly good. Under ideal conditions ( same room as router, little interference ) speeds of 60 (client) / 30 (AP) mbps can be expected. Crossing two walls at 20m distance from router signals were still usable yielding 20 (client) / 5 (AP) mbps.
Troubleshooting
Most of the problems encountered while setting up WIFI are caused by inadequate or overly complicated testing setups, procedures and rampant wild guesses. Keep it simple and solve one problem at a time. As a stable datum you should realize that the procedures outlined above DO WORK and have been adequately TESTED and RETESTED..
Solution No. 1 : Follow the steps outlined
Solution No. 2 : Find out where you did not follow the steps outlined
Solution No. 3 : Find out what you added to the steps outlined
Solution No. 4 : Reiterate