Jump to content

OPI ONE wireless success


Recommended Posts

Hi! Nice tutorial!

 

But my OPi is acting weird... When I unplug my Ethernet cable, my WiFi dongle stop to work!

 

My lsusb:

Bus 002 Device 002: ID 0bda:8178 Realtek Semiconductor Corp. RTL8192CU 802.11n WLAN Adapter

My lsmod:

root@orangepione:~# lsmod
Module                  Size  Used by
rtl8192cu              61143  0 
rtlwifi                45784  1 rtl8192cu
rtl8192c_common        33420  1 rtl8192cu
mac80211              358429  3 rtlwifi,rtl8192c_common,rtl8192cu

My interfaces config.:

root@orangepione:~# cat /etc/network/interfaces
# Wired adapter #1
allow-hotplug eth0
   iface eth0 inet static
	address 192.168.1.68
	netmask 255.255.255.0
	network 192.168.1.0
	gateway 192.168.1.1

allow-hotplug wlan0
   iface wlan0 inet static
	address 192.168.1.69
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1
    dns-nameservers 192.168.1.1
    dns-nameservers 8.8.8.8
        wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

My wpa_supplicant.conf:

root@orangepione:~# cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
        ssid="xxxxxxxxxxxxxxxx"
        psk="xxxxxxxxxxxx"
        key_mgmt=WPA-PSK
        priority=99
}

My modinfo rtl8192cu:

root@orangepione:~# modinfo rtl8192cu
filename:       /lib/modules/3.4.112-sun8i/kernel/drivers/net/wireless/rtlwifi/rtl8192cu/rtl8192cu.ko
firmware:       rtlwifi/rtl8192cufw.bin
description:    Realtek 8192C/8188C 802.11n USB wireless
license:        GPL
author:         Larry Finger	<Larry.Finger@lwfinger.net>
author:         Ziv Huang	<ziv_huang@realtek.com>
author:         Georgia		<georgia@realtek.com>
alias:          usb:v7392p7822d*dc*dsc*dp*ic*isc*ip*
...
alias:          usb:v0BDAp8191d*dc*dsc*dp*ic*isc*ip*
depends:        rtlwifi,mac80211,rtl8192c-common
intree:         Y
vermagic:       3.4.112-sun8i SMP preempt mod_unload modversions ARMv7 p2v8 
parm:           swenc:Set to 1 for software crypto (default 0)
 (bool)
parm:           debug:Set debug level (0-5) (default 0) (int)

Armbian version:

root@orangepione:/# dpkg-query -W -f='${Version}\n' linux-jessie-root-orangepione

5.16

Looking at my dmesg:

[    6.018555] rtl8192cu: Loading firmware rtlwifi/rtl8192cufw.bin
[    6.018925] usbcore: registered new interface driver rtl8192cu
[    6.026844] ieee80211 phy0: Selected rate control algorithm 'rtl_rc'
[    6.028078] rtlwifi: wireless switch is on
[    6.160511] systemd-udevd[179]: renamed network interface wlan0 to wlan1

So, i changed my interfaces config to:

root@orangepione:~# cat /etc/network/interfaces
# Wired adapter #1
allow-hotplug eth0
iface eth0 inet static
    address 192.168.1.68
    netmask 255.255.255.0
    network 192.168.1.0
    gateway 192.168.1.1

allow-hotplug wlan1
iface wlan0 inet static
    address 192.168.1.69
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 192.168.1.1
dns-nameservers 8.8.8.8
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

But... Unfortunately my problem persists...

 

What should I do?

 

Thank you!

Link to comment
Share on other sites

What should I do?

 

Execute 'netstat -rn' to get the idea why two interfaces connecting to the same network (192.168.1.0/24 in your case) is a bad idea with this kernel/config. The net route to your network uses eth0 (default route as well) so unplugging the cable you'll loose access. I don't know whether it helps to change order of NICs in interfaces file or if you must use scripts to adjust the routes (googling for 'pre-down route add delete' should help)

Link to comment
Share on other sites

Execute 'netstat -rn' to get the idea why two interfaces connecting to the same network (192.168.1.0/24 in your case) is a bad idea with this kernel/config. The net route to your network uses eth0 (default route as well) so unplugging the cable you'll loose access. I don't know whether it helps to change order of NICs in interfaces file or if you must use scripts to adjust the routes (googling for 'pre-down route add delete' should help)

 

Thank you tkaiser!

 

I made a clean install of the latest version of armbian for my Orange Pi One. Then apt-get update, apt-get upgrade etc.

 

Followed again the tutorial and now my OPi keeps rebooting every time my WiFi dongle is connected to the USB port.

 

Much trouble to just make an WiFi dongle to work... I'm thinking about trash out this OPi and going back to Raspberry Pi!

 

[]s!

Link to comment
Share on other sites

Not sure if this is the right place to post, but since instructions on getting hostapd to work were provided here, I'll give it a shot.
 
I am on the orange pi PC
 

dpkg-query -W -f='${Version}\n' linux-jessie-root-orangepipc
5.20

with this dongle which I had lying in a drawer. 

lsusb 
Bus 004 Device 002: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter

from the thread below, I understand that there is a patched module and instructions were given to build and install it, which I did
http://forum.armbian.com/index.php/topic/749-orange-pi-pc-wireless-module-8192cu
 
I can't use "iw"
 

iw wlan0 info
command failed: No such device (-19)

but I can scan for networks
 

iwlist wlan0 scanning
wlan0 Scan completed :
Cell 01 - Address: XX:XX:XX:XX:XX:XX
ESSID:"XXXX"
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.422 GHz (Channel 3)
Encryption key:on
Bit Rates:144 Mb/s
Extra:rsn_ie=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (1) : TKIP
Authentication Suites (1) : PSK
Quality=20/100 Signal level=100/100

so I am assuming that the dongle is ready for hostapd to hookup.  I clone Igor's hostapd repository and ensured I had a successful build, after which I installed the generated deb package

https://github.com/igorpecovnik/hostapd

This gives me 2 binaries, a "standard" one and a patched one. 

 

# hostapd -v
hostapd v2.5
User space daemon for IEEE 802.11 AP management,
IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
Copyright (c) 2002-2015, Jouni Malinen <j@w1.fi> and contributors

# hostapd-rt -v
hostapd v2.5
User space daemon for IEEE 802.11 AP management,
IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
Copyright (c) 2002-2015, Jouni Malinen <j@w1.fi> and contributors

 

so I tried running the realtek version of hostapd as built
 

# hostapd-rt hostapd.realtek.conf
No drivers enabled
Failed to initialize global context

no joy, so try the other version
 

# hostapd hostapd.conf
Configuration file: hostapd.conf
Line 20: unknown configuration item 'noscan'
1 errors found in configuration file 'hostapd.conf'
Failed to set up interface with hostapd.conf
Failed to initialize interface

not good, but let's remove that "noscan" option and see

[color=#222222][font="Helvetica Neue", Arial, Verdana, sans-serif][size=4][background=#ffffff]#hostapd -dd hostapd.conf[/size][/font][/color][/background]

output:

random: Trying to read entropy from /dev/random
Configuration file: hostapd.conf
nl80211: Could not add multicast membership for vendor events: -2 (No such file or directory)
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
nl80211: Remove monitor interface: refcount=0
netlink: Operstate: ifindex=5 linkmode=0 (kernel-control), operstate=6 (IF_OPER_UP)
nl80211: Set mode ifindex 5 iftype 2 (STATION)
nl80211: Failed to set interface 5 to mode 2: -19 (No such device)
nl80211 driver initialization failed.
hostapd_interface_deinit_free(0x1eda2d8)
hostapd_interface_deinit_free: num_bss=1 conf->num_bss=1
hostapd_interface_deinit(0x1eda2d8)
wlan0: interface state UNINITIALIZED->DISABLED
hostapd_bss_deinit: deinit bss wlan0
wlan0: AP-DISABLED
hostapd_cleanup(hapd=0x1edaea8 (wlan0))
hostapd_free_hapd_data: Interface wlan0 wasn't started
hostapd_interface_deinit_free: driver=(nil) drv_priv=(nil) -> hapd_deinit
hostapd_interface_free(0x1eda2d8)
hostapd_interface_free: free hapd 0x1edaea8
hostapd_cleanup_iface(0x1eda2d8)
hostapd_cleanup_iface_partial(0x1eda2d8)
hostapd_cleanup_iface: free iface=0x1eda2d8


 
what seems to be the culprit of my issue is that the nl80211 driver that's used when building hostapd is unable to set the dongle to ap mode 

netlink: Operstate: ifindex=5 linkmode=0 (kernel-control), operstate=6 (IF_OPER_UP)
nl80211: Set mode ifindex 5 iftype 2 (STATION)
nl80211: Failed to set interface 5 to mode 2: -19 (No such device)

so command "ip" shows the interface as being at index 5.

ip link show wlan0
5: wlan0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 00:e0:4c:03:18:be brd ff:ff:ff:ff:ff:ff

this makes me wonder if an empty "iw list" is the issue that would need to be fixed here. 

 

thanks for the help!

 

 
 
Link to comment
Share on other sites

That's great :) , I have Orange Pi PC

 

1> I was just curious that Wireless AP is working with 8188EU only ? [i see admin updated and tested for 8189fs and 8189es too]

any other than this.

2> Will it work with RTL8192 5dbi antenna https://www.aliexpress.com/item/New-150Mbps-Wireless-USB-WiFi-Adapter-Wireless-Dongle-WiFi-Network-LAN-Card-802-11n-g-b/32584964962.html 

3> We got success in armbian only, right ? I had fedora f22 installed from start.

 

 

Thanks again for awesome work and good support by Admin, Staff and members. Cheers !

Link to comment
Share on other sites

Just try new core

 

 

Module connect to internal USB:

USB-DP1

USB-DM1

 

Core;

Linux nanopineo 4.9.0-sun8i #4 SMP Mon Oct 31 04:12:20 CST 2016 armv7l armv7l armv7l GNU/Linux 

 

 

--------------------------------------------------------------------------------- 

$ ifconfig 

 
wlx009f13d0a14d Link encap:Ethernet  HWaddr 00:9f:13:d0:a1:4d
          inet addr:192.168.0.110  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::29f:13ff:fed0:a14d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:491 errors:0 dropped:0 overruns:0 frame:0
          TX packets:302 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:549938 (549.9 KB)  TX bytes:33758 (33.7 KB)
 
-------------------------------------------------------------------------------------
/etc/network/interfaces
 
allow-hotplug wlx009f13d0a14d
iface wlx009f13d0a14d inet dhcp
 
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
 

------------------------------------------------------------------------------------

 

 

 /etc/wpa_supplicant/wpa_supplicant.conf

 
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
 
 
network={
        ssid="your sid"
        psk="your pass"
        key_mgmt=WPA-PSK
}
 
 
---------------------------------------
 
~$ lsmod
Module                  Size  Used by
ccm                     7767  1
rtl8192cu              60443  0
rtl_usb                 9530  1 rtl8192cu
rtl8192c_common        40018  1 rtl8192cu
rtlwifi                59200  3 rtl_usb,rtl8192c_common,rtl8192cu
mac80211              408281  3 rtl_usb,rtlwifi,rtl8192cu
cfg80211              244332  2 mac80211,rtlwifi
rfkill                 12189  3 cfg80211
cpufreq_dt              3887  0
uio_pdrv_genirq         3591  0
thermal_sys            49978  1 cpufreq_dt
uio                     8953  1 uio_pdrv_genirq
 
 
----------------------------------------------------------
 
lsusb
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 
 
 
Its work!

 

But need restart one time.

 

NanoPi Neo

Link to comment
Share on other sites

Hello

 

i have some problems and i don't know why i don't see wlan0 in interfaces.

 

i make everything like in instruction + downloaded 8192cu bin driver and put in lib/firmware/rtlwifi

 

dmesg:

2017-01-02_20h42_03.png

 

Other commands:

2017-01-02_20h45_04.png

Link to comment
Share on other sites

Ok i make this working :) It's easier that described here :)

 

First i downloaded latest armbian 5.20 and installed image to sdcard and connected LAN cable(do not plug wifi adpater).

Then after login i made commands below:

sudo apt-get update

sudo apt-get upgrade

sudo apt-get install git build-essential dkms network-manager

git clone https://github.com/pvaret/rtl8192cu-fixes.git

sudo dkms add ./rtl8192cu-fixes

sudo dkms install 8192cu/1.10

sudo depmod -a

sudo cp ./rtl8192cu-fixes/blacklist-native-rtl8192.conf /etc/modprobe.d/

sudo reboot

Then i plug in my NETIS adapter (RTL8188CUS) and typed:

nmcli -a d wifi connect

 Connected to my WIFI, unplugged LAN, and hardreset device.

 

Thats it :)

Link to comment
Share on other sites

of course i tried this but somehow it not works, instruction from github works.

blacklisting the original driver is missing, the rest is the same - we are using the same (working) driver source.

Link to comment
Share on other sites

Short regression test with OPI ONE/LITE upgraded to Armbian 5.25 / Legacy 3.4.113 shows WIFI still working like a charm. Within the limits of el cheapo 2.4 GHz networking ( noisy environments ) OPI ONE/LITE have shown reliable stable operation for months.

Well done, Armbian team !  

Link to comment
Share on other sites

  • Igor unpinned this topic

Hello,

 

I am encountering problems when trying to setup AP on Opi Lite, using last Armbian update.

I am using default wlan0 embedded wireless for default connection and Tenda W311MI (ra0) dongle for AP mode.

I did configured everything in conformity with the post.

 

Connection to internet via Router is working perfect using any whatever ra0 or wlan0.

When trying to search for AP on my laptop, I do get an Hidden network; I tried to connect but with no result.

I do see that ra0, used by me for AP, states Not-Associated.

 

I am using only /etc/network/interfaces file because when I add wpa_supplicant.conf into interfaces config => None of the networks will start:

Error (triggered when I execute ifup wlan0):

wpa_supplicant: /sbin/wpa_supplicant daemon failed to start
run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
Failed to bring up wlan0  

 

I did attached next relevant files:

/etc/network/interfaces/

====================================================

source /etc/network/interfaces.d/*

### Local loopback ###
auto lo
iface lo inet loopback

### WI-FI WAN Default Network setup ###
auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
  address 192.168.100.53
  netmask 255.255.255.0
  network 192.168.100.0
  broadcast 192.168.100.255
  gateway 192.168.100.1
  dns-nameservers 8.8.8.8 8.8.4.4

wpa-ssid "DIGI-B3ED"
wpa-key-mgmt WPA-PSK
wpa-psk "P9XwDmuF"

### WI-FI WAN AP Network setup ###
auto ra0
allow-hotplug ra0
iface ra0 inet static
  address 192.168.101.53
  netmask 255.255.255.0
  network 192.168.101.0
 

sudo ifconfig

===========================

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B )  TX bytes:0 (0.0 B )

ra0       Link encap:Ethernet  HWaddr 50:2b:73:cc:58:66
          inet addr:192.168.101.53  Bcast:192.168.101.255  Mask:255.255.255.0
          inet6 addr: fe80::522b:73ff:fecc:5866/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1983 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:277632 (271.1 KiB)  TX bytes:1456 (1.4 KiB)

wlan0     Link encap:Ethernet  HWaddr 8a:92:73:b6:05:a1
          inet addr:192.168.100.53  Bcast:192.168.100.255  Mask:255.255.255.0
          inet6 addr: 2a02:2f08:4280:dcd:8892:73ff:feb6:5a1/64 Scope:Global
          inet6 addr: fe80::8892:73ff:feb6:5a1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1005 errors:0 dropped:469 overruns:0 frame:0
          TX packets:219 errors:0 dropped:1 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:259716 (253.6 KiB)  TX bytes:39941 (39.0 KiB)
 

 

sudo iwconfig

===========================

lo        no wireless extensions.

ra0       Ralink STA  ESSID:"11n-AP"  Nickname:"MT7601STA"
          Mode:Auto  Frequency=2.412 GHz  Access Point: Not-Associated
          Bit Rate:1 Mb/s
          RTS thr:off   Fragment thr:off
          Encryption key:off
          Link Quality=10/100  Signal level:0 dBm  Noise level:0 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

wlan0     IEEE 802.11bgn  ESSID:"DIGI-B3ED"  Nickname:"<WIFI@REALTEK>"
          Mode:Managed  Frequency:2.462 GHz  Access Point: 34:6A:C2:CB:FE:7C
          Bit Rate:72.2 Mb/s   Sensitivity:0/0
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:****-****-****-****-****-****-****-****   Security mode:open
          Power Management:off
          Link Quality=86/100  Signal level=100/100  Noise level=0/100
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

 

Can please someone help me?

Thanks.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines